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

Method JsonValue

src/CacheDisk.cpp:424–448  ·  view source on GitHub ↗

Generate Json::Value for this object

Source from the content-addressed store, hash-verified

422
423// Generate Json::Value for this object
424Json::Value CacheDisk::JsonValue() {
425
426 // Process range data (if anything has changed)
427 CalculateRanges();
428
429 // Create root json object
430 Json::Value root = CacheBase::JsonValue(); // get parent properties
431 root["type"] = cache_type;
432 root["path"] = path.path().toStdString();
433
434 Json::Value version;
435 std::stringstream range_version_str;
436 range_version_str << range_version;
437 root["version"] = range_version_str.str();
438
439 // Parse and append range data (if any)
440 // Parse and append range data (if any)
441 try {
442 const Json::Value ranges = openshot::stringToJson(json_ranges);
443 root["ranges"] = ranges;
444 } catch (...) { }
445
446 // return JsonValue
447 return root;
448}
449
450// Load JSON string into this object
451void CacheDisk::SetJson(const std::string value) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected