|
|
|
@ -56,12 +56,12 @@ private: |
|
|
|
int handle_; |
|
|
|
}; |
|
|
|
|
|
|
|
struct PSPFileInfo { |
|
|
|
PSPFileInfo() |
|
|
|
struct FileInfo { |
|
|
|
FileInfo() |
|
|
|
: size(0), access(0), exists(false), type(FILETYPE_NORMAL), isOnSectorSystem(false), startSector(0), numSectors(0) {} |
|
|
|
|
|
|
|
void DoState(PointerWrap &p) { |
|
|
|
auto s = p.Section("PSPFileInfo", 1); |
|
|
|
auto s = p.Section("FileInfo", 1); |
|
|
|
if (!s) |
|
|
|
return; |
|
|
|
|
|
|
|
@ -101,13 +101,13 @@ public: |
|
|
|
virtual ~IFileSystem() {} |
|
|
|
|
|
|
|
virtual void DoState(PointerWrap &p) = 0; |
|
|
|
virtual std::vector<PSPFileInfo> GetDirListing(std::string path) = 0; |
|
|
|
virtual std::vector<FileInfo> GetDirListing(std::string path) = 0; |
|
|
|
virtual u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL) = 0; |
|
|
|
virtual void CloseFile(u32 handle) = 0; |
|
|
|
virtual size_t ReadFile(u32 handle, u8 *pointer, s64 size) = 0; |
|
|
|
virtual size_t WriteFile(u32 handle, const u8 *pointer, s64 size) = 0; |
|
|
|
virtual size_t SeekFile(u32 handle, s32 position, FileMove type) = 0; |
|
|
|
virtual PSPFileInfo GetFileInfo(std::string filename) = 0; |
|
|
|
virtual FileInfo GetFileInfo(std::string filename) = 0; |
|
|
|
virtual bool OwnsHandle(u32 handle) = 0; |
|
|
|
virtual bool MkDir(const std::string &dirname) = 0; |
|
|
|
virtual bool RmDir(const std::string &dirname) = 0; |
|
|
|
@ -120,13 +120,13 @@ public: |
|
|
|
class EmptyFileSystem : public IFileSystem { |
|
|
|
public: |
|
|
|
virtual void DoState(PointerWrap &p) {} |
|
|
|
std::vector<PSPFileInfo> GetDirListing(std::string path) {std::vector<PSPFileInfo> vec; return vec;} |
|
|
|
std::vector<FileInfo> GetDirListing(std::string path) {std::vector<FileInfo> vec; return vec;} |
|
|
|
u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL) {return 0;} |
|
|
|
void CloseFile(u32 handle) {} |
|
|
|
size_t ReadFile(u32 handle, u8 *pointer, s64 size) {return 0;} |
|
|
|
size_t WriteFile(u32 handle, const u8 *pointer, s64 size) {return 0;} |
|
|
|
size_t SeekFile(u32 handle, s32 position, FileMove type) {return 0;} |
|
|
|
PSPFileInfo GetFileInfo(std::string filename) {PSPFileInfo f; return f;} |
|
|
|
FileInfo GetFileInfo(std::string filename) {FileInfo f; return f;} |
|
|
|
bool OwnsHandle(u32 handle) {return false;} |
|
|
|
virtual bool MkDir(const std::string &dirname) {return false;} |
|
|
|
virtual bool RmDir(const std::string &dirname) {return false;} |
|
|
|
|