AbstractFilesystem
Functions
std::unique_ptr< AbstractFile > |
|
std::unique_ptr< AbstractFile > |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
void |
|
uintmax_t |
|
bool |
|
bool |
|
bool |
|
bool |
Detailed Description
-
class AbstractFilesystem
The AbstractFilesystem class to represent any kind of file system. The SC Store will use it to interact with the storage and create AbstractFile objects. This class must be implemented to customize storage management. Read methods are widely used by the SC Store. Write methods are mostly used during authoring or to handle scz compressed files during streaming.
Public Functions
-
AbstractFilesystem() = default
-
virtual ~AbstractFilesystem() = default
-
virtual std::unique_ptr<AbstractFile> NewFile() = 0
Create a new AbstractFile object. Allow to create your own AbstractFile with extra parameters if needed.
-
virtual std::unique_ptr<AbstractFile> NewFile(path const &path) = 0
-
virtual path Cleaned(path const &path) const = 0
Return a new cleaned path. For example, without “..”. It’s used by the SC Store to clean any path given as an input. For example: model names, workspace path, model search directories.
-
virtual bool Exists(path const &path) const = 0
Return true if the given path exist in the storage. The path can be a directory or a file.
-
virtual bool IsDirectory(path const &path) const = 0
Return true if the given path is a directory in the storage
-
virtual bool IsRegularFile(path const &path) const = 0
Return true if the given path is a regular file (eg: which contains readable data) in the storage
-
virtual bool IsSymlink(path const &path) const = 0
Return true if the given path is a symlink in the storage
-
virtual bool IsEmpty(path const &path) const = 0
Return true if the directory at the given path is empty.
-
virtual void GetChildren(path const &path, std::vector<IO::path> &out_children) const = 0
Populate out_children with the list of children of the directory at the given path.
-
virtual uintmax_t RemoveAll(path const &path) = 0
Remove everything at the given path. Same as std::filesystem::remove_all.
-
virtual bool Rename(path const &old_path, path const &new_path) = 0
Rename the target. Same as std::filesystem::rename.
-
AbstractFilesystem() = default