Engine → Core → memory_file_system.h
vfs::memory_file_system
| Type | Class |
| Namespace | conjure::core::vfs |
| Include File Path | engine/include/conjure/core/vfs/memory_file_system.h |
| Source File Path | engine/src/core/vfs/memory_file_system.cpp |
| API ↗ | Files and the virtual file system |
Syntax
Inheritance Hierarchy
vfs::file_system → vfs::memory_file_system
Constructors
| Access | Signature | Description |
|---|---|---|
| public | memory_file_system(); |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~memory_file_system() override; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mMutex | mutable std::mutex | {} | |
| private | mReadOnly | std::atomic<bool> | false | |
| private | mRoot | std::unique_ptr<node> | {} | |
| private | m | u64 | 0 |
Functions
Public
create_directories
create_directories[[nodiscard]] result<void> create_directories(
std::string_view path) override;enumerate
enumerate[[nodiscard]] result<void> enumerate(
std::string_view directory,
enumerate_flags flags,
const enumerate_callback &callback) override;is_read_only
is_read_only[[nodiscard]] bool is_read_only() const noexcept override;read_file
read_file[[nodiscard]] result<std::vector<std::byte>> read_file(
std::string_view path) override;remove
remove[[nodiscard]] result<void> remove(
std::string_view path) override;remove_all
remove_all[[nodiscard]] result<void> remove_all(
std::string_view path) override;rename
rename[[nodiscard]] result<void> rename(
std::string_view from,
std::string_view to) override;set_read_only
set_read_onlyvoid set_read_only(
bool readOnly) noexcept;Freezes (or thaws) the tree: while read-only, every mutating call fails with PERMISSION_DENIED. Typically used after populating a fixture.
write_counter
write_counter[[nodiscard]] u64 write_counter() const;Number of mutations performed so far; equals the write time of the newest entry.
write_file
write_file[[nodiscard]] result<void> write_file(
std::string_view path,
std::span<const std::byte> data) override;write_file_atomic
write_file_atomic[[nodiscard]] result<void> write_file_atomic(
std::string_view path,
std::span<const std::byte> data) override;Private
check_writable
check_writable[[nodiscard]] result<void> check_writable() const;ensure_directory_locked
ensure_directory_lockedremove_locked
remove_locked[[nodiscard]] result<void> remove_locked(
std::string_view path,
bool recursive);