#include <rex/filesystem/file.h>
|
|
| NonCopyable (const NonCopyable &)=delete |
|
NonCopyable & | operator= (const NonCopyable &)=delete |
An open file or directory. Handles on one path share a node.
◆ GetAccess()
| virtual Access rex::filesystem::IFile::GetAccess |
( |
| ) |
const |
|
nodiscardpure virtual |
Returns the access the file was opened with, generic bits expanded to data bits.
◆ List()
| virtual Result< std::unique_ptr< IDirectory > > rex::filesystem::IFile::List |
( |
std::string_view | pattern | ) |
|
|
nodiscardpure virtual |
Starts a walk of the children of this directory.
- Parameters
-
| pattern | The wildcard pattern, empty for every child. |
- Returns
- The walk, or kNotDirectory for a file.
◆ Read()
| virtual Result< size_t > rex::filesystem::IFile::Read |
( |
std::span< u8 > | buffer, |
|
|
u64 | offset ) |
|
nodiscardpure virtual |
Copies bytes of the file.
- Parameters
-
| offset | Byte offset in the file. |
- Returns
- The bytes copied, kAccessDenied without read access, or kEndOfFile.
◆ Refresh()
| virtual void rex::filesystem::IFile::Refresh |
( |
| ) |
|
|
pure virtual |
Reads the node size again from its provider.
◆ SetLength()
| virtual Result< void > rex::filesystem::IFile::SetLength |
( |
u64 | length | ) |
|
|
nodiscardpure virtual |
Changes the file size.
- Parameters
-
| length | The new size in bytes. |
- Returns
- kAccessDenied without write access, kUnsupported when the provider cannot.
◆ SetTimes()
| virtual Result< void > rex::filesystem::IFile::SetTimes |
( |
const FileTimes & | times | ) |
|
|
nodiscardpure virtual |
Changes the times of the node. An empty field keeps its time.
- Returns
- kAccessDenied on a read only mount.
◆ View()
| virtual Result< std::span< const u8 > > rex::filesystem::IFile::View |
( |
| ) |
|
|
nodiscardpure virtual |
Returns the whole file as bytes without a copy, or kUnsupported.
◆ Write()
| virtual Result< size_t > rex::filesystem::IFile::Write |
( |
std::span< const u8 > | buffer, |
|
|
u64 | offset ) |
|
nodiscardpure virtual |
Writes bytes into the file.
- Parameters
-
| buffer | Source bytes. |
| offset | Byte offset in the file. |
- Returns
- The bytes written, or kAccessDenied without write access.
The documentation for this class was generated from the following file: