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