cleanup
This commit is contained in:
@@ -16,7 +16,7 @@ RageFile::RageFile( const RageFile &cpy )
|
|||||||
ResetBuf();
|
ResetBuf();
|
||||||
|
|
||||||
/* This will copy the file driver, including its internal file pointer. */
|
/* 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_Path = cpy.m_Path;
|
||||||
m_Mode = cpy.m_Mode;
|
m_Mode = cpy.m_Mode;
|
||||||
m_Error = cpy.m_Error;
|
m_Error = cpy.m_Error;
|
||||||
@@ -66,7 +66,7 @@ bool RageFile::Open( const CString& path, int mode )
|
|||||||
}
|
}
|
||||||
|
|
||||||
int error;
|
int error;
|
||||||
m_File = FILEMAN->Open( path, mode, *this, error );
|
m_File = FILEMAN->Open( path, mode, error );
|
||||||
|
|
||||||
if( m_File == NULL )
|
if( m_File == NULL )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class RageFileDriver
|
|||||||
public:
|
public:
|
||||||
RageFileDriver( FilenameDB *db ) { FDB = db; }
|
RageFileDriver( FilenameDB *db ) { FDB = db; }
|
||||||
virtual ~RageFileDriver();
|
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 void GetDirListing( const CString &sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo );
|
||||||
virtual RageFileManager::FileType GetFileType( const CString &sPath );
|
virtual RageFileManager::FileType GetFileType( const CString &sPath );
|
||||||
virtual int GetFileSizeInBytes( const CString &sFilePath );
|
virtual int GetFileSizeInBytes( const CString &sFilePath );
|
||||||
@@ -38,11 +38,9 @@ protected:
|
|||||||
CString m_sError;
|
CString m_sError;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RageFileObj( RageFile &p ) { }
|
|
||||||
virtual ~RageFileObj() { }
|
virtual ~RageFileObj() { }
|
||||||
|
|
||||||
CString GetError() const { return m_sError; }
|
CString GetError() const { return m_sError; }
|
||||||
// virtual CString RealPath() const { return parent->GetPath(); }
|
|
||||||
|
|
||||||
virtual int Seek( int offset ) = 0;
|
virtual int Seek( int offset ) = 0;
|
||||||
virtual int GetFileSize() = 0;
|
virtual int GetFileSize() = 0;
|
||||||
@@ -52,7 +50,7 @@ public:
|
|||||||
virtual int Read(void *buffer, size_t bytes) = 0;
|
virtual int Read(void *buffer, size_t bytes) = 0;
|
||||||
virtual int Write(const void *buffer, size_t bytes) = 0;
|
virtual int Write(const void *buffer, size_t bytes) = 0;
|
||||||
virtual int Flush() { return 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. */
|
/* This is used to register the driver, so RageFileManager can see it. */
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ static bool PathUsesSlowFlush( const CString &sPath )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Used only by RageFile: */
|
/* 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;
|
err = ENOENT;
|
||||||
|
|
||||||
@@ -681,7 +681,7 @@ RageFileObj *RageFileManager::Open( CString sPath, int mode, RageFile &p, int &e
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy a RageFileObj for a new RageFile. */
|
/* Copy a RageFileObj for a new RageFile. */
|
||||||
RageFileObj *RageFileManager::CopyFileObj( const RageFileObj *cpy, RageFile &p )
|
RageFileObj *RageFileManager::CopyFileObj( const RageFileObj *cpy )
|
||||||
{
|
{
|
||||||
LockMut( *g_Mutex );
|
LockMut( *g_Mutex );
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ public:
|
|||||||
void FlushDirCache( CString sPath );
|
void FlushDirCache( CString sPath );
|
||||||
|
|
||||||
/* Used only by RageFile: */
|
/* 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 );
|
void Close( RageFileObj *obj );
|
||||||
RageFileObj *CopyFileObj( const RageFileObj *cpy, RageFile &p );
|
RageFileObj *CopyFileObj( const RageFileObj *cpy );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RageFileObj *OpenForWriting( CString sPath, int mode, int &err );
|
RageFileObj *OpenForWriting( CString sPath, int mode, int &err );
|
||||||
|
|||||||
Reference in New Issue
Block a user