MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJson

Method SetJson

src/Color.cpp:100–114  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

98
99// Load JSON string into this object
100void Color::SetJson(const std::string value) {
101
102 // Parse JSON string into JSON objects
103 try
104 {
105 const Json::Value root = openshot::stringToJson(value);
106 // Set all values that match
107 SetJsonValue(root);
108 }
109 catch (const std::exception& e)
110 {
111 // Error parsing JSON (or missing keys)
112 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
113 }
114}
115
116// Load Json::Value into this object
117void Color::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected