MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / makeStruct

Method makeStruct

base/poco/JSON/src/Object.cpp:219–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217
218
219Poco::DynamicStruct Object::makeStruct(const Object::Ptr& obj)
220{
221 Poco::DynamicStruct ds;
222
223 ConstIterator it = obj->begin();
224 ConstIterator end = obj->end();
225 for (; it != end; ++it)
226 {
227 if (obj->isObject(it))
228 {
229 Object::Ptr pObj = obj->getObject(it->first);
230 DynamicStruct str = makeStruct(pObj);
231 ds.insert(it->first, str);
232 }
233 else if (obj->isArray(it))
234 {
235 Array::Ptr pArr = obj->getArray(it->first);
236 std::vector<Poco::Dynamic::Var> v = Poco::JSON::Array::makeArray(pArr);
237 ds.insert(it->first, v);
238 }
239 else
240 ds.insert(it->first, it->second);
241 }
242
243 return ds;
244}
245
246
247void Object::resetDynStruct() const

Callers

nothing calls this directly

Calls 7

beginMethod · 0.45
endMethod · 0.45
isObjectMethod · 0.45
getObjectMethod · 0.45
insertMethod · 0.45
isArrayMethod · 0.45
getArrayMethod · 0.45

Tested by

no test coverage detected