Changeset 51
- Timestamp:
- 05/29/13 07:26:37 (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r9 r51 7 7 #include "nv/lua/lua_state.hh" 8 8 9 #include "nv/l ib/lua.hh"9 #include "nv/lua/lua_raw.hh" 10 10 #include "nv/logging.hh" 11 11 #include "nv/string.hh" 12 12 13 13 using namespace nv; 14 15 // The following should be moved to lua_raw16 17 std::string lua_typecontent( lua_State* L, int idx )18 {19 switch ( lua_type( L, idx ) )20 {21 case LUA_TNONE : return "NONE";22 case LUA_TNIL : return "NIL";23 case LUA_TBOOLEAN : return lua_toboolean( L, idx ) == 0 ? "false" : "true";24 case LUA_TLIGHTUSERDATA : return nv::to_string( uint64( lua_touserdata( L, idx ) ) );25 case LUA_TNUMBER : return nv::to_string( lua_tonumber( L, idx ) );26 case LUA_TSTRING : return lua_tostring( L, idx );27 case LUA_TTABLE : return "TABLE";28 case LUA_TFUNCTION : return "FUNCTION";29 case LUA_TUSERDATA : return nv::to_string( uint64( lua_touserdata( L, idx ) ) );30 case LUA_TTHREAD : return "THREAD";31 default : return "UNKNOWN!";32 }33 }34 35 // -----36 14 37 15 lua::stack_guard::stack_guard( lua::state* L ) … … 297 275 for ( int i = 0; i < top; ++i ) 298 276 { 299 NV_LOG( LOG_DEBUG, "#" << i+1 << " - " << lua_typename(L, i+1) << " = " << lua_typecontent(L, i+1) );277 NV_LOG( LOG_DEBUG, "#" << i+1 << " - " << lua_typename(L, i+1) << " = " << nlua_typecontent(L, i+1) ); 300 278 } 301 279 }
Note: See TracChangeset
for help on using the changeset viewer.