Simplify: store attributes in a simple map<CString,CString>, not in an object.

Makes attributes lighter.
This commit is contained in:
Glenn Maynard
2005-10-11 10:24:07 +00:00
parent f533842452
commit 64d9c29568
8 changed files with 68 additions and 132 deletions
+3 -6
View File
@@ -95,7 +95,7 @@ bool IniFile::WriteFile( RageFileBasic &f ) const
FOREACH_CONST_Attr( pKey, pAttr )
{
if( f.PutLine( ssprintf("%s=%s", pAttr->m_sName.c_str(), pAttr->m_sValue.c_str()) ) == -1 )
if( f.PutLine( ssprintf("%s=%s", pAttr->first.c_str(), pAttr->second.c_str()) ) == -1 )
{
m_sError = f.GetError();
return false;
@@ -124,7 +124,7 @@ void IniFile::SetValue( const CString &keyname, const CString &valuename, const
XNode* pNode = GetChild( keyname );
if( pNode == NULL )
pNode = AppendChild( keyname );
pNode->SetAttrValue( valuename, value );
pNode->AppendAttr( valuename, value );
}
bool IniFile::DeleteValue(const CString &keyname, const CString &valuename)
@@ -132,10 +132,7 @@ bool IniFile::DeleteValue(const CString &keyname, const CString &valuename)
XNode* pNode = GetChild( keyname );
if( pNode == NULL )
return false;
XAttr* pAttr = pNode->GetAttr( valuename );
if( pAttr == NULL )
return false;
return pNode->RemoveAttr( pAttr );
return pNode->RemoveAttr( valuename );
}