Load JSON string into this object
| 389 | |
| 390 | // Load JSON string into this object |
| 391 | void CVTracker::SetJson(const std::string value) { |
| 392 | // Parse JSON string into JSON objects |
| 393 | try |
| 394 | { |
| 395 | const Json::Value root = openshot::stringToJson(value); |
| 396 | // Set all values that match |
| 397 | |
| 398 | SetJsonValue(root); |
| 399 | } |
| 400 | catch (const std::exception& e) |
| 401 | { |
| 402 | // Error parsing JSON (or missing keys) |
| 403 | throw openshot::InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | // Load Json::Value into this object |
| 408 | void CVTracker::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected