SetValue, etc -> SetTextValue
This commit is contained in:
@@ -85,7 +85,7 @@ void Bookkeeper::LoadFromNode( const XNode *pNode )
|
||||
}
|
||||
|
||||
int iCoins;
|
||||
day->GetValue( iCoins );
|
||||
day->GetTextValue( iCoins );
|
||||
|
||||
m_mapCoinsForHour[d] = iCoins;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ XNode* Bookkeeper::CreateNode() const
|
||||
pDay->AppendAttr( "Year", d.m_iYear );
|
||||
|
||||
int iCoins = it->second;
|
||||
pDay->SetValue( iCoins );
|
||||
pDay->SetTextValue( iCoins );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,10 +54,10 @@ void ExportStrings::LuaInformation()
|
||||
pNode->AppendAttr( "xsi:schemaLocation", "http://www.stepmania.com Lua.xsd" );
|
||||
|
||||
XNode *pVersionNode = pNode->AppendChild( "Version" );
|
||||
pVersionNode->SetValue( PRODUCT_ID_VER );
|
||||
pVersionNode->SetTextValue( PRODUCT_ID_VER );
|
||||
|
||||
XNode *pDateNode = pNode->AppendChild( "Date" );
|
||||
pDateNode->SetValue( DateTime::GetNowDate().GetString() );
|
||||
pDateNode->SetTextValue( DateTime::GetNowDate().GetString() );
|
||||
|
||||
XmlFileUtil::SaveToFile( pNode, "Lua.xml", "Lua.xsl" );
|
||||
|
||||
|
||||
@@ -308,12 +308,12 @@ void HighScoreList::LoadFromNode( const XNode* pHighScoreList )
|
||||
{
|
||||
if( p->GetName() == "NumTimesPlayed" )
|
||||
{
|
||||
p->GetValue( iNumTimesPlayed );
|
||||
p->GetTextValue( iNumTimesPlayed );
|
||||
}
|
||||
else if( p->GetName() == "LastPlayed" )
|
||||
{
|
||||
RString s;
|
||||
p->GetValue( s );
|
||||
p->GetTextValue( s );
|
||||
dtLastPlayed.FromString( s );
|
||||
}
|
||||
else if( p->GetName() == "HighScore" )
|
||||
|
||||
@@ -1109,7 +1109,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
int iNumPlays = iter->second;
|
||||
|
||||
XNode *pStyleNode = s.CreateNode();
|
||||
pStyleNode->SetValue( iNumPlays );
|
||||
pStyleNode->SetTextValue( iNumPlays );
|
||||
|
||||
pNumSongsPlayedByStyle->AppendChild( pStyleNode );
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||
{
|
||||
FOREACH_CONST_Child( pDefaultModifiers, game_type )
|
||||
{
|
||||
game_type->GetValue( m_sDefaultModifiers[game_type->GetName()] );
|
||||
game_type->GetTextValue( m_sDefaultModifiers[game_type->GetName()] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1282,7 +1282,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||
if( !s.IsValid() )
|
||||
WARN_AND_CONTINUE;
|
||||
|
||||
style->GetValue( m_iNumSongsPlayedByStyle[s] );
|
||||
style->GetTextValue( m_iNumSongsPlayedByStyle[s] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1673,7 +1673,7 @@ void Profile::LoadCalorieDataFromNode( const XNode* pCalorieData )
|
||||
|
||||
float fCaloriesBurned = 0;
|
||||
|
||||
pCaloriesBurned->GetValue(fCaloriesBurned);
|
||||
pCaloriesBurned->GetTextValue(fCaloriesBurned);
|
||||
|
||||
m_mapDayToCaloriesBurned[date].fCals = fCaloriesBurned;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ bool Workout::LoadFromFile( RString sFile )
|
||||
if( songGenre->GetName() == "SongGenre" )
|
||||
{
|
||||
RString s;
|
||||
songGenre->GetValue( s );
|
||||
songGenre->GetTextValue( s );
|
||||
m_vsSongGenres.push_back( s );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,14 +92,14 @@ public:
|
||||
void SetName( const RString &sName ) { m_sName = sName; }
|
||||
const RString &GetName() const { return m_sName; }
|
||||
|
||||
const XNodeValue *GetValue() const { return m_pValue; }
|
||||
XNodeValue *GetValue() { return m_pValue; }
|
||||
void SetValueFrom( XNodeValue *pValue ) { delete m_pValue; m_pValue = pValue; }
|
||||
const XNodeValue *GetTextValue() const { return m_pValue; }
|
||||
XNodeValue *GetTextValue() { return m_pValue; }
|
||||
void SetTextValueFrom( XNodeValue *pValue ) { delete m_pValue; m_pValue = pValue; }
|
||||
|
||||
template <typename T>
|
||||
void GetValue( T &out ) const { m_pValue->GetValue(out); }
|
||||
void GetTextValue( T &out ) const { m_pValue->GetValue(out); }
|
||||
template <typename T>
|
||||
void SetValue( const T val ) { m_pValue->SetValue(val); }
|
||||
void SetTextValue( const T val ) { m_pValue->SetValue(val); }
|
||||
|
||||
// in own attribute list
|
||||
const XNodeValue *GetAttr( const RString &sAttrName ) const;
|
||||
@@ -112,12 +112,12 @@ public:
|
||||
const XNode *GetChild( const RString &sName ) const;
|
||||
XNode *GetChild( const RString &sName );
|
||||
template <typename T>
|
||||
bool GetChildValue( const RString &sName, T &out ) const { const XNode *pChild=GetChild(sName); if(pChild==NULL) return false; pChild->GetValue(out); return true; }
|
||||
bool GetChildValue( const RString &sName, T &out ) const { const XNode *pChild=GetChild(sName); if(pChild==NULL) return false; pChild->GetTextValue(out); return true; }
|
||||
bool PushChildValue( lua_State *L, const RString &sName ) const;
|
||||
|
||||
// modify DOM
|
||||
template <typename T>
|
||||
XNode *AppendChild( const RString &sName, T value ) { XNode *p=new XNode(sName); p->SetValue(value); return AppendChild(p); }
|
||||
XNode *AppendChild( const RString &sName, T value ) { XNode *p=new XNode(sName); p->SetTextValue(value); return AppendChild(p); }
|
||||
XNode *AppendChild( const RString &sName ) { XNode *p=new XNode(sName); return AppendChild(p); }
|
||||
XNode *AppendChild( XNode *node );
|
||||
bool RemoveChild( XNode *node, bool bDelete = true );
|
||||
|
||||
@@ -293,7 +293,7 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns
|
||||
|
||||
// open/close tag <TAG ..> ... </TAG>
|
||||
// ^- current pointer
|
||||
if( XIsEmptyString(pNode->GetValue()->GetValue<RString>()) )
|
||||
if( XIsEmptyString(pNode->GetTextValue()->GetValue<RString>()) )
|
||||
{
|
||||
// Text Value
|
||||
++iOffset;
|
||||
@@ -312,7 +312,7 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns
|
||||
iOffset = iEnd;
|
||||
ReplaceEntityText( sValue, g_mapEntitiesToChars );
|
||||
|
||||
pNode->SetValue( sValue );
|
||||
pNode->SetTextValue( sValue );
|
||||
}
|
||||
|
||||
// generate child nodes
|
||||
@@ -377,7 +377,7 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns
|
||||
}
|
||||
else // Alone child Tag Loaded
|
||||
{
|
||||
if( XIsEmptyString(pNode->GetValue()->GetValue<RString>()) && iOffset < xml.size() && xml[iOffset] != chXMLTagOpen )
|
||||
if( XIsEmptyString(pNode->GetTextValue()->GetValue<RString>()) && iOffset < xml.size() && xml[iOffset] != chXMLTagOpen )
|
||||
{
|
||||
// Text Value
|
||||
unsigned iEnd = xml.find( chXMLTagOpen, iOffset );
|
||||
@@ -394,7 +394,7 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns
|
||||
|
||||
iOffset = iEnd;
|
||||
ReplaceEntityText( sValue, g_mapEntitiesToChars );
|
||||
pNode->SetValue( sValue );
|
||||
pNode->SetTextValue( sValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -428,7 +428,7 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int
|
||||
WRITE( "' " );
|
||||
}
|
||||
|
||||
if( pNode->m_childs.empty() && pNode->GetValue()->GetValue<RString>().empty() )
|
||||
if( pNode->m_childs.empty() && pNode->GetTextValue()->GetValue<RString>().empty() )
|
||||
{
|
||||
// <TAG Attr1="Val1"/> alone tag
|
||||
WRITE( "/>" );
|
||||
@@ -446,7 +446,7 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int
|
||||
return false;
|
||||
|
||||
// Text Value
|
||||
if( !pNode->GetValue()->GetValue<RString>().empty() )
|
||||
if( !pNode->GetTextValue()->GetValue<RString>().empty() )
|
||||
{
|
||||
if( !pNode->m_childs.empty() )
|
||||
{
|
||||
@@ -456,7 +456,7 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int
|
||||
WRITE( "\t" );
|
||||
}
|
||||
RString s;
|
||||
pNode->GetValue( s );
|
||||
pNode->GetTextValue( s );
|
||||
ReplaceEntityText( s, g_mapCharsToEntities );
|
||||
WRITE( s );
|
||||
}
|
||||
@@ -617,8 +617,8 @@ void XmlFileUtil::CompileXNodeTree( XNode *pNode, const RString &sFile )
|
||||
FOREACH_Child( pNode, pChild )
|
||||
aToCompile.push_back( pChild );
|
||||
|
||||
XNodeValue *pValue = CompileXMLNodeValue( L, pNode->GetName(), pNode->GetValue(), sFile );
|
||||
pNode->SetValueFrom( pValue );
|
||||
XNodeValue *pValue = CompileXMLNodeValue( L, pNode->GetName(), pNode->GetTextValue(), sFile );
|
||||
pNode->SetTextValueFrom( pValue );
|
||||
|
||||
FOREACH_Attr( pNode, pAttr )
|
||||
{
|
||||
@@ -642,7 +642,7 @@ namespace
|
||||
XNodeLuaValue *pValue = new XNodeLuaValue;
|
||||
lua_pushvalue( L, -1 );
|
||||
pValue->SetValueFromStack( L );
|
||||
pNode->SetValueFrom( pValue );
|
||||
pNode->SetTextValueFrom( pValue );
|
||||
}
|
||||
|
||||
/* Iterate over the table, pulling out attributes and tables to process. */
|
||||
|
||||
Reference in New Issue
Block a user