What a filesystem package implements: file operations, path conversion and USB storage mode.
More...
#include <deki/providers/IFileSystem.h>
|
| virtual | ~IFileSystem ()=default |
| virtual bool | Initialize ()=0 |
| | Returns false on failure.
|
| virtual void | Shutdown ()=0 |
| virtual FileHandle | OpenFile (const char *path, OpenMode mode)=0 |
| | Opens path (in this filesystem's format). Returns nullptr on failure.
|
| virtual void | CloseFile (FileHandle handle)=0 |
| virtual size_t | ReadFile (FileHandle handle, void *buffer, size_t size)=0 |
| | Reads up to size bytes. Returns the number read.
|
| virtual size_t | WriteFile (FileHandle handle, const void *buffer, size_t size)=0 |
| | Writes size bytes. Returns the number written.
|
| virtual long | SeekFile (FileHandle handle, long offset, SeekOrigin origin)=0 |
| | Returns the new position, or -1 on error.
|
| virtual long | TellFile (FileHandle handle)=0 |
| | Current position, or -1 on error.
|
| virtual long | GetFileSize (FileHandle handle)=0 |
| | Size in bytes, or -1 on error.
|
| virtual bool | FileExists (const char *path)=0 |
| virtual bool | ConvertPath (const char *virtualPath, char *outBuffer, size_t bufferSize)=0 |
| | Turns a virtual path (such as "S:/assets/texture.bin") into this platform's path.
|
| virtual bool | SupportsStorageMode () const |
| | True when the storage can be exposed as a USB drive (mass storage).
|
| virtual bool | SetStorageMode (bool enabled) |
| | Enters or leaves USB mass storage mode, used to deploy assets.
|
| virtual bool | IsStorageMode () const |
| | True while USB mass storage is active.
|
What a filesystem package implements: file operations, path conversion and USB storage mode.
◆ FileHandle
Opaque; each implementation decides what it points to.
◆ OpenMode
| Enumerator |
|---|
| ReadBinary | |
| WriteBinary | |
| ReadText | |
| WriteText | |
◆ SeekOrigin
| Enumerator |
|---|
| Begin | |
| Current | |
| End | |
◆ ~IFileSystem()
| virtual Deki::IFileSystem::~IFileSystem |
( |
| ) |
|
|
virtualdefault |
◆ Initialize()
| virtual bool Deki::IFileSystem::Initialize |
( |
| ) |
|
|
pure virtual |
Returns false on failure.
◆ Shutdown()
| virtual void Deki::IFileSystem::Shutdown |
( |
| ) |
|
|
pure virtual |
◆ OpenFile()
Opens path (in this filesystem's format). Returns nullptr on failure.
◆ CloseFile()
| virtual void Deki::IFileSystem::CloseFile |
( |
FileHandle | handle | ) |
|
|
pure virtual |
◆ ReadFile()
| virtual size_t Deki::IFileSystem::ReadFile |
( |
FileHandle | handle, |
|
|
void * | buffer, |
|
|
size_t | size ) |
|
pure virtual |
Reads up to size bytes. Returns the number read.
◆ WriteFile()
| virtual size_t Deki::IFileSystem::WriteFile |
( |
FileHandle | handle, |
|
|
const void * | buffer, |
|
|
size_t | size ) |
|
pure virtual |
Writes size bytes. Returns the number written.
◆ SeekFile()
Returns the new position, or -1 on error.
◆ TellFile()
| virtual long Deki::IFileSystem::TellFile |
( |
FileHandle | handle | ) |
|
|
pure virtual |
Current position, or -1 on error.
◆ GetFileSize()
| virtual long Deki::IFileSystem::GetFileSize |
( |
FileHandle | handle | ) |
|
|
pure virtual |
Size in bytes, or -1 on error.
◆ FileExists()
| virtual bool Deki::IFileSystem::FileExists |
( |
const char * | path | ) |
|
|
pure virtual |
◆ ConvertPath()
| virtual bool Deki::IFileSystem::ConvertPath |
( |
const char * | virtualPath, |
|
|
char * | outBuffer, |
|
|
size_t | bufferSize ) |
|
pure virtual |
Turns a virtual path (such as "S:/assets/texture.bin") into this platform's path.
Returns false when outBuffer is too small.
◆ SupportsStorageMode()
| virtual bool Deki::IFileSystem::SupportsStorageMode |
( |
| ) |
const |
|
inlinevirtual |
True when the storage can be exposed as a USB drive (mass storage).
◆ SetStorageMode()
| virtual bool Deki::IFileSystem::SetStorageMode |
( |
bool | enabled | ) |
|
|
inlinevirtual |
Enters or leaves USB mass storage mode, used to deploy assets.
While it is on, the storage is a USB drive and file operations fail. Returns false when the change failed.
◆ IsStorageMode()
| virtual bool Deki::IFileSystem::IsStorageMode |
( |
| ) |
const |
|
inlinevirtual |
True while USB mass storage is active.
The documentation for this class was generated from the following file: