|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
Desktop file system implementation using standard C file operations. More...
#include <DesktopFileSystem.h>
Inherits IDekiFileSystem.
Public Member Functions | |
| DesktopFileSystem () | |
| virtual | ~DesktopFileSystem () |
| bool | Initialize () override |
| Initialize the file system. | |
| void | Shutdown () override |
| Shutdown the file system and cleanup resources. | |
| FileHandle | OpenFile (const char *path, OpenMode mode) override |
| Open a file. | |
| void | CloseFile (FileHandle handle) override |
| Close a file. | |
| size_t | ReadFile (FileHandle handle, void *buffer, size_t size) override |
| Read data from a file. | |
| size_t | WriteFile (FileHandle handle, const void *buffer, size_t size) override |
| Write data to a file. | |
| long | SeekFile (FileHandle handle, long offset, SeekOrigin origin) override |
| Seek to a position in the file. | |
| long | TellFile (FileHandle handle) override |
| Get current position in file. | |
| long | GetFileSize (FileHandle handle) override |
| Get file size. | |
| bool | FileExists (const char *path) override |
| Check if file exists. | |
| bool | ConvertPath (const char *virtualPath, char *outBuffer, size_t bufferSize) override |
| Convert virtual path to platform-specific path. | |
| Public Member Functions inherited from IDekiFileSystem | |
| virtual | ~IDekiFileSystem ()=default |
| virtual bool | SupportsStorageMode () const |
| Check if storage mode (USB MSC) is supported. | |
| virtual bool | SetStorageMode (bool enabled) |
| Enter or exit storage mode (USB Mass Storage). | |
| virtual bool | IsStorageMode () const |
| Check if currently in storage mode. | |
Additional Inherited Members | |
| Public Types inherited from IDekiFileSystem | |
| enum class | OpenMode { READ_BINARY , WRITE_BINARY , READ_TEXT , WRITE_TEXT } |
| File open modes. More... | |
| enum class | SeekOrigin { BEGIN , CURRENT , END } |
| File seek origins. More... | |
| typedef void * | FileHandle |
| File handle type - platform-specific implementation. | |
Desktop file system implementation using standard C file operations.
This implementation maps virtual paths to the local filesystem and uses standard C library functions for file operations. It's suitable for desktop platforms (Windows, Linux, macOS) for both editor and simulator builds.
| DesktopFileSystem::DesktopFileSystem | ( | ) |
|
virtual |
|
overridevirtual |
|
overridevirtual |
Shutdown the file system and cleanup resources.
Implements IDekiFileSystem.
|
overridevirtual |
Open a file.
| path | Path to the file (platform-specific format) |
| mode | Open mode |
Implements IDekiFileSystem.
|
overridevirtual |
|
overridevirtual |
Read data from a file.
| handle | File handle |
| buffer | Buffer to read into |
| size | Number of bytes to read |
Implements IDekiFileSystem.
|
overridevirtual |
Write data to a file.
| handle | File handle |
| buffer | Buffer to write from |
| size | Number of bytes to write |
Implements IDekiFileSystem.
|
overridevirtual |
Seek to a position in the file.
| handle | File handle |
| offset | Offset in bytes |
| origin | Seek origin |
Implements IDekiFileSystem.
|
overridevirtual |
Get current position in file.
| handle | File handle |
Implements IDekiFileSystem.
|
overridevirtual |
Get file size.
| handle | File handle |
Implements IDekiFileSystem.
|
overridevirtual |
Check if file exists.
| path | Path to the file |
Implements IDekiFileSystem.
|
overridevirtual |
Convert virtual path to platform-specific path.
| virtualPath | Virtual path (e.g., "S:/assets/texture.bin") |
| outBuffer | Buffer to store the converted path |
| bufferSize | Size of the output buffer |
Implements IDekiFileSystem.