Generate Json::Value for this object
| 422 | |
| 423 | // Generate Json::Value for this object |
| 424 | Json::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 |
| 451 | void CacheDisk::SetJson(const std::string value) { |
nothing calls this directly
no outgoing calls
no test coverage detected