Load JSON string into this object
| 112 | |
| 113 | // Load JSON string into this object |
| 114 | void Whisperization::SetJson(const std::string value) { |
| 115 | |
| 116 | // Parse JSON string into JSON objects |
| 117 | try |
| 118 | { |
| 119 | const Json::Value root = openshot::stringToJson(value); |
| 120 | // Set all values that match |
| 121 | SetJsonValue(root); |
| 122 | } |
| 123 | catch (const std::exception& e) |
| 124 | { |
| 125 | // Error parsing JSON (or missing keys) |
| 126 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | // Load Json::Value into this object |
| 131 | void Whisperization::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected