Navigation
API > API/Developer > API/Developer/DirectoryWatcher
A class responsible for scanning a directory, and maintaining a cache of its state (files and timestamps). Changes in the cache can be retrieved through GetOutstandingChanges(). Changes will be reported for any change in the cached state even between runs of the process.
| Name | FFileCache |
| Type | class |
| Header File | /Engine/Source/Developer/DirectoryWatcher/Public/FileCache.h |
| Include Path | #include "FileCache.h" |
Syntax
class FFileCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FFileCache
(
const FFileCacheConfig& InConfig |
Construction from a config | FileCache.h | |
FFileCache
(
const FFileCache& |
FileCache.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FFileCache() |
Destructor | FileCache.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AsyncFileHasher | TSharedPtr< FAsyncFileHasher, ESPMode::ThreadSafe > | Asynchronous task used to harvest the MD5 hashes of a set of filenames | FileCache.h | |
| bPendingTransactionsDirty | bool | List of cached pending transactions | FileCache.h | |
| bSavedCacheDirty | bool | True when the cached state we have in memory is more up to date than the serialized file. | FileCache.h | |
| CachedDirectoryState | FDirectoryState | Our in-memory view of the cached directory state. | FileCache.h | |
| Config | FFileCacheConfig | Configuration settings applied on construction | FileCache.h | |
| ConfigDirectoryStandardized | FString | FileCache.h | ||
| DirectoryReader | TSharedPtr< FAsyncDirectoryReader, ESPMode::ThreadSafe > | Asynchronous directory reader responsible for gathering all file/timestamp information recursively from our cache directory | FileCache.h | |
| DirtyFileHasher | TSharedPtr< FAsyncFileHasher, ESPMode::ThreadSafe > | Asynchronous task used to harvest the MD5 hashes of a set of recently changed filenames | FileCache.h | |
| DirtyFiles | TMap< FImmutableString, FFileData > | A map of dirty files that we will use to report changes to the user. | FileCache.h | |
| LastFileHashGetTime | double | The time we last retrieved file hashes from the thread | FileCache.h | |
| PendingTransactions | TArray< FUpdateCacheTransaction > | FileCache.h | ||
| WatcherDelegate | FDelegateHandle | Handle to the directory watcher delegate so we can delete it properly | FileCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CompleteTransaction
(
FUpdateCacheTransaction&& Transaction |
Return a transaction to the cache for completion. | FileCache.h | |
void Destroy() |
Destroy this cache. Cleans out the in-memory state and deletes the cache file, if present. | FileCache.h | |
TArray< FUpdateCacheTransaction > FilterOutstandingChanges
(
TFunctionRef< bool(const FUpdateCacheTransaction&, const FDateTime&)> InPredicate |
Get pending changes to the cache. | FileCache.h | |
const FFileData * FindFileData
(
FImmutableString InFilename |
Attempt to locate file data pertaining to the specified filename. | FileCache.h | |
const FString & GetDirectory() |
Get the absolute path of the directory this cache reflects | FileCache.h | |
int32 GetNumDirtyFiles() |
Get the number of pending changes to the cache. | FileCache.h | |
TArray< FUpdateCacheTransaction > GetOutstandingChanges() |
FileCache.h | ||
bool HasStartedUp () |
Check whether this file cache has finished starting up yet. | FileCache.h | |
void IgnoreDeletedFile
(
const FString& Filename |
FileCache.h | ||
void IgnoreFileModification
(
const FString& Filename |
FileCache.h | ||
void IgnoreMovedFile
(
const FString& SrcFilename, |
FileCache.h | ||
void IgnoreNewFile
(
const FString& Filename |
Report an external change to the manager, such that a subsequent equal change reported by the os be ignored | FileCache.h | |
void IterateOutstandingChanges
(
TFunctionRef< bool(const FUpdateCacheTransaction&, const FDateTime&)> InPredicate |
Iterate the number of pending changes to the cache with the specified predicate. | FileCache.h | |
bool MoveDetectionInitialized () |
Check whether this move/rename detection has been initiated or not. | FileCache.h | |
void Tick() |
Tick this FileCache | FileCache.h | |
void WriteCache() |
Write out the cached file, if we have any changes to write | FileCache.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FFileCache & operator=
(
const FFileCache& |
FileCache.h |