Changeset 440 for trunk/src/lua/lua_values.cc
- Timestamp:
- 07/23/15 21:16:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_values.cc
r399 r440 65 65 } 66 66 67 void nv::lua::detail::push_string ( lua_State *L, const std::string& s )68 {69 lua_pushlstring( L, s.c_str(), s.size() );70 }71 72 67 void nv::lua::detail::push_cstring ( lua_State *L, const char* s ) 73 68 { … … 109 104 { 110 105 return lua_toboolean( L, index ) != 0; 111 }112 113 std::string nv::lua::detail::to_string ( lua_State *L, int index )114 {115 size_t length = 0;116 const char* result = lua_tolstring( L, index, &length );117 return std::string( result, length );118 106 } 119 107 … … 171 159 } 172 160 173 std::string nv::lua::detail::to_string ( lua_State *L, int index, const std::string&def )161 nv::string_view nv::lua::detail::to_string_view( lua_State *L, int index, string_view def ) 174 162 { 175 return ( lua_type( L, index ) == LUA_TSTRING ? lua_tostring( L, index ) : def );163 return ( lua_type( L, index ) == LUA_TSTRING ? nlua_tostringview( L, index ) : def ); 176 164 } 177 165
Note: See TracChangeset
for help on using the changeset viewer.