Extract all values of the objects in queue and replace the contents of queue with them
| 196 | |
| 197 | // Extract all values of the objects in queue and replace the contents of queue with them |
| 198 | static void ExtractValues(JsonUdfValue* queue, JsonUdfAllocator* allocator) { |
| 199 | SizeType old_items = queue->Size(); |
| 200 | for (SizeType i = 0; i < old_items; ++i) { |
| 201 | if (!(*queue)[i].IsObject()) continue; |
| 202 | for (auto& m : (*queue)[i].GetObject()) queue->PushBack(m.value, *allocator); |
| 203 | } |
| 204 | queue->Erase(queue->Begin(), queue->Begin() + old_items); |
| 205 | } |
| 206 | |
| 207 | /// Process wildcard(*) in value selection. path_idx is the index after the wildcard in |
| 208 | /// path_str. Return next unprocessed index in path_str. Return -1 for errors. |