diff --git a/stepmania/src/RageFileDriverZip.cpp b/stepmania/src/RageFileDriverZip.cpp index d08b520d46..bedd281edf 100644 --- a/stepmania/src/RageFileDriverZip.cpp +++ b/stepmania/src/RageFileDriverZip.cpp @@ -406,7 +406,7 @@ RageFileObj *RageFileDriverZip::Open( const CString &path, int mode, RageFile &p return NULL; } - File *f = FDB->GetFile( path ); + const File *f = FDB->GetFile( path ); if( f == NULL ) { err = ENOENT; diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 9368128ace..796ff62c9a 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -115,7 +115,7 @@ RageFileManager::FileType FilenameDB::GetFileType( const CString &sPath ) if( Name == "." ) return RageFileManager::TYPE_DIR; - FileSet *fs = GetFileSet( Dir ); + const FileSet *fs = GetFileSet( Dir ); return fs->GetFileType( Name ); } @@ -124,7 +124,7 @@ int FilenameDB::GetFileSize( const CString &sPath ) { CString Dir, Name; SplitPath(sPath, Dir, Name); - FileSet *fs = GetFileSet( Dir ); + const FileSet *fs = GetFileSet( Dir ); return fs->GetFileSize(Name); } @@ -132,7 +132,7 @@ int FilenameDB::GetFileHash( const CString &sPath ) { CString Dir, Name; SplitPath(sPath, Dir, Name); - FileSet *fs = GetFileSet( Dir ); + const FileSet *fs = GetFileSet( Dir ); return fs->GetFileHash(Name); } @@ -147,7 +147,7 @@ bool FilenameDB::ResolvePath(CString &path) /* Resolve each component. */ CString ret = ""; - FileSet *fs = NULL; + const FileSet *fs = NULL; File *prev_file = NULL; static const CString slash("/"); while( 1 ) @@ -162,7 +162,7 @@ bool FilenameDB::ResolvePath(CString &path) CString p = path.substr( begin, size ); ASSERT_M( p.size() != 1 || p[0] != '.', path ); // no . ASSERT_M( p.size() != 2 || p[0] != '.' || p[1] != '.', path ); // no .. - set::iterator it = fs->files.find( File(p) ); + set::const_iterator it = fs->files.find( File(p) ); /* If there were no matches, the path isn't found. */ if( it == fs->files.end() ) @@ -188,13 +188,13 @@ bool FilenameDB::ResolvePath(CString &path) void FilenameDB::GetFilesMatching(const CString &dir, const CString &beginning, const CString &containing, const CString &ending, vector &out, bool bOnlyDirs) { - FileSet *fs = GetFileSet( dir ); + const FileSet *fs = GetFileSet( dir ); fs->GetFilesMatching(beginning, containing, ending, out, bOnlyDirs); } void FilenameDB::GetFilesEqualTo(const CString &dir, const CString &fn, vector &out, bool bOnlyDirs) { - FileSet *fs = GetFileSet( dir ); + const FileSet *fs = GetFileSet( dir ); fs->GetFilesEqualTo(fn, out, bOnlyDirs); } @@ -369,7 +369,7 @@ void FilenameDB::FlushDirCache() dirs.clear(); } -File *FilenameDB::GetFile( const CString &sPath ) +const File *FilenameDB::GetFile( const CString &sPath ) { CString Dir, Name; SplitPath(sPath, Dir, Name); diff --git a/stepmania/src/RageUtil_FileDB.h b/stepmania/src/RageUtil_FileDB.h index ac80411822..6ba8fe06c6 100644 --- a/stepmania/src/RageUtil_FileDB.h +++ b/stepmania/src/RageUtil_FileDB.h @@ -30,7 +30,7 @@ struct File /* If this is non-NULL, and dir is true, this is a pointer to the FileSet containing * the directory contents. (This is a cache; it isn't always set.) */ - FileSet *dirp; + const FileSet *dirp; File() { dir=false; dirp=NULL; size=-1; hash=-1; priv=NULL;} File( const CString &fn ) @@ -92,7 +92,7 @@ public: void AddFile( const CString &sPath, int size, int hash, void *priv=NULL ); void DelFile( const CString &sPath ); - File *GetFile( const CString &path ); + const File *GetFile( const CString &path ); /* This handles at most two * wildcards. If we need anything more complicated, * we'll need to use fnmatch or regex. */