UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::AssetDataGather::Private::FScanDir Class Reference

#include <AssetDataGathererPrivate.h>

+ Inheritance diagram for UE::AssetDataGather::Private::FScanDir:

Classes

struct  FInherited
 

Public Member Functions

 FScanDir (FMountDir &InMountDir, FScanDir *InParent, FStringView RelPath)
 
 ~FScanDir ()
 
void Shutdown ()
 
bool IsValid () const
 
FMountDirGetMountDir () const
 
FStringView GetRelPath () const
 
void AppendLocalAbsPath (FStringBuilderBase &OutFullPath) const
 
FString GetLocalAbsPath () const
 
void AppendMountRelPath (FStringBuilderBase &OutRelPath) const
 
FString GetMountRelPath () const
 
void GetMonitorData (FStringView InRelPath, const FInherited &ParentData, FInherited &OutData) const
 
bool IsMonitored (const FInherited &ParentData) const
 
bool ShouldScan (const FInherited &ParentData) const
 
bool HasScanned () const
 
bool IsComplete () const
 
SIZE_T GetAllocatedSize () const
 
FScanDirGetControllingDir (FStringView InRelPath, bool bIsDirectory, const FInherited &ParentData, FInherited &OutData, FString &OutRelPath)
 
void TrySetDirectoryProperties (FPathExistence &QueryPath, FStringView InRelPath, FInherited &ParentData, const FSetPathProperties &InProperties, FScanDirAndParentData &OutControllingDir, FStringView &OutControllingDirRelPath, bool &bInOutMadeChanges)
 
void MarkFileAlreadyScanned (FStringView BaseName)
 
void SetScanResults (FStringView LocalAbsPath, const FInherited &ParentData, TArrayView< FDiscoveredPathData > &InOutSubDirs, TArrayView< FDiscoveredPathData > &InOutFiles)
 
void Update (TArray< FScanDirAndParentData > &OutScanRequests, const FScanDir::FInherited &ParentData)
 
FScanDirGetFirstIncompleteScanDir ()
 
bool IsScanInFlight () const
 
void SetScanInFlight (bool bInScanInFlight)
 
bool IsScanInFlightInvalidated () const
 
void SetScanInFlightInvalidated (bool bInValidated)
 
void MarkDirty (bool bMarkDescendents)
 
void Shrink ()
 
- Public Member Functions inherited from FRefCountBase
 FRefCountBase ()=default
 
virtual ~FRefCountBase ()=default
 
 FRefCountBase (const FRefCountBase &Rhs)=delete
 
FRefCountBaseoperator= (const FRefCountBase &Rhs)=delete
 
FReturnedRefCountValue AddRef () const
 
uint32 Release () const
 
uint32 GetRefCount () const
 

Protected Member Functions

void SetComplete (bool bInIsComplete)
 
bool HasPersistentSettings () const
 
FScanDirFindSubDir (FStringView SubDirBaseName)
 
const FScanDirFindSubDir (FStringView SubDirBaseName) const
 
