RageFile::GetFileSize() const
This commit is contained in:
@@ -319,7 +319,7 @@ int RageFile::SeekCur( int offset )
|
|||||||
return m_FilePos;
|
return m_FilePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RageFile::GetFileSize()
|
int RageFile::GetFileSize() const
|
||||||
{
|
{
|
||||||
if( !IsOpen() )
|
if( !IsOpen() )
|
||||||
RageException::Throw("\"%s\" is not open.", GetPath().c_str());
|
RageException::Throw("\"%s\" is not open.", GetPath().c_str());
|
||||||
@@ -327,7 +327,10 @@ int RageFile::GetFileSize()
|
|||||||
if( !(m_Mode&READ) )
|
if( !(m_Mode&READ) )
|
||||||
RageException::Throw("\"%s\" is not open for reading; can't GetFileSize", GetPath().c_str());
|
RageException::Throw("\"%s\" is not open for reading; can't GetFileSize", GetPath().c_str());
|
||||||
|
|
||||||
return m_File->GetFileSize();
|
/* GetFileSize() may need to do non-const-like things--the default implementation reads
|
||||||
|
* until the end of file to emulate it. However, it should always restore the state to
|
||||||
|
* the way it was, so pretend it's const. */
|
||||||
|
return const_cast<RageFileObj*>(m_File)->GetFileSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageFile::Rewind()
|
void RageFile::Rewind()
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
int Tell() const { return m_FilePos; }
|
int Tell() const { return m_FilePos; }
|
||||||
int Seek( int offset );
|
int Seek( int offset );
|
||||||
int SeekCur( int offset );
|
int SeekCur( int offset );
|
||||||
int GetFileSize();
|
int GetFileSize() const;
|
||||||
void Rewind();
|
void Rewind();
|
||||||
|
|
||||||
/* Raw I/O: */
|
/* Raw I/O: */
|
||||||
|
|||||||
Reference in New Issue
Block a user