| 130 | } |
| 131 | |
| 132 | bool NlohmannDeserializer::field( |
| 133 | const std::string& name, |
| 134 | const std::function<bool(dap::Deserializer*)>& cb) const { |
| 135 | if (!json->is_structured()) { |
| 136 | return false; |
| 137 | } |
| 138 | auto it = json->find(name); |
| 139 | if (it == json->end()) { |
| 140 | return cb(&NullDeserializer::instance); |
| 141 | } |
| 142 | auto obj = *it; |
| 143 | NlohmannDeserializer d(&obj); |
| 144 | return cb(&d); |
| 145 | } |
| 146 | |
| 147 | NlohmannSerializer::NlohmannSerializer() |
| 148 | : json(new nlohmann::json()), ownsJson(true) {} |