LuaTable LuaTable::create(lua_State* state) { LuaTable table; lua_newtable(state); table.setReference(UniqueLuaReference::create(state)); lua_pop(state, 1); return table; }
bool convert::popValue(lua_State* luaState, LuaTable& target, int stackposition, bool remove) { if (!internal::isValidIndex(luaState, stackposition)) { return false; } if (!lua_istable(luaState, stackposition)) { return false; } else { target.setReference(UniqueLuaReference::create(luaState, stackposition)); if (remove) { lua_remove(luaState, stackposition); } return true; } }