Abstract file-system interface.
More...
#include <i_filesystem.h>
Abstract file-system interface.
Definition at line 40 of file i_filesystem.h.
◆ ~IFileSystem()
| virtual contur::IFileSystem::~IFileSystem |
( |
| ) |
|
|
virtualdefault |
◆ close()
Closes an open descriptor.
- Parameters
-
- Returns
- Ok on success; NotFound for unknown descriptor.
Implemented in contur::SimpleFS.
◆ listDir()
| virtual Result< std::vector< DirectoryEntry > > contur::IFileSystem::listDir |
( |
const std::string & | path | ) |
const |
|
nodiscardpure virtual |
Lists immediate child entries in a directory.
- Parameters
-
| path | Absolute directory path. |
- Returns
- Vector of directory entries, or error.
Implemented in contur::SimpleFS.
◆ mkdir()
| virtual Result< void > contur::IFileSystem::mkdir |
( |
const std::string & | path | ) |
|
|
nodiscardpure virtual |
Creates a directory at path.
- Parameters
-
| path | Absolute directory path. |
- Returns
- Ok on success; AlreadyExists/NotFound/InvalidArgument otherwise.
Implemented in contur::SimpleFS.
◆ open()
Opens a file path with the requested mode.
- Parameters
-
| path | Absolute file path. |
| mode | Open mode flags. |
- Returns
- File descriptor on success; error otherwise.
Implemented in contur::SimpleFS.
◆ read()
| virtual Result< std::size_t > contur::IFileSystem::read |
( |
FileDescriptor | fd, |
|
|
std::span< std::byte > | buffer ) |
|
nodiscardpure virtual |
Reads bytes from an open descriptor.
- Parameters
-
| fd | Open descriptor. |
| buffer | Output buffer. |
- Returns
- Number of bytes read, or error.
Implemented in contur::SimpleFS.
◆ remove()
| virtual Result< void > contur::IFileSystem::remove |
( |
const std::string & | path | ) |
|
|
nodiscardpure virtual |
Removes a file or an empty directory.
- Parameters
-
| path | Absolute path to remove. |
- Returns
- Ok on success; NotFound/InvalidState on failure.
Implemented in contur::SimpleFS.
◆ stat()
| virtual Result< InodeInfo > contur::IFileSystem::stat |
( |
const std::string & | path | ) |
const |
|
nodiscardpure virtual |
Returns metadata for path.
- Parameters
-
| path | Absolute path of file or directory. |
- Returns
- Inode info or NotFound.
Implemented in contur::SimpleFS.
◆ write()
| virtual Result< std::size_t > contur::IFileSystem::write |
( |
FileDescriptor | fd, |
|
|
std::span< const std::byte > | data ) |
|
nodiscardpure virtual |
Writes bytes to an open descriptor.
- Parameters
-
| fd | Open descriptor. |
| data | Data bytes to write. |
- Returns
- Number of bytes written, or error.
Implemented in contur::SimpleFS.
The documentation for this class was generated from the following file: