| 144 | } |
| 145 | |
| 146 | Json::Value JsonCppDeserializer::parse(const std::string& text) { |
| 147 | Json::CharReaderBuilder builder; |
| 148 | auto jsonReader = std::unique_ptr<Json::CharReader>(builder.newCharReader()); |
| 149 | Json::Value json; |
| 150 | std::string error; |
| 151 | if (!jsonReader->parse(text.data(), text.data() + text.size(), &json, |
| 152 | &error)) { |
| 153 | // cppdap expects that the JSON layer does not throw exceptions. |
| 154 | std::abort(); |
| 155 | } |
| 156 | return json; |
| 157 | } |
| 158 | |
| 159 | JsonCppSerializer::JsonCppSerializer() |
| 160 | : json(new Json::Value()), ownsJson(true) {} |
nothing calls this directly
no test coverage detected