remove construct-and-open RageFile ctor

This commit is contained in:
Glenn Maynard
2004-09-25 02:50:31 +00:00
parent ec44af425a
commit 2e6ffb73e0
6 changed files with 13 additions and 28 deletions
+2 -3
View File
@@ -1610,9 +1610,8 @@ void GameState::StoreRankingName( PlayerNumber pn, CString name )
// Filter swear words from name
//
name.MakeUpper();
RageFile file(NAMES_BLACKLIST_FILE);
if (file.IsOpen())
RageFile file;
if( file.Open(NAMES_BLACKLIST_FILE) )
{
CString line;
+3 -4
View File
@@ -20,11 +20,10 @@ bool LyricsLoader::LoadFromLRCFile(const CString& sPath, Song& out)
{
LOG->Trace( "LyricsLoader::LoadFromLRCFile(%s)", sPath.c_str() );
RageFile input( sPath );
if (!input.IsOpen())
RageFile input;
if( !input.Open(sPath) )
{
LOG->Warn("Error opening file '%s' for reading.", sPath.c_str());
LOG->Warn("Error opening file '%s' for reading: %s", sPath.c_str(), input.GetError().c_str() );
return false;
}
+6 -8
View File
@@ -604,10 +604,9 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
* rather than open the file again. However, I'm not changing the logic,
* only the implementation. -- Steve
*/
RageFile file(sPath); //Why doesn't VC6 bitch here but it does with int??
if (!file.IsOpen())
RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
RageFile file;
if( !file.Open(sPath) )
RageException::Throw( "Failed to open %s for reading: %s", sPath.c_str(), file.GetError().c_str() );
while (!file.AtEOF())
{
CString line;
@@ -663,10 +662,9 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
// open the song file again and and look for this tag's value
RageFile file(sPath); //Why doesn't VC6 bitch here but it does with int??
if (!file.IsOpen())
RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
RageFile file;
if( !file.Open(sPath) )
RageException::Throw( "Failed to open %s for reading: %s", sPath.c_str(), file.GetError().c_str() );
while (!file.AtEOF())
{
CString line;
-9
View File
@@ -11,15 +11,6 @@ RageFile::RageFile()
m_FilePos = 0;
}
RageFile::RageFile( const CString& path, int mode )
{
m_File = NULL;
m_BufAvail = 0;
m_EOF = false;
m_FilePos = 0;
Open(path, mode);
}
RageFile::RageFile( const RageFile &cpy )
{
ResetBuf();
-1
View File
@@ -26,7 +26,6 @@ public:
};
RageFile();
RageFile( const CString& path, int mode = READ );
~RageFile() { Close(); }
RageFile( const RageFile &cpy );
@@ -45,9 +45,8 @@ bool RageMovieTexture::GetFourCC( CString fn, CString &handler, CString &type )
return false; \
}
RageFile file(fn);
if( !file.IsOpen() )
RageFile file;
if( !file.Open(fn) )
HANDLE_ERROR("Could not open file.");
if( !file.Seek(0x70) )
HANDLE_ERROR("Could not seek.");