FScanDirFindOrAddSubDir (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
 
FMountDirMountDir = nullptr
 
FScanDirParent = nullptr
 
FString RelPath
 
FInherited DirectData
 
bool bHasScanned = false
 
bool bScanInFlight = false
 
bool bScanInFlightInvalidated = false
 
bool bIsComplete = false
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FScanDir()

UE::AssetDataGather::Private::FScanDir::FScanDir ( FMountDir InMountDir,
FScanDir InParent,
FStringView  RelPath 
)

◆ ~FScanDir()

UE::AssetDataGather::Private::FScanDir::~FScanDir ( )

Member Function Documentation

◆ AppendLocalAbsPath()

void UE::AssetDataGather::Private::FScanDir::AppendLocalAbsPath ( FStringBuilderBase OutFullPath) const

Calculate this ScanDir's full absolute path by accumulating RelPaths from parents and append it.

◆ AppendMountRelPath()

void UE::AssetDataGather::Private::FScanDir::AppendMountRelPath ( FStringBuilderBase OutRelPath) const

Calculate the relative path from the MountPoint to this ScanDir and append it to OutRelPath.

◆ FindLowerBoundSubDir()

int32 UE::AssetDataGather::Private::FScanDir::FindLowerBoundSubDir ( FStringView  SubDirBaseName)
protected

Find the index of the subdir with the given Relative path.

◆ FindOrAddSubDir()

FScanDir & UE::AssetDataGather::Private::FScanDir::FindOrAddSubDir ( FStringView  SubDirBaseName)
protected

Find the ScanDir subdirectory for the given basename, and add it if it does not exist.

◆ FindSubDir() [1/2]

FScanDir * UE::AssetDataGather::Private::FScanDir::FindSubDir ( FStringView  SubDirBaseName)
protected

Find the ScanDir subdirectory for the given basename, or return nullptr.

◆ FindSubDir() [2/2]

const FScanDir * UE::AssetDataGather::Private::FScanDir::FindSubDir ( FStringView  SubDirBaseName) const
protected

◆ ForEachDescendent()

template<typename CallbackType >
void UE::AssetDataGather::Private::FScanDir::ForEachDescendent ( const CallbackType Callback)
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.

◆ ForEachSubDir()

template<typename CallbackType >
void UE::AssetDataGather::Private::FScanDir::ForEachSubDir ( const CallbackType Callback)
protected

Call the given lambda void(FScanDir&) on each existing SubDir.

◆ GetAllocatedSize()

SIZE_T UE::AssetDataGather::Private::FScanDir::GetAllocatedSize ( ) const

Return the memory used by the tree under this ScanDir; excludes sizeof(*this).

◆ GetControllingDir()

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.

◆ GetFirstIncompleteScanDir()

FScanDir * UE::AssetDataGather::Private::FScanDir::GetFirstIncompleteScanDir ( )

◆ GetLocalAbsPath()

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.

◆ GetMonitorData()

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.

◆ GetMountDir()

FMountDir * UE::AssetDataGather::Private::FScanDir::GetMountDir ( ) const

◆ GetMountRelPath()

FString UE::AssetDataGather::Private::FScanDir::GetMountRelPath ( ) const

Calculate the relative path from the MountPoint to this ScanDir and return it as a string.

◆ GetRelPath()

FStringView UE::AssetDataGather::Private::FScanDir::GetRelPath ( ) const

Get this ScanDir's RelPath from its Parent

◆ HasPersistentSettings()

bool UE::AssetDataGather::Private::FScanDir::HasPersistentSettings ( ) const
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.

◆ HasScanned()

bool UE::AssetDataGather::Private::FScanDir::HasScanned ( ) const

Report whether this ScanDir has been scanned.

◆ IsComplete()

bool UE::AssetDataGather::Private::FScanDir::IsComplete ( ) const

Report whether this ScanDir is complete: has scanned or should not scan, and all subdirs have completed.

◆ IsMonitored()

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.

◆ IsScanInFlight()

bool UE::AssetDataGather::Private::FScanDir::IsScanInFlight ( ) const

Thread-synchronization helper - return true if the Tick thread is in the middle of scanning this directory.

◆ IsScanInFlightInvalidated()

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.

◆ IsValid()

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.

◆ MarkDirty()

void UE::AssetDataGather::Private::FScanDir::MarkDirty ( bool  bMarkDescendents)

Set completion flags on this and its parents (and optionally its descendents) so that it will be updated again.

◆ MarkFileAlreadyScanned()

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.

◆ RemoveSubDir()

void UE::AssetDataGather::Private::FScanDir::RemoveSubDir ( FStringView  SubDirBaseName)
protected

Find the ScanDir subdirectory for the given basename, and if it exists, Shutdown and remove it from SubDirs, which will eventually delete it.

◆ SetComplete()

void UE::AssetDataGather::Private::FScanDir::SetComplete ( bool  bInIsComplete)
protected

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.

◆ SetScanInFlight()

void UE::AssetDataGather::Private::FScanDir::SetScanInFlight ( bool  bInScanInFlight)

Thread-synchronization helper - set that the Tick thread is starting/done with the scan of this directory.

◆ SetScanInFlightInvalidated()

void UE::AssetDataGather::Private::FScanDir::SetScanInFlightInvalidated ( bool  bInValidated)

Thread-synchronization helper - set that the current ongoing scan is invalidated, or clear the marker from the tick thread once it has been consumed.

◆ SetScanResults()

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.

◆ ShouldScan()

bool UE::AssetDataGather::Private::FScanDir::ShouldScan ( const FInherited ParentData) const

Report whether this ScanDir will be scanned in the current or future Tick.

◆ Shrink()

void UE::AssetDataGather::Private::FScanDir::Shrink ( )

Minimize data in internal buffers.

◆ Shutdown()

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.

◆ TrySetDirectoryProperties()

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.

Parameters
bInOutMadeChangesSet to true if any changes are made. Caller is responsible for initializing to false.

◆ Update()

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.

Member Data Documentation

◆ AlreadyScannedFiles

TArray<FString> UE::AssetDataGather::Private::FScanDir::AlreadyScannedFiles
protected

◆ bHasScanned

bool UE::AssetDataGather::Private::FScanDir::bHasScanned = false
protected

◆ bIsComplete

bool UE::AssetDataGather::Private::FScanDir::bIsComplete = false
protected

◆ bScanInFlight

bool UE::AssetDataGather::Private::FScanDir::bScanInFlight = false
protected

◆ bScanInFlightInvalidated

bool UE::AssetDataGather::Private::FScanDir::bScanInFlightInvalidated = false
protected

◆ DirectData

FInherited UE::AssetDataGather::Private::FScanDir::DirectData
protected

Whether each piece of the inherited data has been set directly on this directory

◆ MountDir

FMountDir* UE::AssetDataGather::Private::FScanDir::MountDir = nullptr
protected

◆ Parent

FScanDir* UE::AssetDataGather::Private::FScanDir::Parent = nullptr
protected

◆ RelPath

FString UE::AssetDataGather::Private::FScanDir::RelPath
protected

◆ SubDirs

TArray<TRefCountPtr<FScanDir> > UE::AssetDataGather::Private::FScanDir::SubDirs
protected

The documentation for this class was generated from the following files: