MCPcopy Create free account
hub / github.com/Kitware/CMake / object

Method object

Utilities/cmcppdap/src/jsoncpp_json_serializer.cpp:246–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool JsonCppSerializer::object(
247 const std::function<bool(dap::FieldSerializer*)>& cb) {
248 struct FS : public FieldSerializer {
249 Json::Value* const json;
250
251 FS(Json::Value* json) : json(json) {}
252 bool field(const std::string& name, const SerializeFunc& cb) override {
253 JsonCppSerializer s(&(*json)[name]);
254 auto res = cb(&s);
255 if (s.removed) {
256 json->removeMember(name);
257 }
258 return res;
259 }
260 };
261
262 *json = Json::Value(Json::objectValue);
263 FS fs{json};
264 return cb(&fs);
265}
266
267void JsonCppSerializer::remove() {
268 removed = true;

Callers

nothing calls this directly

Calls 1

ValueFunction · 0.50

Tested by

no test coverage detected