allow passing a file directly to IniFile

This commit is contained in:
Glenn Maynard
2004-12-10 09:46:09 +00:00
parent 57c218dd6e
commit 2474150aeb
2 changed files with 15 additions and 1 deletions
+11 -1
View File
@@ -17,6 +17,11 @@ bool IniFile::ReadFile( const CString &sPath )
return 0;
}
return ReadFile( f );
}
bool IniFile::ReadFile( RageBasicFile &f )
{
CString keyname;
while( 1 )
{
@@ -66,9 +71,14 @@ bool IniFile::WriteFile( const CString &sPath )
return false;
}
return IniFile::WriteFile( f );
}
bool IniFile::WriteFile( RageBasicFile &f )
{
for( keymap::const_iterator k = keys.begin(); k != keys.end(); ++k )
{
if (k->second.empty())
if( k->second.empty() )
continue;
if( f.PutLine( ssprintf("[%s]", k->first.c_str()) ) == -1 )