| 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 | } |
no test coverage detected