Load JSON string into this object
| 993 | |
| 994 | // Load JSON string into this object |
| 995 | void Clip::SetJson(const std::string value) { |
| 996 | |
| 997 | // Parse JSON string into JSON objects |
| 998 | try |
| 999 | { |
| 1000 | const Json::Value root = openshot::stringToJson(value); |
| 1001 | // Set all values that match |
| 1002 | SetJsonValue(root); |
| 1003 | } |
| 1004 | catch (const std::exception& e) |
| 1005 | { |
| 1006 | // Error parsing JSON (or missing keys) |
| 1007 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 1008 | } |
| 1009 | } |
| 1010 | |
| 1011 | // Load Json::Value into this object |
| 1012 | void Clip::SetJsonValue(const Json::Value root) { |
no test coverage detected