Changeset 437 for trunk/nv/lua/lua_raw.hh
- Timestamp:
- 07/23/15 08:30:41 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_raw.hh
r395 r437 11 11 #include <nv/stl/vector.hh> 12 12 #include <nv/lib/lua.hh> 13 #include < string>13 #include <nv/stl/string.hh> 14 14 15 15 void nlua_toflags_set( lua_State *L, int index, nv::uint8* data, nv::uint32 count ); … … 17 17 void nlua_toflags( lua_State *L, int index, nv::uint8* data, nv::uint32 count ); 18 18 19 std::string nlua_typecontent( lua_State* L, int idx ); 19 inline nv::string_view nlua_tostringview( lua_State* L, int idx ) 20 { 21 size_t len; 22 const char* str = lua_tolstring( L, idx, &len ); 23 return nv::string_view( str, len ); 24 } 25 26 inline void nlua_pushstringview( lua_State* L, const nv::string_view& str ) 27 { 28 lua_pushlstring( L, str.data(), str.size() ); 29 } 30 31 // TODO: this is not thread safe! 32 nv::string_view nlua_typecontent( lua_State* L, int idx ); 20 33 void nlua_shallowmerge( lua_State *L, int index ); 21 34 void nlua_shallowcopy( lua_State *L, int index ); … … 33 46 void nlua_register( lua_State *L, const char* lname, const luaL_Reg *l ); 34 47 48 49 35 50 #endif // NV_LUA_RAW_HH 36 51
Note: See TracChangeset
for help on using the changeset viewer.