Changeset 358 for trunk/src/lua/lua_values.cc
- Timestamp:
- 04/29/15 14:53:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_values.cc
r319 r358 75 75 } 76 76 77 void nv::lua::detail::push_string_ref( lua_State *L, string_ref s ) 78 { 79 lua_pushlstring( L, s.data(), s.size() ); 80 } 81 77 82 void nv::lua::detail::push_pointer ( lua_State *L, void* p ) 78 83 { … … 108 113 std::string nv::lua::detail::to_string ( lua_State *L, int index ) 109 114 { 110 return lua_tostring( L, index ); 115 size_t length = 0; 116 const char* result = lua_tolstring( L, index, &length ); 117 return std::string( result, length ); 111 118 } 112 119 113 120 const char* nv::lua::detail::to_cstring ( lua_State *L, int index ) 114 121 { 115 return lua_tostring( L, index ); 122 return lua_tolstring( L, index, nullptr ); 123 } 124 125 nv::string_ref nv::lua::detail::to_string_ref( lua_State *L, int index ) 126 { 127 size_t length = 0; 128 const char* result = lua_tolstring( L, index, &length ); 129 return string_ref( result, length ); 116 130 } 117 131
Note: See TracChangeset
for help on using the changeset viewer.