Unified two very, very similar structures with the name "SFileInfo"

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@595 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2008-09-21 13:32:33 +00:00
parent b6407396d8
commit de577e521f
3 changed files with 8 additions and 18 deletions

View File

@ -192,25 +192,25 @@ CARCFile::BuildFilenames(const size_t _FirstIndex, const size_t _LastIndex, cons
// this is a directory, build up the new szDirectory
if (_szDirectory != NULL)
{
rFileInfo.m_FullPath = StringFromFormat("%s%s\\", _szDirectory, &_szNameTable[uOffset]);
sprintf(rFileInfo.m_FullPath, "%s%s\\", _szDirectory, &_szNameTable[uOffset]);
}
else
{
rFileInfo.m_FullPath = StringFromFormat("%s\\", &_szNameTable[uOffset]);
sprintf(rFileInfo.m_FullPath, "%s\\", &_szNameTable[uOffset]);
}
CurrentIndex = BuildFilenames(CurrentIndex + 1, rFileInfo.m_FileSize, rFileInfo.m_FullPath.c_str(), _szNameTable);
CurrentIndex = BuildFilenames(CurrentIndex + 1, rFileInfo.m_FileSize, rFileInfo.m_FullPath, _szNameTable);
}
else
{
// this is a filename
if (_szDirectory != NULL)
{
rFileInfo.m_FullPath = StringFromFormat("%s%s", _szDirectory, &_szNameTable[uOffset]);
sprintf(rFileInfo.m_FullPath, "%s%s", _szDirectory, &_szNameTable[uOffset]);
}
else
{
rFileInfo.m_FullPath = StringFromFormat("%s", &_szNameTable[uOffset]);
sprintf(rFileInfo.m_FullPath, "%s", &_szNameTable[uOffset]);
}
CurrentIndex++;
@ -221,12 +221,12 @@ CARCFile::BuildFilenames(const size_t _FirstIndex, const size_t _LastIndex, cons
}
const CARCFile::SFileInfo*
const SFileInfo*
CARCFile::FindFileInfo(std::string _rFullPath) const
{
for (size_t i = 0; i < m_FileInfoVector.size(); i++)
{
if (!strcasecmp(m_FileInfoVector[i].m_FullPath.c_str(), _rFullPath.c_str()))
if (!strcasecmp(m_FileInfoVector[i].m_FullPath, _rFullPath.c_str()))
{
return(&m_FileInfoVector[i]);
}

View File

@ -51,17 +51,6 @@ class CARCFile
bool m_Initialized;
struct SFileInfo
{
u32 m_NameOffset;
u32 m_Offset;
u32 m_FileSize;
std::string m_FullPath;
bool IsDirectory() {return((m_NameOffset& 0xFF000000) != 0 ? true : false);}
};
typedef std::vector<SFileInfo>CFileInfoVector;
CFileInfoVector m_FileInfoVector;

View File

@ -22,6 +22,7 @@
namespace DiscIO
{
// file info of an FST entry
struct SFileInfo
{