Load JSON string into this object
| 655 | |
| 656 | // Load JSON string into this object |
| 657 | void ChromaKey::SetJson(const std::string value) { |
| 658 | |
| 659 | // Parse JSON string into JSON objects |
| 660 | try |
| 661 | { |
| 662 | const Json::Value root = openshot::stringToJson(value); |
| 663 | // Set all values that match |
| 664 | SetJsonValue(root); |
| 665 | } |
| 666 | catch (const std::exception& e) |
| 667 | { |
| 668 | // Error parsing JSON (or missing keys) |
| 669 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | // Load Json::Value into this object |
| 674 | void ChromaKey::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected