Abstract interface for filesystem package operations.
More...
#include <IDekiFileSystem.h>
Inherited by DesktopFileSystem.
Abstract interface for filesystem package operations.
This interface defines the contract that filesystem packages must implement to work with the Deki engine. It abstracts file operations, path handling, and storage management.
◆ FileHandle
File handle type - platform-specific implementation.
◆ OpenMode
File open modes.
| Enumerator |
|---|
| READ_BINARY | |
| WRITE_BINARY | |
| READ_TEXT | |
| WRITE_TEXT | |
◆ SeekOrigin
File seek origins.
| Enumerator |
|---|
| BEGIN | |
| CURRENT | |
| END | |
◆ ~IDekiFileSystem()
| virtual IDekiFileSystem::~IDekiFileSystem |
( |
| ) |
|
|
virtualdefault |
◆ Initialize()
| virtual bool IDekiFileSystem::Initialize |
( |
| ) |
|
|
pure virtual |
Initialize the file system.
- Returns
- true if successful, false otherwise
Implemented in DesktopFileSystem.
◆ Shutdown()
| virtual void IDekiFileSystem::Shutdown |
( |
| ) |
|
|
pure virtual |
◆ OpenFile()
Open a file.
- Parameters
-
| path | Path to the file (platform-specific format) |
| mode | Open mode |
- Returns
- File handle or nullptr if failed
Implemented in DesktopFileSystem.
◆ CloseFile()
| virtual void IDekiFileSystem::CloseFile |
( |
FileHandle | handle | ) |
|
|
pure virtual |
◆ ReadFile()
| virtual size_t IDekiFileSystem::ReadFile |
( |
FileHandle | handle, |
|
|
void * | buffer, |
|
|
size_t | size ) |
|
pure virtual |
Read data from a file.
- Parameters
-
| handle | File handle |
| buffer | Buffer to read into |
| size | Number of bytes to read |
- Returns
- Number of bytes actually read
Implemented in DesktopFileSystem.
◆ WriteFile()
| virtual size_t IDekiFileSystem::WriteFile |
( |
FileHandle | handle, |
|
|
const void * | buffer, |
|
|
size_t | size ) |
|
pure virtual |
Write data to a file.
- Parameters
-
| handle | File handle |
| buffer | Buffer to write from |
| size | Number of bytes to write |
- Returns
- Number of bytes actually written
Implemented in DesktopFileSystem.
◆ SeekFile()
Seek to a position in the file.
- Parameters
-
| handle | File handle |
| offset | Offset in bytes |
| origin | Seek origin |
- Returns
- New position, or -1 on error
Implemented in DesktopFileSystem.
◆ TellFile()
| virtual long IDekiFileSystem::TellFile |
( |
FileHandle | handle | ) |
|
|
pure virtual |
Get current position in file.
- Parameters
-
- Returns
- Current position, or -1 on error
Implemented in DesktopFileSystem.
◆ GetFileSize()
| virtual long IDekiFileSystem::GetFileSize |
( |
FileHandle | handle | ) |
|
|
pure virtual |
Get file size.
- Parameters
-
- Returns
- File size in bytes, or -1 on error
Implemented in DesktopFileSystem.
◆ FileExists()
| virtual bool IDekiFileSystem::FileExists |
( |
const char * | path | ) |
|
|
pure virtual |
Check if file exists.
- Parameters
-
- Returns
- true if file exists, false otherwise
Implemented in DesktopFileSystem.
◆ ConvertPath()
| virtual bool IDekiFileSystem::ConvertPath |
( |
const char * | virtualPath, |
|
|
char * | outBuffer, |
|
|
size_t | bufferSize ) |
|
pure virtual |
Convert virtual path to platform-specific path.
- Parameters
-
| virtualPath | Virtual path (e.g., "S:/assets/texture.bin") |
| outBuffer | Buffer to store the converted path |
| bufferSize | Size of the output buffer |
- Returns
- true if conversion successful, false if buffer too small
Implemented in DesktopFileSystem.
◆ SupportsStorageMode()
| virtual bool IDekiFileSystem::SupportsStorageMode |
( |
| ) |
const |
|
inlinevirtual |
Check if storage mode (USB MSC) is supported.
- Returns
- true if the filesystem supports exposing storage via USB
◆ SetStorageMode()
| virtual bool IDekiFileSystem::SetStorageMode |
( |
bool | enabled | ) |
|
|
inlinevirtual |
Enter or exit storage mode (USB Mass Storage).
- Parameters
-
| enabled | true to enter storage mode, false to exit |
- Returns
- true if mode change successful
When storage mode is enabled, the storage is exposed as a USB drive and normal file operations will fail. Used for asset deployment.
◆ IsStorageMode()
| virtual bool IDekiFileSystem::IsStorageMode |
( |
| ) |
const |
|
inlinevirtual |
Check if currently in storage mode.
- Returns
- true if in storage mode (USB MSC active)
The documentation for this class was generated from the following file: