add GetXML overload for convenience

This commit is contained in:
Chris Danford
2005-06-16 03:08:45 +00:00
parent 11bc71c826
commit 63eebeb75e
3 changed files with 19 additions and 4 deletions
+1 -4
View File
@@ -23,7 +23,6 @@
#include "XmlFile.h"
#include "BackgroundUtil.h"
#include "song.h"
#include "RageFileDriverMemory.h"
ThemeMetric<float> LEFT_EDGE ("Background","LeftEdge");
ThemeMetric<float> TOP_EDGE ("Background","TopEdge");
@@ -768,9 +767,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( iter == m_BGAnimations.end() )
{
XNode *pNode = change.m_def.CreateNode();
RageFileObjMem f;
pNode->GetXML( f, NULL );
LOG->Warn( "Tried to switch to a background that was never loaded\n" + f.GetString() );
LOG->Warn( "Tried to switch to a background that was never loaded\n" + pNode->GetXML() );
SAFE_DELETE( pNode );
return;
}
+17
View File
@@ -9,6 +9,7 @@
#include "DateTime.h"
#include "Foreach.h"
#include "arch/Dialog/Dialog.h"
#include "RageFileDriverMemory.h"
static const char chXMLTagOpen = '<';
@@ -613,6 +614,22 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT *opt ) const
return true;
}
//========================================================
// Name : GetXML
// Desc : convert plain xml text from parsed xml node
// Param :
// Return : converted plain string
//--------------------------------------------------------
// Coder Date Desc
// bro 2002-10-29
//========================================================
CString XNode::GetXML() const
{
RageFileObjMem f;
GetXML( f, NULL );
return f.GetString();
}
//========================================================
// Name : GetValue
// Desc :
+1
View File
@@ -170,6 +170,7 @@ struct XNode
char* Load( const char* pszXml, PARSEINFO *pi );
char* LoadAttributes( const char* pszAttrs, PARSEINFO *pi );
bool GetXML( RageFileBasic &f, DISP_OPT *opt ) const;
CString GetXML() const;
bool LoadFromFile( const CString &sFile );
bool LoadFromFile( RageFileBasic &f );