This commit is contained in:
Glenn Maynard
2004-12-09 11:52:49 +00:00
parent ec22ffec62
commit 2bf27c582c
4 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ RageFile::RageFile( const RageFile &cpy )
ResetBuf();
/* This will copy the file driver, including its internal file pointer. */
m_File = FILEMAN->CopyFileObj( cpy.m_File, *this );
m_File = FILEMAN->CopyFileObj( cpy.m_File );
m_Path = cpy.m_Path;
m_Mode = cpy.m_Mode;
m_Error = cpy.m_Error;
@@ -66,7 +66,7 @@ bool RageFile::Open( const CString& path, int mode )
}
int error;
m_File = FILEMAN->Open( path, mode, *this, error );
m_File = FILEMAN->Open( path, mode, error );
if( m_File == NULL )
{
+2 -4
View File
@@ -15,7 +15,7 @@ class RageFileDriver
public:
RageFileDriver( FilenameDB *db ) { FDB = db; }
virtual ~RageFileDriver();
virtual RageFileObj *Open( const CString &path, int mode, RageFile &p, int &err ) = 0;
virtual RageFileObj *Open( const CString &path, int mode, 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 );
@@ -38,11 +38,9 @@ protected:
CString m_sError;
public:
RageFileObj( RageFile &p ) { }
virtual ~RageFileObj() { }
CString GetError() const { return m_sError; }
// virtual CString RealPath() const { return parent->GetPath(); }
virtual int Seek( int offset ) = 0;
virtual int GetFileSize() = 0;
@@ -52,7 +50,7 @@ public:
virtual int Read(void *buffer, size_t bytes) = 0;
virtual int Write(const void *buffer, size_t bytes) = 0;
virtual int Flush() { return 0; }
virtual RageFileObj *Copy( RageFile &p ) const = 0;
virtual RageFileObj *Copy() const = 0;
};
/* This is used to register the driver, so RageFileManager can see it. */
+2 -2
View File
@@ -638,7 +638,7 @@ static bool PathUsesSlowFlush( const CString &sPath )
}
/* Used only by RageFile: */
RageFileObj *RageFileManager::Open( CString sPath, int mode, RageFile &p, int &err )
RageFileObj *RageFileManager::Open( CString sPath, int mode, int &err )
{
err = ENOENT;
@@ -681,7 +681,7 @@ RageFileObj *RageFileManager::Open( CString sPath, int mode, RageFile &p, int &e
}
/* Copy a RageFileObj for a new RageFile. */
RageFileObj *RageFileManager::CopyFileObj( const RageFileObj *cpy, RageFile &p )
RageFileObj *RageFileManager::CopyFileObj( const RageFileObj *cpy )
{
LockMut( *g_Mutex );
+2 -2
View File
@@ -45,9 +45,9 @@ public:
void FlushDirCache( CString sPath );
/* Used only by RageFile: */
RageFileObj *Open( CString sPath, int mode, RageFile &p, int &err );
RageFileObj *Open( CString sPath, int mode, int &err );
void Close( RageFileObj *obj );
RageFileObj *CopyFileObj( const RageFileObj *cpy, RageFile &p );
RageFileObj *CopyFileObj( const RageFileObj *cpy );
private:
RageFileObj *OpenForWriting( CString sPath, int mode, int &err );