|
TachyonUI 0.1.0
High-performance UI for building tools.
|
A file system kept in memory. More...
#include <gui_controls/gui_file_system.h>
Public Member Functions | |
| MemoryFileSystem () | |
| MemoryFileSystem (std::filesystem::path diskRoot) | |
| A copy of the disk folder diskRoot, read as it's browsed. | |
| ~MemoryFileSystem () override | |
| bool | AddFolder (std::string_view path) |
| Adds the folder at path, and the folders on the way to it. | |
| bool | AddFile (std::string_view path, uint64_t size=0) |
| Adds a file at path (and the folders on the way to it), size bytes. | |
| std::vector< FileEntry > | List (std::string_view path) override |
| The entries in the folder at path, in no particular order; none when there's no such folder. | |
| bool | Move (std::string_view path, std::string_view toFolder, std::string &error) override |
| Moves the file or folder at path into the folder toFolder, keeping its name. | |
| bool | Rename (std::string_view path, std::string_view newName, std::string &error) override |
| Renames the file or folder at path in its folder. | |
| bool | Import (const std::filesystem::path &source, std::string_view toFolder, std::string &error) override |
| Copies the file or folder at source, on the disk (a file dropped from another application), into the folder toFolder under its own name. | |
| uint64_t | Generation () const override |
| Changes whenever what List returns may have: after a move, a rename or an import. | |
| Public Member Functions inherited from tachyon::IFileSystem | |
| virtual | ~IFileSystem ()=default |
A file system kept in memory.
Filled with AddFolder / AddFile, or a copy of a folder on the disk: each folder's entries are read from the disk the first time they're needed (listed, or looked into by a move). Moves, renames and imports change only the copy: an imported folder is read from the disk as it's browsed, like the rest.
| tachyon::MemoryFileSystem::MemoryFileSystem | ( | ) |
|
explicit |
A copy of the disk folder diskRoot, read as it's browsed.
Entries that can't be read (no permission) are left out.
|
override |
| bool tachyon::MemoryFileSystem::AddFolder | ( | std::string_view | path | ) |
Adds the folder at path, and the folders on the way to it.
False when a file is in the way.
| bool tachyon::MemoryFileSystem::AddFile | ( | std::string_view | path, |
| uint64_t | size = 0 ) |
Adds a file at path (and the folders on the way to it), size bytes.
False when a file is in the way or something is already there.
|
overridevirtual |
The entries in the folder at path, in no particular order; none when there's no such folder.
Implements tachyon::IFileSystem.
|
overridevirtual |
Moves the file or folder at path into the folder toFolder, keeping its name.
False, with error saying why, when it can't: there's no such file or folder, a folder would go into itself, or the name is taken there. Moving it to where it is changes nothing.
Implements tachyon::IFileSystem.
|
overridevirtual |
Renames the file or folder at path in its folder.
False, with error saying why, when it can't: there's no such file or folder, the name is empty, has a '/' or '\', is "." or "..", or is taken.
Implements tachyon::IFileSystem.
|
overridevirtual |
Copies the file or folder at source, on the disk (a file dropped from another application), into the folder toFolder under its own name.
False, with error saying why, when it can't: there's no such file or folder on the disk, no folder toFolder, or the name is taken there.
Implements tachyon::IFileSystem.
|
inlineoverridevirtual |
Changes whenever what List returns may have: after a move, a rename or an import.
Implements tachyon::IFileSystem.