FileSystem: Fixed SOME memory leaks, cleaned up code and fixed empty entry bug.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@596 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2008-09-21 14:51:40 +00:00
parent de577e521f
commit 60a4630324
4 changed files with 49 additions and 33 deletions

View File

@ -32,6 +32,15 @@ struct SFileInfo
char m_FullPath[512];
bool IsDirectory() {return((m_NameOffset& 0xFF000000) != 0 ? true : false);}
SFileInfo() : m_NameOffset(0), m_Offset(0), m_FileSize(0) {
memset(m_FullPath, 0, 512);
}
SFileInfo(const SFileInfo &rhs) : m_NameOffset(rhs.m_NameOffset),
m_Offset(rhs.m_Offset), m_FileSize(rhs.m_FileSize) {
strcpy(m_FullPath, rhs.m_FullPath);
}
};
class IFileSystem
{
@ -44,7 +53,7 @@ class IFileSystem
virtual bool IsInitialized() = 0;
virtual size_t GetFileList(std::vector<SFileInfo> *_rFilenames) = 0;
virtual size_t GetFileList(std::vector<SFileInfo *> &_rFilenames) = 0;
virtual size_t GetFileSize(const char* _rFullPath) = 0;