FAsyncDirectoryReader

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

Unreal Engine C++ API Reference > Developer > DirectoryWatcher

Inheritance Hierarchy

References

   
Module DirectoryWatcher
Header /Engine/Source/Developer/DirectoryWatcher/Public/FileCache.h
Include #include "FileCache.h"

Syntax

struct FAsyncDirectoryReader : public [DirectoryWatcher::IAsyncFileCacheTask](API\Developer\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 State = Reader.GetFinalState();

Constructors

Type Name Description
  FAsyncDirectoryReader ( const FString& InDirectory, EPathType InPathType ) Constructor that sets up the directory reader to the specified directory

Functions

Type Name Description
TOptional< F... GetCachedState () Retrieve the cached state supplied to this class through UseCachedState().
TArray< FFil... GetFilesThatNeedHashing () Retrieve the cached state supplied to this class through UseCachedState().
TOptional< F... GetLiveState () Get the state of the directory once finished.
void SetMatchRules ( const FMatchRules& InRules ) Set what files are relevant to this reader.
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

Type Name Description
bool IsComplete () Returns true when this directory reader has finished scanning the directory
EProgressRes... Tick ( const FTimeLimit& Limit ) Tick this reader (discover new directories / files). Returns progress state.

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library