DISP_OPT -> XMLDisplayOptions.

This commit is contained in:
Steve Checkoway
2006-10-01 13:07:20 +00:00
parent 6651be1203
commit 01cd66bd0f
8 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ void Bookkeeper::WriteToDisk()
return; return;
} }
DISP_OPT opt; XMLDisplayOptions opt;
XNode *xml = CreateNode(); XNode *xml = CreateNode();
xml->SaveToFile( f, opt ); xml->SaveToFile( f, opt );
delete xml; delete xml;
+1 -1
View File
@@ -392,7 +392,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
xml.AppendChild( "FooterText", FOOTER_TEXT ); xml.AppendChild( "FooterText", FOOTER_TEXT );
xml.AppendChild( "FooterLink", FOOTER_LINK ); xml.AppendChild( "FooterLink", FOOTER_LINK );
DISP_OPT opts; XMLDisplayOptions opts;
opts.stylesheet = CATALOG_XSL; opts.stylesheet = CATALOG_XSL;
opts.write_tabs = false; opts.write_tabs = false;
xml.SaveToFile(fn, opts); xml.SaveToFile(fn, opts);
+1 -1
View File
@@ -57,7 +57,7 @@ void ExportStrings::LuaInformation()
XNode *pDateNode = pNode->AppendChild( "Date" ); XNode *pDateNode = pNode->AppendChild( "Date" );
pDateNode->m_sValue = DateTime::GetNowDate().GetString(); pDateNode->m_sValue = DateTime::GetNowDate().GetString();
DISP_OPT disp; XMLDisplayOptions disp;
disp.stylesheet = "Lua.xsl"; disp.stylesheet = "Lua.xsl";
pNode->SaveToFile( "Lua.xml", disp ); pNode->SaveToFile( "Lua.xml", disp );
+1 -1
View File
@@ -940,7 +940,7 @@ bool Profile::SaveStatsXmlToDir( RString sDir, bool bSignData ) const
// Save stats.xml // Save stats.xml
RString fn = sDir + STATS_XML; RString fn = sDir + STATS_XML;
DISP_OPT opts; XMLDisplayOptions opts;
opts.stylesheet = STATS_XSL; opts.stylesheet = STATS_XSL;
opts.write_tabs = false; opts.write_tabs = false;
bool bSaved = xml->SaveToFile( fn, opts ); bool bSaved = xml->SaveToFile( fn, opts );
+1 -1
View File
@@ -2592,7 +2592,7 @@ void ScreenGameplay::SaveReplay()
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{ {
XNode *p = pi->m_pPlayer->GetNoteData().CreateNode(); XNode *p = pi->m_pPlayer->GetNoteData().CreateNode();
DISP_OPT opt; XMLDisplayOptions opt;
// //
// Find a file name for the screenshot // Find a file name for the screenshot
+1 -1
View File
@@ -213,7 +213,7 @@ bool Workout::SaveToFile( RString sFile )
songGenres->AppendChild( "SongGenre", *s ); songGenres->AppendChild( "SongGenre", *s );
} }
DISP_OPT opts; XMLDisplayOptions opts;
return xml.SaveToFile( sFile, opts ); return xml.SaveToFile( sFile, opts );
} }
+5 -5
View File
@@ -391,7 +391,7 @@ unsigned XNode::Load( const RString &xml, RString &sErrorOut, unsigned iOffset )
// Desc : convert plain xml text from parsed xml attirbute // Desc : convert plain xml text from parsed xml attirbute
// Return : converted plain string // Return : converted plain string
bool XNode::GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const RString &sName, const RString &sValue ) const bool XNode::GetAttrXML( RageFileBasic &f, XMLDisplayOptions &opt, const RString &sName, const RString &sValue ) const
{ {
RString s(sValue); RString s(sValue);
ReplaceEntityText( s, g_mapCharsToEntities ); ReplaceEntityText( s, g_mapCharsToEntities );
@@ -400,7 +400,7 @@ bool XNode::GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const RString &sName, c
// Desc : convert plain xml text from parsed xml node // Desc : convert plain xml text from parsed xml node
// Return : converted plain string // Return : converted plain string
bool XNode::GetXML( RageFileBasic &f, DISP_OPT &opt ) const bool XNode::GetXML( RageFileBasic &f, XMLDisplayOptions &opt ) const
{ {
// tab // tab
if( f.Write("\r\n") == -1 ) if( f.Write("\r\n") == -1 )
@@ -483,7 +483,7 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT &opt ) const
RString XNode::GetXML() const RString XNode::GetXML() const
{ {
RageFileObjMem f; RageFileObjMem f;
DISP_OPT opt; XMLDisplayOptions opt;
GetXML( f, opt ); GetXML( f, opt );
return f.GetString(); return f.GetString();
} }
@@ -596,7 +596,7 @@ void XNode::AppendAttr( const RString &sName, float value ){ AppendAttr(sName,ss
void XNode::AppendAttr( const RString &sName, int value ) { AppendAttr(sName,ssprintf("%d",value)); } void XNode::AppendAttr( const RString &sName, int value ) { AppendAttr(sName,ssprintf("%d",value)); }
void XNode::AppendAttr( const RString &sName, unsigned value ) { AppendAttr(sName,ssprintf("%u",value)); } void XNode::AppendAttr( const RString &sName, unsigned value ) { AppendAttr(sName,ssprintf("%u",value)); }
bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const bool XNode::SaveToFile( RageFileBasic &f, XMLDisplayOptions &opt ) const
{ {
f.PutLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" ); f.PutLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" );
if( !opt.stylesheet.empty() ) if( !opt.stylesheet.empty() )
@@ -608,7 +608,7 @@ bool XNode::SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const
return true; return true;
} }
bool XNode::SaveToFile( const RString &sFile, DISP_OPT &opt ) const bool XNode::SaveToFile( const RString &sFile, XMLDisplayOptions &opt ) const
{ {
RageFile f; RageFile f;
if( !f.Open(sFile, RageFile::WRITE) ) if( !f.Open(sFile, RageFile::WRITE) )
+6 -6
View File
@@ -36,13 +36,13 @@ typedef multimap<RString,XNode*> XNodes;
++Var##Iter ) ++Var##Iter )
// display optional environment // display optional environment
struct DISP_OPT struct XMLDisplayOptions
{ {
RString stylesheet; // empty string = no stylesheet RString stylesheet; // empty string = no stylesheet
bool write_tabs; // if false, don't write tab indent characters bool write_tabs; // if false, don't write tab indent characters
int tab_base; // internal usage int tab_base; // internal usage
DISP_OPT() XMLDisplayOptions()
{ {
stylesheet = ""; stylesheet = "";
write_tabs = true; write_tabs = true;
@@ -74,12 +74,12 @@ public:
// Load/Save XML // Load/Save XML
unsigned Load( const RString &sXml, RString &sErrorOut, unsigned iOffset = 0 ); unsigned Load( const RString &sXml, RString &sErrorOut, unsigned iOffset = 0 );
unsigned LoadAttributes( const RString &sAttrs, RString &sErrorOut, unsigned iOffset ); unsigned LoadAttributes( const RString &sAttrs, RString &sErrorOut, unsigned iOffset );
bool GetXML( RageFileBasic &f, DISP_OPT &opt ) const; bool GetXML( RageFileBasic &f, XMLDisplayOptions &opt ) const;
bool GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const RString &sName, const RString &sValue ) const; bool GetAttrXML( RageFileBasic &f, XMLDisplayOptions &opt, const RString &sName, const RString &sValue ) const;
RString GetXML() const; RString GetXML() const;
bool SaveToFile( const RString &sFile, DISP_OPT &opt ) const; bool SaveToFile( const RString &sFile, XMLDisplayOptions &opt ) const;
bool SaveToFile( RageFileBasic &f, DISP_OPT &opt ) const; bool SaveToFile( RageFileBasic &f, XMLDisplayOptions &opt ) const;
// in own attribute list // in own attribute list
const RString *GetAttr( const RString &sAttrName ) const; const RString *GetAttr( const RString &sAttrName ) const;