MCPcopy Create free account
hub / github.com/Tencent/UnLua / ArrayValue

Function ArrayValue

Plugins/UnLuaExtensions/LuaRapidjson/Source/src/values.cpp:90–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 Value ArrayValue(lua_State* L, int idx, int depth, Allocator& allocator)
91 {
92 Value array(rapidjson::kArrayType);
93 int MAX = static_cast<int>(luax::rawlen(L, idx)); // luax::rawlen always returns size_t (>= 0)
94 for (int n = 1; n <= MAX; ++n)
95 {
96 lua_rawgeti(L, idx, n); // [table, element]
97 array.PushBack(toValue(L, -1, depth, allocator), allocator);
98 lua_pop(L, 1); // [table]
99 }
100 // [table]
101
102 return array;
103 }
104 }
105
106}

Callers 1

TableValueFunction · 0.85

Calls 4

rawlenFunction · 0.85
lua_rawgetiFunction · 0.85
toValueFunction · 0.70
PushBackMethod · 0.45

Tested by

no test coverage detected