From e25549cfe1ed0202fd8de323d402fcbd47e7709f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 7 Dec 2003 04:21:04 +0000 Subject: [PATCH] add stubs --- stepmania/src/RageFileManager.cpp | 52 +++++++++++++++++++++++++++++-- stepmania/src/RageFileManager.h | 2 ++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 1d62cee778..c5fbcd8b06 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -27,9 +27,7 @@ RageFileManager::RageFileManager() { /* Add file search paths, higher priority first. */ #if defined(XBOX) - RageFileManager::Mount( "dir", ".", "" ); - /* XXX: drop BASE_PATH and do this instead */ -// RageFileManager::Mount( "dir", "D:\\", "" ); + RageFileManager::Mount( "dir", SYS_BASE_PATH, "" ); #elif defined(LINUX) /* We can almost do this, to have machine profiles be system-global to eg. share * scores. It would need to handle permissions properly. */ @@ -83,6 +81,8 @@ RageFileManager::~RageFileManager() CString LoadedDriver::GetPath( CString path ) { + path.Replace( "\\", "/" ); + /* If the path begins with @, default mount points don't count. */ const bool Dedicated = ( path.size() && path[0] == '@' ); if( MountPoint.size() == 0 ) @@ -167,6 +167,17 @@ bool RageFileManager::MountpointIsReady( CString MountPoint ) return false; } +void RageFileManager::FlushDirCache( const CString &sPath ) +{ + for( unsigned i = 0; i < g_Drivers.size(); ++i ) + { + const CString path = g_Drivers[i].GetPath( sPath ); + if( path.size() == 0 ) + continue; + g_Drivers[i].driver->FlushDirCache( path ); + } +} + RageFileManager::FileType RageFileManager::GetFileType( const CString &sPath ) { for( unsigned i = 0; i < g_Drivers.size(); ++i ) @@ -314,3 +325,38 @@ bool RageFileManager::IsAFile( const CString &sPath ) { return GetFileType(sPath bool RageFileManager::IsADirectory( const CString &sPath ) { return GetFileType(sPath) == TYPE_DIR; } bool RageFileManager::DoesFileExist( const CString &sPath ) { return GetFileType(sPath) != TYPE_NONE; } +bool DoesFileExist( const CString &sPath ) +{ + return FILEMAN->DoesFileExist( sPath ); +} + +bool IsAFile( const CString &sPath ) +{ + return FILEMAN->IsAFile( sPath ); +} + +bool IsADirectory( const CString &sPath ) +{ + return FILEMAN->IsADirectory( sPath ); +} + +unsigned GetFileSizeInBytes( const CString &sPath ) +{ + return FILEMAN->GetFileSizeInBytes( sPath ); +} + +int GetFileModTime( const CString &sPath ) +{ + return FILEMAN->GetFileModTime( sPath ); +} + +void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ) +{ + FILEMAN->GetDirListing( sPath, AddTo, bOnlyDirs, bReturnPathToo ); +} + +void FlushDirCache() +{ + FILEMAN->FlushDirCache( "" ); +} + diff --git a/stepmania/src/RageFileManager.h b/stepmania/src/RageFileManager.h index fb43daa14a..a5fa27e322 100644 --- a/stepmania/src/RageFileManager.h +++ b/stepmania/src/RageFileManager.h @@ -26,6 +26,8 @@ public: bool IsMounted( CString MountPoint ); bool MountpointIsReady( CString MountPoint ); + void FlushDirCache( const CString &sPath ); + /* Used only by RageFile: */ RageFileObj *Open( const CString &sPath, RageFile::OpenMode mode, RageFile &p, int &err );