Generate Json::Value for this object
| 276 | |
| 277 | // Generate Json::Value for this object |
| 278 | Json::Value CacheMemory::JsonValue() { |
| 279 | |
| 280 | // Process range data (if anything has changed) |
| 281 | CalculateRanges(); |
| 282 | |
| 283 | // Create root json object |
| 284 | Json::Value root = CacheBase::JsonValue(); // get parent properties |
| 285 | root["type"] = cache_type; |
| 286 | |
| 287 | root["version"] = std::to_string(range_version); |
| 288 | |
| 289 | // Parse and append range data (if any) |
| 290 | try { |
| 291 | const Json::Value ranges = openshot::stringToJson(json_ranges); |
| 292 | root["ranges"] = ranges; |
| 293 | } catch (...) { } |
| 294 | |
| 295 | // return JsonValue |
| 296 | return root; |
| 297 | } |
| 298 | |
| 299 | // Load JSON string into this object |
| 300 | void CacheMemory::SetJson(const std::string value) { |
nothing calls this directly
no outgoing calls
no test coverage detected