libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
WiiFileSystemDriver Class Reference

Wii FileSystemDriver: hot-pluggable SD and up to 3 concurrent USB MSD plus DVD (ISO9660) and DEVICE_SMB. More...

#include <WiiFileSystemDriver.h>

Inheritance diagram for WiiFileSystemDriver:
[legend]

Public Member Functions

void init () override
 Initializes the driver and auto-mounts devices flagged autoMountAtStartup.
 
const int * getValidLoadDevices (int &outCount) const override
 Devices (Device enum values, in priority order) that are offered when choosing where to load from on this platform.
 
const int * getValidSaveDevices (int &outCount) const override
 Devices (Device enum values, in priority order) that are offered when choosing where to save to on this platform.
 
- Public Member Functions inherited from OgcFileSystemDriver
void shutdown () override
 Unmounts every device and releases the driver's resources.
 
int enumerateStorageDevices (StorageDevice outDevices[MAX_STORAGE_DEVICES]) override
 Fills outDevices (size MAX_STORAGE_DEVICES) and returns the device count.
 
MountResult mountStorageDevice (int deviceId) override
 Attempts to mount deviceId exactly once.
 
const char * mountResultMessage (int deviceId, MountResult result) override
 A short, user-displayable reason for a non-Success MountResult (eg.
 
void invalidateStorageDevice (int deviceId) override
 Marks deviceId as needing a fresh mount next time mountStorageDevice() is called, eg.
 
void pollStorageDevices (int removedIds[MAX_STORAGE_DEVICES], int &outRemovedCount, bool &deviceListChanged) override
 Called once per device-checking thread cycle.
 
bool hasRemovableStorageDevices () const override
 Whether the device-checking thread should run on this platform.
 
bool isDevicePresent (int deviceId) const override
 Lightweight, cached hardware-presence check for a single device - does NOT mount and does no invasive I/O.
 
const char * getDevicePrefix (int device) const override
 The devoptab prefix this device would use (eg.
 
const char * getMountPath (int device) const override
 devoptab-style mount path for device (eg.
 
SmbDriver * getSmb () override
 
- Public Member Functions inherited from FileSystemDriver
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.
 

Protected Member Functions

void shutdownPlatform () override
 Platform-specific extra teardown beyond the shared per-slot fatUnmount() pass (eg.
 
bool pollPlatformExtra () override
 Platform-specific extra polling that must run before the shared per-slot presence check (eg.
 
void prepareMount (int deviceId) override
 Platform-specific work that must run immediately before a user-initiated mount attempt on deviceId, so the attempt sees current hardware topology instead of whatever the last poll cycle happened to observe.
 
- Protected Member Functions inherited from OgcFileSystemDriver
void initFatSlotsAndAutoMount ()
 Runs the shared boot-time pass: probe every pollable fatSlots[] entry once for isPresentCache, then auto-mount whatever enumerateStorageDevices() marks autoMountAtStartup.
 
MountResult mountFAT (int deviceId)
 Mounts the FAT filesystem on a slot with fatMountSimple(), unmounting first if unmountRequired is set.
 
MountResult mountDVD ()
 Mounts the DVD as ISO9660 if a disc is inserted.
 
MountResult attemptFatMount (int deviceId)
 Single mountFAT() attempt that also records the outcome in mountFailed.
 
const OgcFatSlotDescriptor * findFatSlot (int deviceId) const
 

Additional Inherited Members

- Protected Attributes inherited from OgcFileSystemDriver
const OgcFatSlotDescriptor * fatSlots = nullptr
 Table of FAT slots this platform supports; set by the concrete driver.
 
int fatSlotCount = 0
 Number of entries in fatSlots.
 
DISC_INTERFACE * dvdDisc = nullptr
 Disc interface used to mount the DVD drive, or nullptr if the platform has none.
 
const char * unsupportedFormatMessage = "Unsupported format."
 Text returned by mountResultMessage() when a present device fails to mount.
 
bool isMounted [MAX_STORAGE_DEVICES] = { false }
 A filesystem is currently mounted for this device.
 
bool unmountRequired [MAX_STORAGE_DEVICES] = { false }
 A stale mount must be torn down before the next mount attempt.
 
bool isPresentCache [MAX_STORAGE_DEVICES] = { false }
 raw hardware insertion only - see isDevicePresent()'s comment for why this is no longer what it returns
 
bool mountFailed [MAX_STORAGE_DEVICES] = { false }
 set by a real MountFailed; cleared on removal/reinsertion - see attemptFatMount()
 
bool labelFetched [MAX_STORAGE_DEVICES] = { false }
 fetched since the last mount/removal - see mountFAT()/invalidateStorageDevice()
 
char volumeLabel [MAX_STORAGE_DEVICES][16] = { { 0 } }
 Volume label cached for each device.
 
OgcSmbDriver smbDriver
 The network-share driver returned by getSmb()
 

Detailed Description

Wii FileSystemDriver: hot-pluggable SD and up to 3 concurrent USB MSD plus DVD (ISO9660) and DEVICE_SMB.

Definition at line 12 of file WiiFileSystemDriver.h.

Member Function Documentation

◆ getValidLoadDevices()

const int * WiiFileSystemDriver::getValidLoadDevices ( int & outCount) const
overridevirtual

Devices (Device enum values, in priority order) that are offered when choosing where to load from on this platform.

Parameters
outCountreceives the number of entries in the returned array
Returns
a static array owned by the driver

Implements FileSystemDriver.

Definition at line 74 of file WiiFileSystemDriver.cpp.

◆ getValidSaveDevices()

const int * WiiFileSystemDriver::getValidSaveDevices ( int & outCount) const
overridevirtual

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.

Parameters
outCountreceives the number of entries in the returned array
Returns
a static array owned by the driver

Implements FileSystemDriver.

Definition at line 81 of file WiiFileSystemDriver.cpp.

◆ init()

void WiiFileSystemDriver::init ( )
overridevirtual

Initializes the driver and auto-mounts devices flagged autoMountAtStartup.

Implements FileSystemDriver.

Definition at line 33 of file WiiFileSystemDriver.cpp.

◆ pollPlatformExtra()

bool WiiFileSystemDriver::pollPlatformExtra ( )
overrideprotectedvirtual

Platform-specific extra polling that must run before the shared per-slot presence check (eg.

Wii's WiiUsbMulti::scan(), which re-resolves which physical interface each USB slot's getDisc() currently points at). Returns true if this alone constitutes a device-list change. No-op/false by default.

Reimplemented from OgcFileSystemDriver.

Definition at line 58 of file WiiFileSystemDriver.cpp.

◆ prepareMount()

void WiiFileSystemDriver::prepareMount ( int deviceId)
overrideprotectedvirtual

Platform-specific work that must run immediately before a user-initiated mount attempt on deviceId, so the attempt sees current hardware topology instead of whatever the last poll cycle happened to observe.

Reimplemented from OgcFileSystemDriver.

Definition at line 67 of file WiiFileSystemDriver.cpp.

◆ shutdownPlatform()

void WiiFileSystemDriver::shutdownPlatform ( )
overrideprotectedvirtual

Platform-specific extra teardown beyond the shared per-slot fatUnmount() pass (eg.

Wii's WiiUsbMulti/USBStorage/DI_Close()).

Reimplemented from OgcFileSystemDriver.

Definition at line 51 of file WiiFileSystemDriver.cpp.


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