Ignore:
Timestamp:
05/29/13 07:26:37 (12 years ago)
Author:
epyon
Message:
  • lua_raw module added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_state.cc

    r9 r51  
    77#include "nv/lua/lua_state.hh"
    88
    9 #include "nv/lib/lua.hh"
     9#include "nv/lua/lua_raw.hh"
    1010#include "nv/logging.hh"
    1111#include "nv/string.hh"
    1212
    1313using namespace nv;
    14 
    15 // The following should be moved to lua_raw
    16 
    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 // -----
    3614
    3715lua::stack_guard::stack_guard( lua::state* L )
     
    297275        for ( int i = 0; i < top; ++i )
    298276        {
    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) );
    300278        }
    301279}
Note: See TracChangeset for help on using the changeset viewer.