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

Method SetJson

src/KeyFrame.cpp:355–369  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

353
354// Load JSON string into this object
355void Keyframe::SetJson(const std::string value) {
356
357 // Parse JSON string into JSON objects
358 try
359 {
360 const Json::Value root = openshot::stringToJson(value);
361 // Set all values that match
362 SetJsonValue(root);
363 }
364 catch (const std::exception& e)
365 {
366 // Error parsing JSON (or missing keys)
367 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
368 }
369}
370
371// Load Json::Value into this object
372void Keyframe::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected