Remove Json:Reader

`Json::Reader` has been deprecated for some time, so we replace it with
`Json::CharReader` generated by a `Json::CharReaderBuilder`, or (in the
one instance where we have a stream as input) `Json::parseFromStream();`
This commit is contained in:
FeRD (Frank Dana)
2019-06-19 21:20:04 -04:00
parent 0d4ea7fe71
commit 744a4f3ec1
34 changed files with 233 additions and 81 deletions

View File

@@ -201,8 +201,12 @@ void TextReader::SetJson(string value) {
// Parse JSON string into JSON objects
Json::Value root;
Json::Reader reader;
bool success = reader.parse( value, root );
Json::CharReaderBuilder rbuilder;
Json::CharReader* reader(rbuilder.newCharReader());
string errors;
bool success = reader->parse( value.c_str(),
value.c_str() + value.size(), &root, &errors );
if (!success)
// Raise exception
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");