You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
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:
@@ -366,8 +366,12 @@ void Keyframe::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)", "");
|
||||
|
||||
Reference in New Issue
Block a user