cleanup
This commit is contained in:
@@ -65,7 +65,7 @@ int RageFileObj::GetFileSize()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int RageFileDriver::GetPathValue( CString path )
|
||||
int RageFileDriver::GetPathValue( const CString &path )
|
||||
{
|
||||
vector<CString> parts;
|
||||
split( path, SLASH, parts, true );
|
||||
@@ -99,23 +99,23 @@ int RageFileDriver::GetPathValue( CString path )
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RageFileDriver::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo )
|
||||
void RageFileDriver::GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo )
|
||||
{
|
||||
FDB->GetDirListing( sPath, AddTo, bOnlyDirs, bReturnPathToo );
|
||||
}
|
||||
|
||||
RageFileManager::FileType RageFileDriver::GetFileType( CString sPath )
|
||||
RageFileManager::FileType RageFileDriver::GetFileType( const CString &sPath )
|
||||
{
|
||||
/* XXX */
|
||||
return (RageFileManager::FileType) FDB->GetFileType( sPath );
|
||||
}
|
||||
|
||||
int RageFileDriver::GetFileSizeInBytes( CString sPath )
|
||||
int RageFileDriver::GetFileSizeInBytes( const CString &sPath )
|
||||
{
|
||||
return FDB->GetFileSize( sPath );
|
||||
}
|
||||
|
||||
int RageFileDriver::GetFileModTime( CString sPath )
|
||||
int RageFileDriver::GetFileModTime( const CString &sPath )
|
||||
{
|
||||
return FDB->GetFileModTime( sPath );
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ class RageFileDriver
|
||||
public:
|
||||
RageFileDriver( FilenameDB *db ) { FDB = db; }
|
||||
virtual ~RageFileDriver();
|
||||
virtual RageFileObj *Open( CString path, RageFile::OpenMode mode, RageFile &p, int &err ) = 0;
|
||||
virtual void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo );
|
||||
virtual RageFileManager::FileType GetFileType( CString sPath );
|
||||
virtual int GetFileSizeInBytes( CString sFilePath );
|
||||
virtual int GetFileModTime( CString sPath );
|
||||
virtual int GetPathValue( CString path );
|
||||
virtual RageFileObj *Open( const CString &path, RageFile::OpenMode mode, RageFile &p, int &err ) = 0;
|
||||
virtual void GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo );
|
||||
virtual RageFileManager::FileType GetFileType( const CString &sPath );
|
||||
virtual int GetFileSizeInBytes( const CString &sFilePath );
|
||||
virtual int GetFileModTime( const CString &sPath );
|
||||
virtual int GetPathValue( const CString &path );
|
||||
virtual bool Ready() { return true; } /* see RageFileManager::MountpointIsReady */
|
||||
virtual void FlushDirCache( const CString &sPath );
|
||||
|
||||
|
||||
@@ -192,9 +192,10 @@ static bool CreateDirectories( CString Path )
|
||||
return true;
|
||||
}
|
||||
|
||||
RageFileObj *RageFileDriverDirect::Open( CString sPath, RageFile::OpenMode mode, RageFile &p, int &err )
|
||||
RageFileObj *RageFileDriverDirect::Open( const CString &path, RageFile::OpenMode mode, RageFile &p, int &err )
|
||||
{
|
||||
sPath = root + sPath;
|
||||
CString sPath = root + path;
|
||||
|
||||
/* XXX: make sure this will partially resolve. eg. if "abc/def" exists,
|
||||
* and we're opening "ABC/DEF/GHI/jkl/mno", make sure this will resolve
|
||||
* to "abc/def/GHI/jkl/mno"; we'll create the missing ones later. */
|
||||
|
||||
@@ -8,7 +8,7 @@ class RageFileDriverDirect: public RageFileDriver
|
||||
public:
|
||||
RageFileDriverDirect( CString root );
|
||||
|
||||
RageFileObj *Open( CString path, RageFile::OpenMode mode, RageFile &p, int &err );
|
||||
RageFileObj *Open( const CString &path, RageFile::OpenMode mode, RageFile &p, int &err );
|
||||
bool Ready();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user