Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TDirectoryTree
A tree structure; each node has a sorted array of child paths and a matching array of child nodes. Child paths are relative paths and are organized by the FirstComponent of their relative path. If there is only a single child path with a given FirstComponent, the entire relative path to that child is listed as the relative path. If there are two or more paths with the same first component, a new child node is created for the first component, and the paths are then children of that component. Example: Root / (FullPath: /) A (FullPath: /A X (FullPath: /A/X Y/M (FullPath: /A/Y/M) B/Z (FullPath: /B/Z) N (FullPath: /B/Z/N) O (FullPath: /B/Z/O) C/W/P (FullPath: /C/W/P)
| Name | FTreeNode |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/DirectoryTree.h |
| Include Path | #include "Containers/DirectoryTree.h" |
Syntax
struct FTreeNode
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTreeNode
(
const FTreeNode& Other |
Containers/DirectoryTree.h | ||
FTreeNode
(
FTreeNode&& Other |
Containers/DirectoryTree.h | ||
FTreeNode () |
Containers/DirectoryTree.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FlagsMask | uint32 | Containers/DirectoryTree.h | |
| FlagsShift | uint32 | Containers/DirectoryTree.h | |
| NumFlagBits | uint32 | Containers/DirectoryTree.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CapacityChildNodes | int32 | Containers/DirectoryTree.h | ||
| ChildNodes | TUniquePtr< FTreeNode[]> | Containers/DirectoryTree.h | ||
| NumChildNodesAndFlags | uint32 | Containers/DirectoryTree.h | ||
| RelPaths | TUniquePtr< FString[]> | Containers/DirectoryTree.h | ||
| Value | TTypeCompatibleBytes< ValueType > | Containers/DirectoryTree.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ContainsChildPaths
(
FStringView InRelPath |
Recursively search this node's subtree for the given relative path, then return whether that path has any children. | Containers/DirectoryTree.h | |
ValueType * Find
(
FStringView InRelPath |
Return pointer to the Value stored in RelPath, if RelPath exists in the tree. | Containers/DirectoryTree.h | |
ValueType & FindOrAdd
(
FStringView InRelPath, |
Recursively search the node's subtree to find the given relative directory name, adding nodes for the path and its parents if required. | Containers/DirectoryTree.h | |
void FixupDirectChildrenPathSeparator
(
TCHAR OldSeparator, |
Containers/DirectoryTree.h | ||
SIZE_T GetAllocatedSize() |
How much memory is used by *this, not counting sizeof(*this). | Containers/DirectoryTree.h | |
int32 GetNumChildNodes() |
Containers/DirectoryTree.h | ||
const ValueType & GetValue () |
Get a reference to the node's Value. Invalid to call if !HasValue. | Containers/DirectoryTree.h | |
ValueType & GetValue () |
Get a reference to the node's Value. Invalid to call if !HasValue. | Containers/DirectoryTree.h | |
bool HasValue () |
Report whether the node has a value, which is equivalent to the node's path existing in the DirectoryTree. | Containers/DirectoryTree.h | |
bool IsEmpty() |
Are no paths contained within the node. | Containers/DirectoryTree.h | |
void Remove
(
FStringView InRelPath, |
Remove the Value if it exists in the tree. | Containers/DirectoryTree.h | |
void RemoveValue() |
Set HasValue=false, and destruct any existing old value. | Containers/DirectoryTree.h | |
void Reset() |
Remove Value and ChildNodes, return state to default-constructed state. | Containers/DirectoryTree.h | |
void SetDefaultValue() |
Set HasValue=true, and default-construct the node's value, after destructing any existing old value. | Containers/DirectoryTree.h | |
void SetValue
(
ValueType&& InValue |
Set HasValue=true, and move InValue into the node's value, after destructing any existing old value. | Containers/DirectoryTree.h | |
void Shrink() |
Reduce memory used in buffers. | Containers/DirectoryTree.h | |
ValueType * TryFindClosestPath
(
FStringView RelPath, |
Recursively search the node's subtree to find the given RelPath. | Containers/DirectoryTree.h | |
bool TryGetChildren
(
FStringBuilderBase& ReportedPathPrefix, |
Containers/DirectoryTree.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ConditionalCompactNode
(
FString& RelPath, |
Merge the node with its direct child if possible, and if so adjust the input RelPath to match. | Containers/DirectoryTree.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTreeNode & operator=
(
const FTreeNode& Other |
Containers/DirectoryTree.h | ||
FTreeNode & operator=
(
FTreeNode&& Other |
Containers/DirectoryTree.h |