CString -> RString

This commit is contained in:
Chris Danford
2005-12-27 17:11:38 +00:00
parent 6681ad9dd4
commit 037ed8ae51
4 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -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 );
+1 -1
View File
@@ -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 );
+7 -7
View File
@@ -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 );
+8 -8
View File
@@ -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. */