Load JSON string into this object
| 449 | |
| 450 | // Load JSON string into this object |
| 451 | void CacheDisk::SetJson(const std::string value) { |
| 452 | |
| 453 | // Parse JSON string into JSON objects |
| 454 | try |
| 455 | { |
| 456 | const Json::Value root = openshot::stringToJson(value); |
| 457 | // Set all values that match |
| 458 | SetJsonValue(root); |
| 459 | } |
| 460 | catch (const std::exception& e) |
| 461 | { |
| 462 | // Error parsing JSON (or missing keys) |
| 463 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | // Load Json::Value into this object |
| 468 | void CacheDisk::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected