13#define MAX_STORAGE_DEVICES 16
92 virtual void pollStorageDevices(
int removedIds[MAX_STORAGE_DEVICES],
int & outRemovedCount,
bool & deviceListChanged) = 0;
115 void getPath(
char (&out)[N],
int device,
const char * suffix)
const
117 getPath(out, N, device, suffix);
122 void getPath(
char (&out)[N],
int device,
const char * folder,
const char * file)
const
124 getPath(out, N, device, folder, file);
130 void getPath(
char * out,
size_t outSize,
int device,
const char * suffix)
const
133 snprintf(out, outSize,
"%s%s", mp ? mp :
"", suffix ? suffix :
"");
137 void getPath(
char * out,
size_t outSize,
int device,
const char * folder,
const char * file)
const
139 snprintf(out, outSize,
"%s%s/%s",
getMountPath(device), folder ? folder :
"", file ? file :
"");
158inline const char * FindFirstMountedPath(
FileSystemDriver * fs,
const int * candidates,
int count)
160 for(
int i = 0; i < count; i++)
163 if(path && path[0] !=
'\0')
Storage device enumeration/mount/poll backend for the SD/USB/DVD file browser.
virtual const char * mountResultMessage(int deviceId, MountResult result)=0
A short, user-displayable reason for a non-Success MountResult (eg.
virtual const char * getMountPath(int device) const =0
devoptab-style mount path for device (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.
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 arr...
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 ...
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 ...
virtual SmbDriver * getSmb()=0
virtual MountResult mountStorageDevice(int deviceId)=0
Attempts to mount deviceId exactly once.
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 th...
virtual const char * getDevicePrefix(int device) const =0
The devoptab prefix this device would use (eg.
virtual bool isDevicePresent(int deviceId) const =0
Lightweight, cached hardware-presence check for a single device - does NOT mount and does no invasive...
virtual void init()=0
Initializes the driver and auto-mounts devices flagged autoMountAtStartup.
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 int enumerateStorageDevices(StorageDevice outDevices[MAX_STORAGE_DEVICES])=0
Fills outDevices (size MAX_STORAGE_DEVICES) and returns the device count.
virtual void invalidateStorageDevice(int deviceId)=0
Marks deviceId as needing a fresh mount next time mountStorageDevice() is called, eg.
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.
virtual void shutdown()=0
Unmounts every device and releases the driver's resources.
Device
Storage device kind, shared by every platform's FileSystemDriver All platforms are limited to exactly...
MountResult
Result of a single mount attempt.
@ DEVICE_SD_SLOTA
GameCube memory card slot A.
@ DEVICE_SD_SLOTB
GameCube memory card slot B.
@ DEVICE_SD_PORT2
GameCube SD Gecko in memory card slot B.
@ MountFailed
present, but couldn't be mounted (eg.
@ DeviceNotFound
not physically present / not inserted
Description of one storage device: id, display name, mount prefix, volume label and flags such as rem...
bool autoMountAtStartup
silently attempted at boot
bool removable
can this device disappear at runtime?
int id
Device enum value (DEVICE_SD, DEVICE_USB, ...)
bool alwaysListed
show in a device listing unconditionally, regardless of isDevicePresent()
char volumeLabel[16]
Volume label of the mounted filesystem, or empty if unknown.
char prefix[32]
devoptab mount prefix, eg.
char name[20]
Short display name for device lists.