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:
Glenn Maynard
2004-12-10 08:48:18 +00:00
parent 4feb167b6e
commit 287a150db7
7 changed files with 421 additions and 355 deletions
+2 -2
View File
@@ -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) );