Move buffering logic from RageFile into RageFileObj.
Common file interface class, RageBasicFile, shared by RageFile and RageFileObj. This makes most uses of these objects interchangeable. RageFile is now just a simple wrapper for RageFileObj, to create files in FILEMAN's namespace; file objects can also be created independently. This means that, for example, IniFile can be used to write a file to a CString, without having to jump through hoops, and without having to use a separate file access wrapper; just do something like: RageFileObjMem string_file; ini.WriteFile( string ); const CString &sString = string_file.GetString();
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
virtual int SeekInternal( int offset );
|
||||
virtual RageFileObj *Copy() const;
|
||||
virtual CString GetDisplayPath() const { return path; }
|
||||
virtual int GetFileSize();
|
||||
virtual int GetFileSize() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ int RageFileObjDirect::SeekInternal( int offset )
|
||||
return lseek( fd, offset, SEEK_SET );
|
||||
}
|
||||
|
||||
int RageFileObjDirect::GetFileSize()
|
||||
int RageFileObjDirect::GetFileSize() const
|
||||
{
|
||||
const int OldPos = lseek( fd, 0, SEEK_CUR );
|
||||
ASSERT_M( OldPos != -1, strerror(errno) );
|
||||
|
||||
Reference in New Issue
Block a user