Load JSON string into this object
| 154 | |
| 155 | // Load JSON string into this object |
| 156 | void Pixelate::SetJson(const std::string value) { |
| 157 | |
| 158 | // Parse JSON string into JSON objects |
| 159 | try |
| 160 | { |
| 161 | const Json::Value root = openshot::stringToJson(value); |
| 162 | // Set all values that match |
| 163 | SetJsonValue(root); |
| 164 | } |
| 165 | catch (const std::exception& e) |
| 166 | { |
| 167 | // Error parsing JSON (or missing keys) |
| 168 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | // Load Json::Value into this object |
| 173 | void Pixelate::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected