From 8884936a175275f0b88d29f6935d9a5248d56e9f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 18 Feb 2005 03:07:22 +0000 Subject: [PATCH] const fix --- stepmania/src/XmlFile.cpp | 12 ++++++------ stepmania/src/XmlFile.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index dce165d2e5..73c8684697 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -477,7 +477,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ ) // Coder Date Desc // bro 2002-10-29 //======================================================== -bool XAttr::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) +bool XAttr::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) const { return f.Write(m_sName + "='" + (opt->reference_value&&opt->entitys?opt->entitys->Entity2Ref(m_sValue):m_sValue) + "' ") != -1; } @@ -491,7 +491,7 @@ bool XAttr::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) // Coder Date Desc // bro 2002-10-29 //======================================================== -bool XNode::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) +bool XNode::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) const { // tab if( opt && opt->newline ) @@ -513,7 +513,7 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) if( !m_attrs.empty() ) if( f.Write(" ") == -1 ) return false; - FOREACH_Attr( this, p ) + FOREACH_CONST_Attr( this, p ) if( !p->GetXML(f, opt) ) return false; @@ -534,7 +534,7 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT *opt /*= &optDefault*/ ) opt->tab_base++; } - FOREACH_Child( this, p ) + FOREACH_CONST_Child( this, p ) if( !p->GetXML( f, opt ) ) return false; @@ -1032,7 +1032,7 @@ bool XNode::LoadFromFile( RageFileBasic &f, PARSEINFO *pi ) return true; } -bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT *opt ) +bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT *opt ) const { f.PutLine( "" ); if( !opt->stylesheet.empty() ) @@ -1044,7 +1044,7 @@ bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT *opt ) return true; } -bool XNode::SaveToFile( const CString &sFile, DISP_OPT *opt ) +bool XNode::SaveToFile( const CString &sFile, DISP_OPT *opt ) const { RageFile f; if( !f.Open(sFile, RageFile::WRITE) ) diff --git a/stepmania/src/XmlFile.h b/stepmania/src/XmlFile.h index 03916b0669..69100c904c 100644 --- a/stepmania/src/XmlFile.h +++ b/stepmania/src/XmlFile.h @@ -144,7 +144,7 @@ struct XAttr void GetValue(unsigned &out) const; void GetValue(DateTime &out) const; - bool GetXML( RageFileBasic &f, DISP_OPT *opt = &optDefault ); + bool GetXML( RageFileBasic &f, DISP_OPT *opt = &optDefault ) const; }; // XMLNode structure @@ -171,12 +171,12 @@ struct XNode // Load/Save XML char* Load( const char* pszXml, PARSEINFO *pi = &piDefault ); char* LoadAttributes( const char* pszAttrs, PARSEINFO *pi = &piDefault ); - bool GetXML( RageFileBasic &f, DISP_OPT *opt = &optDefault ); + bool GetXML( RageFileBasic &f, DISP_OPT *opt = &optDefault ) const; bool LoadFromFile( const CString &sFile, PARSEINFO *pi = &piDefault ); bool LoadFromFile( RageFileBasic &f, PARSEINFO *pi = &piDefault ); - bool SaveToFile( const CString &sFile, DISP_OPT *opt = &optDefault ); - bool SaveToFile( RageFileBasic &f, DISP_OPT *opt = &optDefault ); + bool SaveToFile( const CString &sFile, DISP_OPT *opt = &optDefault ) const; + bool SaveToFile( RageFileBasic &f, DISP_OPT *opt = &optDefault ) const; // in own attribute list const XAttr *GetAttr( const char* attrname ) const;