Load JSON string into this object
| 405 | |
| 406 | // Load JSON string into this object |
| 407 | void Caption::SetJson(const std::string value) { |
| 408 | |
| 409 | // Parse JSON string into JSON objects |
| 410 | try |
| 411 | { |
| 412 | const Json::Value root = openshot::stringToJson(value); |
| 413 | // Set all values that match |
| 414 | SetJsonValue(root); |
| 415 | } |
| 416 | catch (const std::exception& e) |
| 417 | { |
| 418 | // Error parsing JSON (or missing keys) |
| 419 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | // Load Json::Value into this object |
| 424 | void Caption::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected