Storage device enumeration/mount/poll backend for the SD/USB/DVD file browser. More...
#include <FileSystemDriver.h>
Public Member Functions | |
| virtual void | init ()=0 |
| Initializes the driver and auto-mounts devices flagged autoMountAtStartup. | |
| virtual void | shutdown ()=0 |
| Unmounts every device and releases the driver's resources. | |
| virtual int | enumerateStorageDevices (StorageDevice outDevices[MAX_STORAGE_DEVICES])=0 |
| Fills outDevices (size MAX_STORAGE_DEVICES) and returns the device count. | |
| virtual MountResult | mountStorageDevice (int deviceId)=0 |
| Attempts to mount deviceId exactly once. | |
| virtual const char * | mountResultMessage (int deviceId, MountResult result)=0 |
| A short, user-displayable reason for a non-Success MountResult (eg. | |
| virtual void | invalidateStorageDevice (int deviceId)=0 |
| Marks deviceId as needing a fresh mount next time mountStorageDevice() is called, eg. | |
| virtual void | pollStorageDevices (int removedIds[MAX_STORAGE_DEVICES], int &outRemovedCount, bool &deviceListChanged)=0 |
| Called once per device-checking thread cycle. | |
| virtual bool | hasRemovableStorageDevices () const =0 |
| Whether the device-checking thread should run on this platform. | |
| virtual bool | isDevicePresent (int deviceId) const =0 |
| Lightweight, cached hardware-presence check for a single device - does NOT mount and does no invasive I/O. | |
| virtual const char * | getDevicePrefix (int device) const =0 |
| The devoptab prefix this device would use (eg. | |
| virtual const char * | getMountPath (int device) const =0 |
| devoptab-style mount path for device (eg. | |
| template<size_t N> | |
| void | getPath (char(&out)[N], int device, const char *suffix) const |
| Writes getMountPath(device) + suffix into out (bounds-checked to sizeof(out) via the array-reference template parameter N). | |
| template<size_t N> | |
| void | getPath (char(&out)[N], int device, const char *folder, const char *file) const |
| Joins a folder and a filename with '/' after the mount path. | |
| void | getPath (char *out, size_t outSize, int device, const char *suffix) const |
Explicit-size equivalents of the two templates above, for call sites where the destination buffer arrives as a char * function parameter rather than a fixed array. | |
| void | getPath (char *out, size_t outSize, int device, const char *folder, const char *file) const |
| Joins folder and file with '/' after the mount path, as in the template above. | |
| virtual const int * | getValidLoadDevices (int &outCount) const =0 |
| Devices (Device enum values, in priority order) that are offered when choosing where to load from on this platform. | |
| virtual const int * | getValidSaveDevices (int &outCount) const =0 |
| Devices (Device enum values, in priority order) that are offered when choosing where to save to on this platform. | |
| virtual SmbDriver * | getSmb ()=0 |
Storage device enumeration/mount/poll backend for the SD/USB/DVD file browser.
Exactly one driver implements this and assigns the single global Platform instance.
Definition at line 60 of file FileSystemDriver.h.
|
pure virtual |
Fills outDevices (size MAX_STORAGE_DEVICES) and returns the device count.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
The devoptab prefix this device would use (eg.
"usb:/"), regardless of whether it is currently mounted.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
devoptab-style mount path for device (eg.
"sd:/"), or "" if device isn't recognized or currently mounted on this platform. Only for "is this usable already?" call sites - use getDevicePrefix() to map a path back to a device id.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
inline |
Joins folder and file with '/' after the mount path, as in the template above.
Definition at line 137 of file FileSystemDriver.h.
|
inline |
Explicit-size equivalents of the two templates above, for call sites where the destination buffer arrives as a char * function parameter rather than a fixed array.
Definition at line 130 of file FileSystemDriver.h.
|
inline |
Joins a folder and a filename with '/' after the mount path.
Definition at line 122 of file FileSystemDriver.h.
|
inline |
Writes getMountPath(device) + suffix into out (bounds-checked to sizeof(out) via the array-reference template parameter N).
Definition at line 115 of file FileSystemDriver.h.
|
pure virtual |
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Devices (Device enum values, in priority order) that are offered when choosing where to load from on this platform.
| outCount | receives the number of entries in the returned array |
Implemented in GameCubeFileSystemDriver, WiiFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Devices (Device enum values, in priority order) that are offered when choosing where to save to on this platform.
Differs from the load list in that read-only devices such as DVD are left out.
| outCount | receives the number of entries in the returned array |
Implemented in GameCubeFileSystemDriver, WiiFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Whether the device-checking thread should run on this platform.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Initializes the driver and auto-mounts devices flagged autoMountAtStartup.
Implemented in GameCubeFileSystemDriver, WiiFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Marks deviceId as needing a fresh mount next time mountStorageDevice() is called, eg.
after a read/write failure suggests the underlying media went away. Does no I/O itself.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Lightweight, cached hardware-presence check for a single device - does NOT mount and does no invasive I/O.
Backed by whatever pollStorageDevices() last observed
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
A short, user-displayable reason for a non-Success MountResult (eg.
"SD card not found!"). Never returns nullptr.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Attempts to mount deviceId exactly once.
No retry, no prompts, no-ops (returns Success) if already mounted.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Called once per device-checking thread cycle.
removedIds/outRemovedCount: devices that were mounted and have now disappeared (already invalidated internally - callers just need to react, eg. abort an in-progress directory parse). deviceListChanged: true if enumerateStorageDevices() should be re-run because the device table itself changed shape.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.
|
pure virtual |
Unmounts every device and releases the driver's resources.
Implemented in OgcFileSystemDriver, and WutFileSystemDriver.