TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::IFileSystem Class Referenceabstract

What a file view reads and changes. More...

#include <gui_controls/gui_file_system.h>

Inheritance diagram for tachyon::IFileSystem:

Public Member Functions

virtual ~IFileSystem ()=default
virtual std::vector< FileEntry > List (std::string_view path)=0
 The entries in the folder at path, in no particular order; none when there's no such folder.
virtual bool Move (std::string_view path, std::string_view toFolder, std::string &error)=0
 Moves the file or folder at path into the folder toFolder, keeping its name.
virtual bool Rename (std::string_view path, std::string_view newName, std::string &error)=0
 Renames the file or folder at path in its folder.
virtual bool Import (const std::filesystem::path &source, std::string_view toFolder, std::string &error)=0
 Copies the file or folder at source, on the disk (a file dropped from another application), into the folder toFolder under its own name.
virtual uint64_t Generation () const =0
 Changes whenever what List returns may have: after a move, a rename or an import.

Detailed Description

What a file view reads and changes.

Implement it over the disk, an archive, an asset database; MemoryFileSystem keeps it all in memory.

Constructor & Destructor Documentation

◆ ~IFileSystem()

virtual tachyon::IFileSystem::~IFileSystem ( )
virtualdefault

Member Function Documentation

◆ List()

virtual std::vector< FileEntry > tachyon::IFileSystem::List ( std::string_view path)
pure virtual

The entries in the folder at path, in no particular order; none when there's no such folder.

Implemented in tachyon::MemoryFileSystem.

◆ Move()

virtual bool tachyon::IFileSystem::Move ( std::string_view path,
std::string_view toFolder,
std::string & error )
pure virtual

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.

Implemented in tachyon::MemoryFileSystem.

◆ Rename()

virtual bool tachyon::IFileSystem::Rename ( std::string_view path,
std::string_view newName,
std::string & error )
pure virtual

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.

Implemented in tachyon::MemoryFileSystem.

◆ Import()

virtual bool tachyon::IFileSystem::Import ( const std::filesystem::path & source,
std::string_view toFolder,
std::string & error )
pure virtual

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.

Implemented in tachyon::MemoryFileSystem.

◆ Generation()

virtual uint64_t tachyon::IFileSystem::Generation ( ) const
pure virtual

Changes whenever what List returns may have: after a move, a rename or an import.

Implemented in tachyon::MemoryFileSystem.


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