Navigation
API > API/Runtime > API/Runtime/Core
Container for path -> value that can efficiently report whether a parent directory of a given path exists. Supports relative and absolute paths. Supports LongPackageNames and LocalPaths.
Note about Value comparisons: Case-insensitive / is treated as equal to \ Presence or absence of terminating separator (/) is ignored in the comparison. Directory elements of . and .. are currently not interpreted and are treated as literal characters. Callers should not rely on this behavior as it may be corrected in the future. callers should instead conform the paths before calling. Relative paths and absolute paths are not resolved, and relative paths will never equal absolute paths. Callers should not rely on this behavior as it may be corrected in the future; callers should instead conform the paths before calling.
For functions that find parent paths, parent paths are only discovered if they are conformed to the same format as the given path: both paths must be either relative or absolute.
For functions that return Values by reference or by pointer, that reference or pointer can be invalidated by any functions that modify the tree, and should be discarded before calling any such functions.
Some functions that report results for directories behave differently for added directories versus implied directories. An added directory is one that was added specifically via FindOrAdd or other mutators. An implied directory is a directory that is not added, but that has a child path that is added to the tree.
| Name | TDirectoryTree |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/DirectoryTree.h |
| Include Path | #include "Containers/DirectoryTree.h" |
Syntax
template<typename ValueType>
class TDirectoryTree
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Containers/DirectoryTree.h | |||
TDirectoryTree
(
const TDirectoryTree& Other |
Containers/DirectoryTree.h | ||
TDirectoryTree
(
TDirectoryTree&& Other |
Containers/DirectoryTree.h |
Structs
| Name | Remarks |
|---|---|
| FIterationSentinel | Sentinel type used to mark the end of ranged-for iteration. |
| FIteratorInternal | |
| FTreeNode | A tree structure; each node has a sorted array of child paths and a matching array of child nodes. |
| TIterator | Iterator used when iterating paths added to the tree, and skipping implied parent directories that were not added to the tree and have no Value data. |
| TPointerIterator | Iterator used when iterating all paths in the tree, both added or implied. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FConstIterator | TIterator< const ValueType > | Containers/DirectoryTree.h | |
| FConstPointerIterator | TPointerIterator< const ValueType > | Containers/DirectoryTree.h | |
| FIterator | TIterator< ValueType > | Containers/DirectoryTree.h | |
| FPointerIterator | TPointerIterator< ValueType > | Containers/DirectoryTree.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bNeedDriveWithoutPathFixup | bool | Containers/DirectoryTree.h | ||
| bPathSeparatorInitialized | bool | Containers/DirectoryTree.h | ||
| NumPaths | int32 | Containers/DirectoryTree.h | ||
| PathSeparator | TCHAR | Containers/DirectoryTree.h | ||
| Root | FTreeNode | Containers/DirectoryTree.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FConstIterator begin () |
Containers/DirectoryTree.h | ||
FIterator begin () |
Ranged-for accessor for elements in the tree. Same behavior as | Containers/DirectoryTree.h | |
bool Contains
(
FStringView Path |
Return whether the given path has been added to the tree. | Containers/DirectoryTree.h | |
bool ContainsChildPaths
(
FStringView Path |
Return whether any children of the given path have been added to the tree. | Containers/DirectoryTree.h | |
bool ContainsPathOrParent
(
FStringView Path |
Return whether the given path or any of its parent paths exist in the tree. | Containers/DirectoryTree.h | |
FConstIterator CreateConstIterator() |
Containers/DirectoryTree.h | ||
FConstPointerIterator CreateConstIteratorForImplied() |
Containers/DirectoryTree.h | ||
FIterator CreateIterator () |
Iterator accessor for path,value pairs that were added to the tree. | Containers/DirectoryTree.h | |
FPointerIterator CreateIteratorForImplied () |
Iterator accessor for all paths, added or implied, in the tree. | Containers/DirectoryTree.h | |
void Empty() |
Remove all paths and all memory usage from the tree. | Containers/DirectoryTree.h | |
FIterationSentinel end() |
Containers/DirectoryTree.h | ||
const ValueType * Find
(
FStringView Path |
Return a const pointer to the Value set for the given path, or null if it does not exist. | Containers/DirectoryTree.h | |
ValueType * Find
(
FStringView Path |
Return a pointer to the Value set for the given path, or null if it does not exist. | Containers/DirectoryTree.h | |
ValueType * FindClosestValue
(
FStringView Path |
Return a pointer to the path's value if it exists, or to its closest parent path's value, if any of them exist. | Containers/DirectoryTree.h | |
const ValueType * FindClosestValue
(
FStringView Path |
Return a const pointer to the path's value if it exists, or to its closest parent path's value, if any of them exist. | Containers/DirectoryTree.h | |
ValueType & FindOrAdd
(
FStringView Path, |
Add a path to the tree if it does not already exist. | Containers/DirectoryTree.h | |
SIZE_T GetAllocatedSize() |
How much memory is used by *this, not counting sizeof(*this). | Containers/DirectoryTree.h | |
bool IsEmpty() |
Return true if no paths are in the tree. | Containers/DirectoryTree.h | |
int32 Num() |
Return the number of paths in the tree. | Containers/DirectoryTree.h | |
void Remove
(
FStringView Path, |
Remove a path from the tree and optionally report whether it existed. | Containers/DirectoryTree.h | |
void Shrink() |
Free unused slack memory throughout the tree by reallocating containers tightly to their current size. | Containers/DirectoryTree.h | |
bool TryFindClosestPath
(
FStringView Path, |
Return whether the given path or any of its parent paths exist in the tree. | Containers/DirectoryTree.h | |
bool TryFindClosestPath
(
FStringView Path, |
Return whether the given path or any of its parent paths exist in the tree. | Containers/DirectoryTree.h | |
bool TryFindClosestPath
(
FStringView Path, |
Return whether the given path or any of its parent paths exist in the tree. | Containers/DirectoryTree.h | |
bool TryFindClosestPath
(
FStringView Path, |
Return whether the given path or any of its parent paths exist in the tree. | Containers/DirectoryTree.h | |
bool TryGetChildren
(
FStringView Path, |
Report the children (optionally recursive or not, optionally implied or not) in the tree of a given Path (optionally skipped if implied). | Containers/DirectoryTree.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TDirectoryTree & operator=
(
TDirectoryTree&& Other |
Containers/DirectoryTree.h | ||
TDirectoryTree & operator=
(
const TDirectoryTree& Other |
Containers/DirectoryTree.h |