2014-12-07 19:09:38 -05:00
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# pragma once
class FPathTreeNode
{
public :
2015-02-24 21:38:16 -05:00
FPathTreeNode ( const FString & InFolderName ) ;
FPathTreeNode ( FName InFolderName ) ;
2014-03-14 14:13:41 -04:00
~ FPathTreeNode ( ) ;
/** Adds the path to the tree relative to this node, creating nodes as needed. Returns true if the specified path was actually added (as opposed to already existed) */
bool CachePath ( const FString & Path ) ;
/** Removes the specified path in the tree relative to this node. Returns true if the folder was found and removed. */
bool RemoveFolder ( const FString & Path ) ;
/** Recursively gathers all child paths from the specified base path relative to this node */
bool GetSubPaths ( const FString & BasePath , TSet < FName > & OutPaths , bool bRecurse = true ) const ;
private :
/** Helper function for CachePath. PathElements is the tokenized path delimited by "/" */
bool CachePath_Recursive ( TArray < FString > & PathElements ) ;
/** Helper function for RemoveFolder. PathElements is the tokenized path delimited by "/" */
bool RemoveFolder_Recursive ( TArray < FString > & PathElements ) ;
/** Finds a node specified by the supplied tokenized PathElements list */
const FPathTreeNode * FindNode_Recursive ( TArray < FString > & PathElements ) const ;
/** Helper function for recursive all subpath gathering. Currentpath is the string version of the parent node. */
void GetSubPaths_Recursive ( const FString & CurrentPath , TSet < FName > & OutPaths , bool bRecurse = true ) const ;
2015-02-24 21:38:16 -05:00
private :
// Experimental FName version of PathTreeNode functions. Only used when launching with -PathTreeFNames
bool CachePath_Recursive ( TArray < FName > & PathElements ) ;
bool RemoveFolder_Recursive ( TArray < FName > & PathElements ) ;
const FPathTreeNode * FindNode_Recursive ( TArray < FName > & PathElements ) const ;
2014-03-14 14:13:41 -04:00
private :
/** The short folder name in the tree (no path) */
FString FolderName ;
2015-02-24 21:38:16 -05:00
/** Experimental FName folder */
FName FolderFName ;
2014-03-14 14:13:41 -04:00
/** The child node list for this node */
TArray < FPathTreeNode * > Children ;
} ;