FAsyncDirectoryReader

Class responsible for 'asynchronously' scanning a folder for files and timestamps.

Windows
MacOS
Linux

Inheritance Hierarchy

TSharedFromThis

IAsyncFileCacheTask

FAsyncDirectoryReader

References

Module

DirectoryWatcher

Header

/Engine/Source/Developer/DirectoryWatcher/Public/FileCache.h

Include

#include "FileCache.h"

Syntax

struct FAsyncDirectoryReader : public DirectoryWatcher::IAsyncFileCacheTask

Remarks

Class responsible for 'asynchronously' scanning a folder for files and timestamps. Example usage: FAsyncDirectoryReader Reader(TEXT("C:\Path"), EPathType::Relative);

while(!Reader.IsComplete()) { FPlatformProcess::Sleep(1); Reader.Tick(FTimedSignal(1)); // Do 1 second of work } TOptional<FDirectoryState> State = Reader.GetFinalState();

Constructors

Name Description

Public function

FAsyncDirectoryReader

(
    const FString& InDirectory,
    EPathType InPathType
)

Constructor that sets up the directory reader to the specified directory

Functions

Name Description

Public function

TOptional< F...

 

GetCachedState()

Retrieve the cached state supplied to this class through UseCachedState().

Public function

TArray< FFil...

 

GetFilesThatNeedHashing()

Retrieve the cached state supplied to this class through UseCachedState().

Public function

TOptional< F...

 

GetLiveState()

Get the state of the directory once finished.

Public function

void

 

SetMatchRules

(
    const FMatchRules& InRules
)

Set what files are relevant to this reader.

Public function

void

 

UseCachedState

(
    FDirectoryState InCachedState
)

Instruct the directory reader to use the specified cached state to lookup file hashes, where timestamps haven't changed

Overridden from IAsyncFileCacheTask

Name Description

Public function Virtual Const

bool

 

IsComplete()

Returns true when this directory reader has finished scanning the directory

Public function Virtual

EProgressRes...

 

Tick

(
    const FTimeLimit& Limit
)

Tick this reader (discover new directories / files). Returns progress state.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss