add RageFile::Flush

This commit is contained in:
Glenn Maynard
2003-12-12 07:47:38 +00:00
parent f063c76799
commit 63bb61388a
4 changed files with 25 additions and 18 deletions
+17 -11
View File
@@ -281,17 +281,6 @@ int RageFile::Read( void *buffer, size_t bytes )
return ret;
}
int RageFile::Write( const void *buffer, size_t bytes )
{
if( !IsOpen() )
RageException::Throw("\"%s\" is not open.", GetPath().c_str());
if( m_Mode != WRITE )
RageException::Throw("\"%s\" is not open for writing", GetPath().c_str());
return m_File->Write( buffer, bytes );
}
int RageFile::Seek( int offset )
{
if( !IsOpen() )
@@ -395,6 +384,18 @@ int RageFile::Read( CString &buffer, size_t bytes )
return ret;
}
int RageFile::Write( const void *buffer, size_t bytes )
{
if( !IsOpen() )
RageException::Throw("\"%s\" is not open.", GetPath().c_str());
if( m_Mode != WRITE )
RageException::Throw("\"%s\" is not open for writing", GetPath().c_str());
return m_File->Write( buffer, bytes );
}
int RageFile::Write( const void *buffer, size_t bytes, int nmemb )
{
/* Simple write. We never return partial writes. */
@@ -404,6 +405,11 @@ int RageFile::Write( const void *buffer, size_t bytes, int nmemb )
return ret / bytes;
}
int RageFile::Flush()
{
return m_File->Flush();
}
int RageFile::Read( void *buffer, size_t bytes, int nmemb )
{
const int ret = Read( buffer, bytes*nmemb );