memory card refactoring

This commit is contained in:
Chris Danford
2003-12-17 10:20:53 +00:00
parent 23623a1c64
commit e11afda65a
13 changed files with 531 additions and 307 deletions
@@ -0,0 +1,45 @@
#ifndef MEMORY_CARD_ENUMERATOR_H
#define MEMORY_CARD_ENUMERATOR_H 1
struct UsbStorageDevice
{
UsbStorageDevice()
{
iBus = -1;
iDeviceOnBus = -1;
iPortOnHub = -1;
iUsbStorageIndex = -1;
};
int iBus;
int iDeviceOnBus;
int iPortOnHub;
CString sSerial;
int iUsbStorageIndex;
CString sOsMountDir; // WITHOUT trailing slash
bool operator==(const UsbStorageDevice& other)
{
return
iBus==other.iBus &&
iDeviceOnBus==other.iDeviceOnBus; // every time a device is plugged in, it gets a unique device number
}
};
class MemoryCardDriver
{
public:
MemoryCardDriver() {};
virtual ~MemoryCardDriver() {};
virtual bool StorageDevicesChanged() = 0;
virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) = 0;
virtual bool MountAndTestWrite( UsbStorageDevice* pDevice ) = 0; // return false if mount or write fails
virtual void Unmount( UsbStorageDevice* pDevice ) = 0;
};
#endif
/*
* Copyright (c) 2003 by the person(s) listed below. All rights reserved.
* Chris Danford
*/