remove SeekCur

This commit is contained in:
Glenn Maynard
2004-12-09 08:47:24 +00:00
parent 6904cccf16
commit fd7e23fce8
2 changed files with 1 additions and 32 deletions
+1 -31
View File
@@ -292,36 +292,6 @@ int RageFile::Seek( int offset )
return pos;
}
int RageFile::SeekCur( int offset )
{
ASSERT( offset >= 0 );
if( !IsOpen() )
RageException::Throw("\"%s\" is not open.", GetPath().c_str());
if( !(m_Mode&READ) )
RageException::Throw("\"%s\" is not open for reading; can't seek", GetPath().c_str());
if( !offset || m_EOF )
return m_FilePos;
int FromBuffer = min( offset, m_BufAvail );
m_FilePos += FromBuffer;
offset -= FromBuffer;
m_BufAvail -= FromBuffer;
m_pBuf += FromBuffer;
if( offset )
{
int pos = m_File->SeekCur( offset );
if( pos == -1 )
return -1;
m_FilePos = pos;
}
return m_FilePos;
}
int RageFile::GetFileSize() const
{
if( !IsOpen() )
@@ -429,7 +399,7 @@ int RageFile::Seek( int offset, int whence )
switch( whence )
{
case SEEK_CUR:
return SeekCur( (int) offset );
return Seek( Tell() + offset );
case SEEK_END:
offset += GetFileSize();
}
-1
View File
@@ -50,7 +50,6 @@ public:
int Tell() const { return m_FilePos; }
int Seek( int offset );
int SeekCur( int offset );
int GetFileSize() const;
void Rewind();