3#include <ToolsFoundation/ToolsFoundationDLL.h>
5#if PL_ENABLED(PL_SUPPORTS_DIRECTORY_WATCHER) && PL_ENABLED(PL_SUPPORTS_FILE_ITERATORS)
7# include <Foundation/Application/Config/FileSystemConfig.h>
8# include <Foundation/Configuration/Singleton.h>
9# include <Foundation/Threading/LockedObject.h>
10# include <Foundation/Types/UniquePtr.h>
11# include <ToolsFoundation/FileSystem/DataDirPath.h>
12# include <ToolsFoundation/FileSystem/Declarations.h>
14class plFileSystemWatcher;
15struct plFileSystemWatcherEvent;
19struct PL_TOOLSFOUNDATION_DLL plFolderChangedEvent
29 plFolderChangedEvent() =
default;
33 Type m_Type = Type::None;
37struct PL_TOOLSFOUNDATION_DLL plFileChangedEvent
50 plFileChangedEvent() =
default;
55 Type m_Type = Type::None;
63class PL_TOOLSFOUNDATION_DLL plFileSystemModel
65 PL_DECLARE_SINGLETON(plFileSystemModel);
97 void Deinitialize(FilesMap* out_pReferencedFiles =
nullptr, FoldersMap* out_pReferencedFolders =
nullptr);
100 void MainThreadTick();
111 const LockedFiles GetFiles()
const;
115 const LockedFolders GetFolders()
const;
142 void CheckFileSystem();
178 void SetAllStatusUnknown();
179 void RemoveStaleFileInfos();
181 void OnAssetWatcherEvent(
const plFileSystemWatcherEvent& e);
185 void RemoveFileOrFolder(
const plDataDirPath& absolutePath,
bool bRecurseIntoFolders);
190 void FireFolderChangedEvent(
const plDataDirPath& file, plFolderChangedEvent::Type type);
197 plEventSubscriptionID m_WatcherSubscription = {};
203 FilesMap m_ReferencedFiles;
204 FoldersMap m_ReferencedFolders;
Definition FileSystemConfig.h:8
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
An atomic boolean variable. This is just a wrapper around an atomic int32 for convenience.
Definition AtomicInteger.h:100
A reference to a file or folder inside a data directory.
Definition DataDirPath.h:18
Definition DynamicArray.h:81
Provides access to an object while managing a lock (e.g. a mutex) that ensures that during its lifeti...
Definition LockedObject.h:7
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76
Holds the stats for a file.
Definition OSFile.h:34
Information about a single file on disk. The file might be a document or any other file found in the ...
Definition Declarations.h:20
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54