Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::FileSystem Class Referencefinal

Disk-backed implementation of IAssetLoader. More...

#include <flint/resource/filesystem.h>

+ Inheritance diagram for Flint::FileSystem:
+ Collaboration diagram for Flint::FileSystem:

Public Member Functions

 FileSystem (std::filesystem::path root)
 Construct a FileSystem rooted at root.
 
std::vector< char > getAsset (const std::string &path) override
 Read the entire file at path and return its bytes.
 
uint64_t getAssetRevision (const std::string &path) const override
 Return the file's last-write-time tick count as a revision.
 
bool hasAsset (const std::string &path) const override
 Check whether a regular file exists at path.
 
bool isDoneLoading () const override
 Always true; FileSystem is synchronous with no background loading phase.
 
- Public Member Functions inherited from Flint::IAssetLoader

Detailed Description

Disk-backed implementation of IAssetLoader.

Loads assets from a directory tree rooted at the path given to the constructor. All asset paths are relative to that root; paths with a root name or root directory are rejected, as are paths whose canonical form resolves outside the root (including via symlinks).

Revision tracking uses file modification time, so changes are detected without re-reading contents. See getAssetRevision().

Thread safety

No internal synchronisation; concurrent calls require external locking.

Definition at line 31 of file filesystem.h.


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