Load JSON string into this object
| 340 | |
| 341 | // Load JSON string into this object |
| 342 | void ObjectDetection::SetJson(const std::string value) { |
| 343 | |
| 344 | // Parse JSON string into JSON objects |
| 345 | try |
| 346 | { |
| 347 | const Json::Value root = openshot::stringToJson(value); |
| 348 | // Set all values that match |
| 349 | SetJsonValue(root); |
| 350 | } |
| 351 | catch (const std::exception& e) |
| 352 | { |
| 353 | // Error parsing JSON (or missing keys) |
| 354 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | // Load Json::Value into this object |
| 359 | void ObjectDetection::SetJsonValue(const Json::Value root) |
nothing calls this directly
no test coverage detected