Changeset 181 for trunk/src/lua
- Timestamp:
- 07/30/13 04:44:15 (12 years ago)
- Location:
- trunk/src/lua
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r163 r181 198 198 } 199 199 200 lua::table_guard::table_guard( lua::state* lstate, const std::string& table, bool global )200 lua::table_guard::table_guard( lua::state* lstate, const path& p, bool global ) 201 201 : L(lstate), m_guard(lstate) 202 202 { 203 L->push( table, global ); 204 } 205 206 lua::table_guard::table_guard( lua::state* lstate, const std::string& table, int index, bool global ) 207 : L(lstate), m_guard(lstate) 208 { 209 L->push( table, global ); 210 lua_rawgeti( L->L, -1, index ); 211 } 212 213 lua::table_guard::table_guard( lua::state* lstate, const std::string& table, const std::string& index, bool global /*= true */ ) 214 : L(lstate), m_guard(lstate) 215 { 216 L->push( table, global ); 217 lua_pushstring( L->L, index.c_str() ); 218 lua_rawget( L->L, -2 ); 219 } 220 221 lua::table_guard::table_guard( const table_guard& parent, const std::string& index ) 203 if ( !p.resolve( L->get_raw(), global ) ) 204 { 205 // TODO : error handling 206 } 207 } 208 209 lua::table_guard::table_guard( const table_guard& parent, const path& p ) 222 210 : L( parent.L ), m_guard( parent.L ) 223 211 { 224 lua_getfield( L->L, -1, index.c_str() ); 225 } 226 227 lua::table_guard::table_guard( const table_guard& parent, int index ) 228 : L( parent.L ), m_guard( parent.L ) 229 { 230 lua_rawgeti( L->L, -1, index ); 212 if ( !p.resolve( L->get_raw(), false ) ) 213 { 214 // TODO : error handling 215 } 231 216 } 232 217
Note: See TracChangeset
for help on using the changeset viewer.