| 907 | } |
| 908 | |
| 909 | Json::Value ReadJson(std::string const& jsonstr) |
| 910 | { |
| 911 | Json::CharReaderBuilder builder; |
| 912 | builder["collectComments"] = false; |
| 913 | auto jsonReader = std::unique_ptr<Json::CharReader>(builder.newCharReader()); |
| 914 | Json::Value json; |
| 915 | std::string error; |
| 916 | if (!jsonReader->parse(jsonstr.data(), jsonstr.data() + jsonstr.size(), |
| 917 | &json, &error)) { |
| 918 | throw json_error( |
| 919 | cmStrCat("failed parsing json string:\n"_s, jsonstr, '\n', error)); |
| 920 | } |
| 921 | return json; |
| 922 | } |
| 923 | std::string WriteJson(Json::Value const& value) |
| 924 | { |
| 925 | Json::StreamWriterBuilder writer; |
no test coverage detected
searching dependent graphs…