From 037ed8ae514b32682e55ed8a01f8cedffde7d623 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 27 Dec 2005 17:11:38 +0000 Subject: [PATCH] CString -> RString --- stepmania/src/LocalizedString.cpp | 2 +- stepmania/src/LocalizedString.h | 2 +- stepmania/src/LuaReference.cpp | 14 +++++++------- stepmania/src/LuaReference.h | 16 ++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/stepmania/src/LocalizedString.cpp b/stepmania/src/LocalizedString.cpp index a2f3fdc71f..cec6defed8 100644 --- a/stepmania/src/LocalizedString.cpp +++ b/stepmania/src/LocalizedString.cpp @@ -19,7 +19,7 @@ void LocalizedString::RefreshLocalizedStrings() (*p)->Refresh(); } -CString LocalizedString::LocalizeString( const CString &sSection, const CString &sName ) +RString LocalizedString::LocalizeString( const RString &sSection, const RString &sName ) { ASSERT( g_pfnLocalizer ); return g_pfnLocalizer( sSection, sName ); diff --git a/stepmania/src/LocalizedString.h b/stepmania/src/LocalizedString.h index beb648f727..22071db0aa 100644 --- a/stepmania/src/LocalizedString.h +++ b/stepmania/src/LocalizedString.h @@ -8,7 +8,7 @@ class LocalizedString public: static void RegisterLocalizer( RString (*pfnLocalizer)(const RString&,const RString&) ); static void RefreshLocalizedStrings(); - static CString LocalizeString( const CString &sSection, const CString &sName ); + static RString LocalizeString( const RString &sSection, const RString &sName ); LocalizedString( const RString &sSection, const RString &sName ); diff --git a/stepmania/src/LuaReference.cpp b/stepmania/src/LuaReference.cpp index c98ba715be..3b4c5a0492 100644 --- a/stepmania/src/LuaReference.cpp +++ b/stepmania/src/LuaReference.cpp @@ -160,7 +160,7 @@ void LuaReference::ReRegister() } -void LuaExpression::SetFromExpression( const CString &sExpression ) +void LuaExpression::SetFromExpression( const RString &sExpression ) { m_sExpression = "return " + sExpression; Register(); @@ -182,7 +182,7 @@ void LuaExpression::Register() LUA->Release( L ); } -CString LuaData::Serialize() const +RString LuaData::Serialize() const { /* Call Serialize(t), where t is our referenced object. */ Lua *L = LUA->Get(); @@ -201,7 +201,7 @@ CString LuaData::Serialize() const const char *pString = lua_tostring( L, -1 ); ASSERT_M( pString != NULL, "Serialize() didn't return a string" ); - CString sRet = pString; + RString sRet = pString; lua_pop( L, 1 ); LUA->Release( L ); @@ -209,12 +209,12 @@ CString LuaData::Serialize() const return sRet; } -void LuaData::LoadFromString( const CString &s ) +void LuaData::LoadFromString( const RString &s ) { Lua *L = LUA->Get(); /* Restore the serialized data by evaluating it. */ - CString sError; + RString sError; if( !LuaHelpers::RunScript( L, s, "serialization", sError, 1 ) ) { /* Serialize() should never return an invalid script. Drop the failed @@ -253,7 +253,7 @@ LuaTable::LuaTable() LUA->Release( L ); } -void LuaTable::Set( Lua *L, const CString &sKey ) +void LuaTable::Set( Lua *L, const RString &sKey ) { int iTop = lua_gettop( L ); this->PushSelf( L ); @@ -263,7 +263,7 @@ void LuaTable::Set( Lua *L, const CString &sKey ) lua_settop( L, iTop-1 ); // remove all of the above } -void LuaTable::Unset( Lua *L, const CString &sKey ) +void LuaTable::Unset( Lua *L, const RString &sKey ) { lua_pushnil( L ); Set( L, sKey ); diff --git a/stepmania/src/LuaReference.h b/stepmania/src/LuaReference.h index c13b5b0074..051d88326c 100644 --- a/stepmania/src/LuaReference.h +++ b/stepmania/src/LuaReference.h @@ -58,14 +58,14 @@ private: class LuaExpression: public LuaReference { public: - LuaExpression( const CString &sExpression = "" ) { if( sExpression != "" ) SetFromExpression( sExpression ); } - void SetFromExpression( const CString &sExpression ); + LuaExpression( const RString &sExpression = "" ) { if( sExpression != "" ) SetFromExpression( sExpression ); } + void SetFromExpression( const RString &sExpression ); protected: virtual void Register(); private: - CString m_sExpression; + RString m_sExpression; }; /* Reference a trivially restorable Lua object (any object that Serialize can handle). @@ -73,14 +73,14 @@ private: class LuaData: public LuaReference { public: - virtual CString Serialize() const; - virtual void LoadFromString( const CString &s ); + virtual RString Serialize() const; + virtual void LoadFromString( const RString &s ); protected: virtual void BeforeReset(); virtual void Register(); - CString m_sSerializedData; + RString m_sSerializedData; bool m_bWasSet; }; @@ -91,10 +91,10 @@ public: /* Set a key by the given name to a value on the stack, and pop the value * off the stack. */ - void Set( Lua *L, const CString &sKey ); + void Set( Lua *L, const RString &sKey ); /* Unset the given key (set it to nil). */ - void Unset( Lua *L, const CString &sKey ); + void Unset( Lua *L, const RString &sKey ); /* Set a key on the stack to a value on the stack; push the key first. Pop * both the key and the value off the stack. */