From 05b5ab8a1d2a61be1d75728321cc08865a765ac9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 6 Jan 2004 05:44:28 +0000 Subject: [PATCH] remove TTYPE_FILE, TTYPE_DIR, TTYPE_NONE --- stepmania/src/RageFileDriverDirect.cpp | 6 +++--- stepmania/src/RageUtil_FileDB.cpp | 10 +++++----- stepmania/src/RageUtil_FileDB.h | 9 ++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/stepmania/src/RageFileDriverDirect.cpp b/stepmania/src/RageFileDriverDirect.cpp index cd3a7066a1..2d27edf444 100644 --- a/stepmania/src/RageFileDriverDirect.cpp +++ b/stepmania/src/RageFileDriverDirect.cpp @@ -261,7 +261,7 @@ bool RageFileDriverDirect::Remove( const CString &path ) FDB->ResolvePath( sPath ); switch( this->GetFileType(sPath) ) { - case TTYPE_FILE: + case RageFileManager::TYPE_FILE: LOG->Trace("remove '%s'", (root + sPath).c_str()); if( DoRemove( root + sPath ) == -1 ) { @@ -272,7 +272,7 @@ bool RageFileDriverDirect::Remove( const CString &path ) FDB->DelFile( sPath ); return true; - case TTYPE_DIR: + case RageFileManager::TYPE_DIR: LOG->Trace("rmdir '%s'", (root + sPath).c_str()); if( DoRmdir( root + sPath ) == -1 ) { @@ -283,7 +283,7 @@ bool RageFileDriverDirect::Remove( const CString &path ) FDB->DelFile( sPath ); return true; - case TTYPE_NONE: return false; + case RageFileManager::TYPE_NONE: return false; default: ASSERT(0); return false; } } diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index c908b07931..da092f2f59 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -52,13 +52,13 @@ void FileSet::GetFilesEqualTo(const CString &str, vector &out, bool bOn out.push_back( i->name ); } -FileType FileSet::GetFileType(const CString &path ) const +RageFileManager::FileType FileSet::GetFileType(const CString &path ) const { set::const_iterator i = files.find( File(path) ); if(i == files.end()) - return TTYPE_NONE; + return RageFileManager::TYPE_NONE; - return i->dir? TTYPE_DIR:TTYPE_FILE; + return i->dir? RageFileManager::TYPE_DIR:RageFileManager::TYPE_FILE; } int FileSet::GetFileSize(const CString &path) const @@ -101,13 +101,13 @@ static void SplitPath( CString Path, CString &Dir, CString &Name ) } -FileType FilenameDB::GetFileType( const CString &sPath ) +RageFileManager::FileType FilenameDB::GetFileType( const CString &sPath ) { CString Dir, Name; SplitPath( sPath, Dir, Name ); if( Name == "." ) - return TTYPE_DIR; + return RageFileManager::TYPE_DIR; FileSet *fs = GetFileSet( Dir ); return fs->GetFileType( Name ); diff --git a/stepmania/src/RageUtil_FileDB.h b/stepmania/src/RageUtil_FileDB.h index 5a8cf33056..35a0edecdf 100644 --- a/stepmania/src/RageUtil_FileDB.h +++ b/stepmania/src/RageUtil_FileDB.h @@ -4,8 +4,7 @@ #include #include #include "RageTimer.h" - -enum FileType { TTYPE_FILE, TTYPE_DIR, TTYPE_NONE }; +#include "RageFileManager.h" struct FileSet; struct File @@ -16,7 +15,7 @@ struct File void SetName( const CString &fn ) { name = fn; - lname = name; + lname = name; lname.MakeLower(); } @@ -62,7 +61,7 @@ struct FileSet vector &out, bool bOnlyDirs) const; void GetFilesEqualTo(const CString &pat, vector &out, bool bOnlyDirs) const; - FileType GetFileType( const CString &path ) const; + RageFileManager::FileType GetFileType( const CString &path ) const; int GetFileSize(const CString &path) const; int GetFileHash(const CString &path) const; }; @@ -103,7 +102,7 @@ public: * case. If "path" doesn't exist at all, return false and don't change it. */ bool ResolvePath(CString &path); - FileType GetFileType( const CString &path ); + RageFileManager::FileType GetFileType( const CString &path ); int GetFileSize(const CString &path); int GetFileHash( const CString &sFilePath ); void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo );