renamed PSPFileInfo to just FileInfo

This commit is contained in:
ShizZy 2013-09-23 21:55:02 -04:00
parent 1af6ae2f48
commit 59020e8d9c
3 changed files with 21 additions and 21 deletions

View File

@ -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;}

View File

@ -526,8 +526,8 @@ size_t DirectoryFileSystem::SeekFile(u32 handle, s32 position, FileMove type) {
}
}
PSPFileInfo DirectoryFileSystem::GetFileInfo(std::string filename) {
PSPFileInfo x;
FileInfo DirectoryFileSystem::GetFileInfo(std::string filename) {
FileInfo x;
x.name = filename;
std::string fullName = GetLocalPath(filename);
@ -584,8 +584,8 @@ static void tmFromFiletime(tm &dest, FILETIME &src)
}
#endif
std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
std::vector<PSPFileInfo> myVector;
std::vector<FileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
std::vector<FileInfo> myVector;
#ifdef _WIN32
WIN32_FIND_DATA findData;
HANDLE hFind;
@ -599,7 +599,7 @@ std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
}
while (true) {
PSPFileInfo entry;
FileInfo entry;
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry.type = FILETYPE_DIRECTORY;
else
@ -642,7 +642,7 @@ std::vector<PSPFileInfo> DirectoryFileSystem::GetDirListing(std::string path) {
}
while ((dirp = readdir(dp)) != NULL) {
PSPFileInfo entry;
FileInfo entry;
struct stat s;
std::string fullName = GetLocalPath(path) + "/"+dirp->d_name;
stat(fullName.c_str(), &s);
@ -734,8 +734,8 @@ u32 VFSFileSystem::OpenFile(std::string filename, FileAccess access, const char
return newHandle;
}
PSPFileInfo VFSFileSystem::GetFileInfo(std::string filename) {
PSPFileInfo x;
FileInfo VFSFileSystem::GetFileInfo(std::string filename) {
FileInfo x;
x.name = filename;
std::string fullName = GetLocalPath(filename);
@ -809,8 +809,8 @@ bool VFSFileSystem::GetHostPath(const std::string &inpath, std::string &outpath)
return false;
}
std::vector<PSPFileInfo> VFSFileSystem::GetDirListing(std::string path) {
std::vector<PSPFileInfo> myVector;
std::vector<FileInfo> VFSFileSystem::GetDirListing(std::string path) {
std::vector<FileInfo> myVector;
// TODO
return myVector;
}

View File

@ -88,13 +88,13 @@ public:
~DirectoryFileSystem();
void DoState(PointerWrap &p);
std::vector<PSPFileInfo> GetDirListing(std::string path);
std::vector<FileInfo> GetDirListing(std::string path);
u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL);
void CloseFile(u32 handle);
size_t ReadFile(u32 handle, u8 *pointer, s64 size);
size_t WriteFile(u32 handle, const u8 *pointer, s64 size);
size_t SeekFile(u32 handle, s32 position, FileMove type);
PSPFileInfo GetFileInfo(std::string filename);
FileInfo GetFileInfo(std::string filename);
bool OwnsHandle(u32 handle);
bool MkDir(const std::string &dirname);
@ -125,13 +125,13 @@ public:
~VFSFileSystem();
void DoState(PointerWrap &p);
std::vector<PSPFileInfo> GetDirListing(std::string path);
std::vector<FileInfo> GetDirListing(std::string path);
u32 OpenFile(std::string filename, FileAccess access, const char *devicename=NULL);
void CloseFile(u32 handle);
size_t ReadFile(u32 handle, u8 *pointer, s64 size);
size_t WriteFile(u32 handle, const u8 *pointer, s64 size);
size_t SeekFile(u32 handle, s32 position, FileMove type);
PSPFileInfo GetFileInfo(std::string filename);
FileInfo GetFileInfo(std::string filename);
bool OwnsHandle(u32 handle);
bool MkDir(const std::string &dirname);