Changeset 296 for trunk/src/lua/lua_state.cc
- Timestamp:
- 07/31/14 08:08:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r288 r296 209 209 return result; 210 210 } 211 212 bool nv::lua::table_guard::is_table( const std::string& element ) 213 { 214 lua_getfield( m_state, -1, element.c_str() ); 215 bool result = lua_type( m_state, -1 ) == LUA_TTABLE; 216 lua_pop( m_state, 1 ); 217 return result; 218 } 219 220 bool nv::lua::table_guard::is_number( const std::string& element ) 221 { 222 lua_getfield( m_state, -1, element.c_str() ); 223 bool result = lua_type( m_state, -1 ) == LUA_TNUMBER; 224 lua_pop( m_state, 1 ); 225 return result; 226 } 227 228 bool nv::lua::table_guard::is_boolean( const std::string& element ) 229 { 230 lua_getfield( m_state, -1, element.c_str() ); 231 bool result = lua_type( m_state, -1 ) == LUA_TBOOLEAN; 232 lua_pop( m_state, 1 ); 233 return result; 234 } 235 236 bool nv::lua::table_guard::is_string( const std::string& element ) 237 { 238 lua_getfield( m_state, -1, element.c_str() ); 239 bool result = lua_type( m_state, -1 ) == LUA_TSTRING; 240 lua_pop( m_state, 1 ); 241 return result; 242 } 243 211 244 212 245 // state
Note: See TracChangeset
for help on using the changeset viewer.