![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AssetDataGathererPrivate.h>
Inheritance diagram for UE::AssetDataGather::Private::FScanDir:Classes | |
| struct | FInherited |
Protected Member Functions | |
| void | SetComplete (bool bInIsComplete) |
| bool | HasPersistentSettings () const |
| FScanDir * | FindSubDir (FStringView SubDirBaseName) |
| const FScanDir * | FindSubDir (FStringView SubDirBaseName) const |
| FScanDir & | FindOrAddSubDir (FStringView SubDirBaseName) |
| void | RemoveSubDir (FStringView SubDirBaseName) |
| int32 | FindLowerBoundSubDir (FStringView SubDirBaseName) |
| template<typename CallbackType > | |
| void | ForEachSubDir (const CallbackType &Callback) |
| template<typename CallbackType > | |
| void | ForEachDescendent (const CallbackType &Callback) |
Protected Attributes | |
| TArray< TRefCountPtr< FScanDir > > | SubDirs |
| TArray< FString > | AlreadyScannedFiles |
| FMountDir * | MountDir = nullptr |
| FScanDir * | Parent = nullptr |
| FString | RelPath |
| FInherited | DirectData |
| bool | bHasScanned = false |
| bool | bScanInFlight = false |
| bool | bScanInFlightInvalidated = false |
| bool | bIsComplete = false |
Tree data node representing a directory in the scan; direct subdirectories are stored as other FScanDir instances referenced from the SubDirs array. Directories are removed from the tree once their scans are finished to save memory. Queries take into account that deleted nodes have been completed.
This class is not ThreadSafe; The FAssetDataDiscovery reads/writes its data only while holding TreeLock.
| UE::AssetDataGather::Private::FScanDir::FScanDir | ( | FMountDir & | InMountDir, |
| FScanDir * | InParent, | ||
| FStringView | RelPath | ||
| ) |
| UE::AssetDataGather::Private::FScanDir::~FScanDir | ( | ) |
| void UE::AssetDataGather::Private::FScanDir::AppendLocalAbsPath | ( | FStringBuilderBase & | OutFullPath | ) | const |
Calculate this ScanDir's full absolute path by accumulating RelPaths from parents and append it.
| void UE::AssetDataGather::Private::FScanDir::AppendMountRelPath | ( | FStringBuilderBase & | OutRelPath | ) | const |
Calculate the relative path from the MountPoint to this ScanDir and append it to OutRelPath.
|
protected |
Find the index of the subdir with the given Relative path.
|
protected |
Find the ScanDir subdirectory for the given basename, and add it if it does not exist.
|
protected |
Find the ScanDir subdirectory for the given basename, or return nullptr.
|
protected |
|
protected |
Call the given lambda void(FScanDir&) on each present-in-memory descedent ScanDir of this. Does not look for directories on disk, only the ones that have already been created in memory. Depth-first-search traversal, called on parents before children.
Depth-first-search traversal of all descedent subdirs under this (not including this). Callback is called on parents before children.
|
protected |
Call the given lambda void(FScanDir&) on each existing SubDir.
| SIZE_T UE::AssetDataGather::Private::FScanDir::GetAllocatedSize | ( | ) | const |
Return the memory used by the tree under this ScanDir; excludes sizeof(*this).
| FScanDir * UE::AssetDataGather::Private::FScanDir::GetControllingDir | ( | FStringView | InRelPath, |
| bool | bIsDirectory, | ||
| const FInherited & | ParentData, | ||
| FInherited & | OutData, | ||
| FString & | OutRelPath | ||
| ) |
Find the Direct parent of InRelPath, or a fallback. Will return null only if !bIsDirectory and InRelPath is empty. The fallback is returned if InRelPath has already completed and been deleted, or if InRelPath is not monitored. The fallback is the lowest existing parent directory of InRelPath.
| FScanDir * UE::AssetDataGather::Private::FScanDir::GetFirstIncompleteScanDir | ( | ) |
| FString UE::AssetDataGather::Private::FScanDir::GetLocalAbsPath | ( | ) | const |
Calculate this ScanDir's full absolute path by accumulating RelPaths from parents and return it as a string.
| void UE::AssetDataGather::Private::FScanDir::GetMonitorData | ( | FStringView | InRelPath, |
| const FInherited & | ParentData, | ||
| FInherited & | OutData | ||
| ) | const |
Report whether the given RelPath is allow listed and not deny listed, based on parent data and on the discovered settings on Stem ScanDirs between *this and the leaf path.
| FMountDir * UE::AssetDataGather::Private::FScanDir::GetMountDir | ( | ) | const |
| FString UE::AssetDataGather::Private::FScanDir::GetMountRelPath | ( | ) | const |
Calculate the relative path from the MountPoint to this ScanDir and return it as a string.
| FStringView UE::AssetDataGather::Private::FScanDir::GetRelPath | ( | ) | const |
Get this ScanDir's RelPath from its Parent
|
protected |
Return whether this ScanDir has direct settings (allow list, deny list, etc) that we need to preserve on it even if has finished scanning.
| bool UE::AssetDataGather::Private::FScanDir::HasScanned | ( | ) | const |
Report whether this ScanDir has been scanned.
| bool UE::AssetDataGather::Private::FScanDir::IsComplete | ( | ) | const |
Report whether this ScanDir is complete: has scanned or should not scan, and all subdirs have completed.
| bool UE::AssetDataGather::Private::FScanDir::IsMonitored | ( | const FInherited & | ParentData | ) | const |
Return whether this scandir is allow listed and not deny listed and hence needs to be or has been scanned.
| bool UE::AssetDataGather::Private::FScanDir::IsScanInFlight | ( | ) | const |
Thread-synchronization helper - return true if the Tick thread is in the middle of scanning this directory.
| bool UE::AssetDataGather::Private::FScanDir::IsScanInFlightInvalidated | ( | ) | const |
Thread-synchronization helper - report whether a non tick thread has marked that this directory is changed or invalidated and the scan should be thrown out.
| bool UE::AssetDataGather::Private::FScanDir::IsValid | ( | ) | const |
Check whether this ScanDir is alive; it may have been marked for destruction and cleared on another thread.
Set completion flags on this and its parents (and optionally its descendents) so that it will be updated again.
| void UE::AssetDataGather::Private::FScanDir::MarkFileAlreadyScanned | ( | FStringView | BaseName | ) |
Mark that the given file has already been scanned, so that it will not be double reporting in the upcoming directory scan, if one is upcoming.
|
protected |
Find the ScanDir subdirectory for the given basename, and if it exists, Shutdown and remove it from SubDirs, which will eventually delete it.
Setting to complete marks that this directory has been scanned, and all of its subdirectories have scanned as well, so it can be skipped when it or its parent is waited on. Setting back to incomplete can occur when a AssetDataGatherer client wants to rescan the directory.
Thread-synchronization helper - set that the Tick thread is starting/done with the scan of this directory.
Thread-synchronization helper - set that the current ongoing scan is invalidated, or clear the marker from the tick thread once it has been consumed.
| void UE::AssetDataGather::Private::FScanDir::SetScanResults | ( | FStringView | LocalAbsPath, |
| const FInherited & | ParentData, | ||
| TArrayView< FDiscoveredPathData > & | InOutSubDirs, | ||
| TArrayView< FDiscoveredPathData > & | InOutFiles | ||
| ) |
Called from the Tick; handle the list of subdirs and files that were found from IterateDirectoryStat called on this ScanDir, reporting discovered files and updating status variables.
| bool UE::AssetDataGather::Private::FScanDir::ShouldScan | ( | const FInherited & | ParentData | ) | const |
Report whether this ScanDir will be scanned in the current or future Tick.
| void UE::AssetDataGather::Private::FScanDir::Shrink | ( | ) |
Minimize data in internal buffers.
| void UE::AssetDataGather::Private::FScanDir::Shutdown | ( | ) |
Marks that this ScanDir is no longer in use and clear its data. The ScanDir will remain allocated until all threads have dropped their reference to it.
| void UE::AssetDataGather::Private::FScanDir::TrySetDirectoryProperties | ( | FPathExistence & | QueryPath, |
| FStringView | InRelPath, | ||
| FInherited & | ParentData, | ||
| const FSetPathProperties & | InProperties, | ||
| FScanDirAndParentData & | OutControllingDir, | ||
| FStringView & | OutControllingDirRelPath, | ||
| bool & | bInOutMadeChanges | ||
| ) |
Set values of fields on the given directory indicated by InRelPath for all properties existing on InProperties.
| bInOutMadeChanges | Set to true if any changes are made. Caller is responsible for initializing to false. |
| void UE::AssetDataGather::Private::FScanDir::Update | ( | TArray< FScanDirAndParentData > & | OutScanRequests, |
| const FScanDir::FInherited & | ParentData | ||
| ) |
Update the completion state of this ScanDir and all ScanDirs under it based on each dir's scan status and its child dirs' completion state. Add any ScanDirs that need to be scanned to OutScanRequests.
|
protected |
|
protected |
Whether each piece of the inherited data has been set directly on this directory
|
protected |
|
protected |
|
protected |
|
protected |