Load JSON string into this object
| 219 | |
| 220 | // Load JSON string into this object |
| 221 | void QtTextReader::SetJson(const std::string value) { |
| 222 | |
| 223 | // Parse JSON string into JSON objects |
| 224 | try |
| 225 | { |
| 226 | const Json::Value root = openshot::stringToJson(value); |
| 227 | // Set all values that match |
| 228 | SetJsonValue(root); |
| 229 | } |
| 230 | catch (const std::exception& e) |
| 231 | { |
| 232 | // Error parsing JSON (or missing keys) |
| 233 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | // Load Json::Value into this object |
| 238 | void QtTextReader::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected