Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiFileSystem Class Reference

File System Provider for handling different platform filesystem implementations. More...

#include <DekiFileSystem.h>

Static Public Member Functions

static bool Initialize ()
 Initialize the filesystem manager.
static void Shutdown ()
 Shutdown the current filesystem.
static IDekiFileSystemGetCurrentFileSystem ()
 Get the current filesystem implementation.
static bool IsInitialized ()
 Check if the filesystem manager is initialized.
static bool SetFileSystem (IDekiFileSystem *fs)
 Set a custom filesystem implementation.
static bool SupportsStorageMode ()
 Check if storage mode (USB MSC) is supported.
static bool SetStorageMode (bool enabled)
 Enter or exit storage mode (USB Mass Storage).
static bool IsStorageMode ()
 Check if currently in storage mode.
static void RegisterFileSystem (const std::string &prefix, IDekiFileSystem *fs)
 Register a filesystem for a specific path prefix.
static void UnregisterFileSystem (const std::string &prefix)
 Unregister a filesystem for a path prefix.
static IDekiFileSystemGetFileSystemForPath (const char *path)
 Get the filesystem that handles a specific path.
static void SetDefaultFileSystem (IDekiFileSystem *fs)
 Set the default filesystem for non-prefixed paths.

Detailed Description

File System Provider for handling different platform filesystem implementations.

Holds the process-wide filesystem. Platform integration packages install a concrete implementation via SetFileSystem(); there is no build-time platform enum — which one you get is decided by which package is loaded.

Member Function Documentation

◆ Initialize()

bool DekiFileSystem::Initialize ( )
static

Initialize the filesystem manager.

Returns
true if initialization successful, false otherwise

◆ Shutdown()

void DekiFileSystem::Shutdown ( )
static

Shutdown the current filesystem.

◆ GetCurrentFileSystem()

IDekiFileSystem * DekiFileSystem::GetCurrentFileSystem ( )
static

Get the current filesystem implementation.

Returns
Pointer to current filesystem, or nullptr if not initialized

◆ IsInitialized()

bool DekiFileSystem::IsInitialized ( )
inlinestatic

Check if the filesystem manager is initialized.

Returns
true if initialized, false otherwise

◆ SetFileSystem()

bool DekiFileSystem::SetFileSystem ( IDekiFileSystem * fs)
static

Set a custom filesystem implementation.

Parameters
fsPointer to filesystem (takes ownership)
Returns
true if successful

◆ SupportsStorageMode()

bool DekiFileSystem::SupportsStorageMode ( )
static

Check if storage mode (USB MSC) is supported.

Returns
true if the current filesystem supports storage mode

◆ SetStorageMode()

bool DekiFileSystem::SetStorageMode ( bool enabled)
static

Enter or exit storage mode (USB Mass Storage).

Parameters
enabledtrue to enter storage mode, false to exit
Returns
true if mode change successful

◆ IsStorageMode()

bool DekiFileSystem::IsStorageMode ( )
static

Check if currently in storage mode.

Returns
true if in storage mode (USB MSC active)

◆ RegisterFileSystem()

void DekiFileSystem::RegisterFileSystem ( const std::string & prefix,
IDekiFileSystem * fs )
static

Register a filesystem for a specific path prefix.

Parameters
prefixPath prefix (e.g., "F:/", "S:/")
fsFilesystem to handle paths with this prefix

◆ UnregisterFileSystem()

void DekiFileSystem::UnregisterFileSystem ( const std::string & prefix)
static

Unregister a filesystem for a path prefix.

Parameters
prefixPath prefix to unregister

◆ GetFileSystemForPath()

IDekiFileSystem * DekiFileSystem::GetFileSystemForPath ( const char * path)
static

Get the filesystem that handles a specific path.

Parameters
pathPath to look up (e.g., "F:/boot.scene", "S:/main.scene", or "scenes/Demo")
Returns
Filesystem for this path, or default filesystem if no prefix match

◆ SetDefaultFileSystem()

void DekiFileSystem::SetDefaultFileSystem ( IDekiFileSystem * fs)
static

Set the default filesystem for non-prefixed paths.

Parameters
fsFilesystem to use for paths without a registered prefix (e.g., "scenes/Demo")

This allows code to use simple relative paths like "scenes/Demo" instead of prefixed paths like "S:/scenes/Demo". The default filesystem will handle path resolution appropriately for the platform.


The documentation for this class was generated from the following file: