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

Method SetJsonValue

src/ChunkReader.cpp:284–303  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

282
283// Load Json::Value into this object
284void ChunkReader::SetJsonValue(const Json::Value root) {
285
286 // Set parent data
287 ReaderBase::SetJsonValue(root);
288
289 // Set data from Json (if key is found)
290 if (!root["path"].isNull())
291 path = root["path"].asString();
292 if (!root["chunk_size"].isNull())
293 chunk_size = std::stoll(root["chunk_size"].asString());
294 if (!root["chunk_version"].isNull())
295 version = (ChunkVersion) root["chunk_version"].asInt();
296
297 // Re-Open path, and re-init everything (if needed)
298 if (is_open)
299 {
300 Close();
301 Open();
302 }
303}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected