SetFromStack

This commit is contained in:
Glenn Maynard
2005-02-22 04:22:24 +00:00
parent f762300f49
commit 61064820b9
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -32,6 +32,14 @@ void IPreference::PushValue( lua_State *L ) const
lua_pushnil( L );
}
void IPreference::SetFromStack( lua_State *L )
{
if( LOG )
LOG->Trace( "The preference value \"%s\" is of a type not supported by Lua", m_sName.c_str() );
lua_pop( L, 1 );
}
#define READFROM_AND_WRITETO( type ) \
void Preference<type>::FromString( const CString &s ) \
{ \
@@ -44,6 +52,10 @@ void IPreference::PushValue( lua_State *L ) const
void Preference<type>::PushValue( lua_State *L ) const \
{ \
LuaManager::PushStack( m_currentValue, L ); \
} \
void Preference<type>::SetFromStack( lua_State *L ) \
{ \
LuaManager::PopStack( m_currentValue, L ); \
}
READFROM_AND_WRITETO( int )
+2
View File
@@ -29,6 +29,7 @@ public:
virtual CString ToString() const = 0;
virtual void FromString( const CString &s ) = 0;
virtual void SetFromStack( lua_State *L );
virtual void PushValue( lua_State *L ) const;
PrefsGroup GetPrefsGroup() const { return m_PrefsGroup; }
@@ -59,6 +60,7 @@ public:
CString ToString() const;
void FromString( const CString &s );
void SetFromStack( lua_State *L );
void PushValue( lua_State *L ) const;
void LoadDefault()