|
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
|
The file system of a game that runs as a program on an operating system. More...
#include <deki/providers/HostFileSystem.h>
Inherits Deki::IFileSystem.
Public Member Functions | |
| HostFileSystem () | |
| virtual | ~HostFileSystem () |
| void | CloseFile (FileHandle handle) override |
| bool | ConvertPath (const char *virtualPath, char *outBuffer, size_t bufferSize) override |
| Turns a virtual path (such as "S:/assets/texture.bin") into this platform's path. | |
| bool | FileExists (const char *path) override |
| long | GetFileSize (FileHandle handle) override |
| Size in bytes, or -1 on error. | |
| bool | Initialize () override |
| Returns false on failure. | |
| FileHandle | OpenFile (const char *path, OpenMode mode) override |
| Opens path (in this filesystem's format). Returns nullptr on failure. | |
| size_t | ReadFile (FileHandle handle, void *buffer, size_t size) override |
| Reads up to size bytes. Returns the number read. | |
| long | SeekFile (FileHandle handle, long offset, SeekOrigin origin) override |
| Returns the new position, or -1 on error. | |
| void | Shutdown () override |
| long | TellFile (FileHandle handle) override |
| Current position, or -1 on error. | |
| size_t | WriteFile (FileHandle handle, const void *buffer, size_t size) override |
| Writes size bytes. Returns the number written. | |
| Public Member Functions inherited from Deki::IFileSystem | |
| virtual | ~IFileSystem ()=default |
| virtual bool | IsStorageMode () const |
| True while USB mass storage is active. | |
| virtual bool | SetStorageMode (bool enabled) |
| Enters or leaves USB mass storage mode, used to deploy assets. | |
| virtual bool | SupportsStorageMode () const |
| True when the storage can be exposed as a USB drive (mass storage). | |
Additional Inherited Members | |
| Public Types inherited from Deki::IFileSystem | |
| using | FileHandle = void* |
| Opaque; each implementation decides what it points to. | |
| enum class | OpenMode { ReadBinary , WriteBinary , ReadText , WriteText } |
| enum class | SeekOrigin { Begin , Current , End } |
The file system of a game that runs as a program on an operating system.
For the desktop build and Linux handhelds, on the C standard library. Maps the device's virtual mounts to folders beside the program, on Windows, Linux and macOS alike. The hosted entry (src/hosted/HostedMain.cpp) sets it before the engine starts.
F:/ is the board's flash, as on a device: the game's data (the build's export, in ./flash/) is read and never written, and the files the game writes go to ./userdata/, read from there when the game's data has no file of that name.
| Deki::HostFileSystem::HostFileSystem | ( | ) |
|
virtual |
|
overridevirtual |
Implements Deki::IFileSystem.
|
overridevirtual |
Turns a virtual path (such as "S:/assets/texture.bin") into this platform's path.
Returns false when outBuffer is too small.
Implements Deki::IFileSystem.
|
overridevirtual |
Implements Deki::IFileSystem.
|
overridevirtual |
Size in bytes, or -1 on error.
Implements Deki::IFileSystem.
|
overridevirtual |
Returns false on failure.
Implements Deki::IFileSystem.
|
overridevirtual |
Opens path (in this filesystem's format). Returns nullptr on failure.
Implements Deki::IFileSystem.
|
overridevirtual |
Reads up to size bytes. Returns the number read.
Implements Deki::IFileSystem.
|
overridevirtual |
Returns the new position, or -1 on error.
Implements Deki::IFileSystem.
|
overridevirtual |
Implements Deki::IFileSystem.
|
overridevirtual |
Current position, or -1 on error.
Implements Deki::IFileSystem.
|
overridevirtual |
Writes size bytes. Returns the number written.
Implements Deki::IFileSystem.