MCPcopy Create free account
hub / github.com/DFHack/dfhack / load

Method load

plugins/debug.cpp:389–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387 FilterManager& operator=(FilterManager&&) = delete;
388
389 void load(JsonArchive& ar)
390 {
391 Json::UInt version = -1;
392 ar >> serialization::make_nvp("configVersion", version);
393 if (version > configVersion) {
394 std::stringstream ss;
395 ss << "The saved config version ("
396 << version
397 << ") is newer than code supported version ("
398 << configVersion
399 << ")";
400 throw std::runtime_error{ss.str()};
401 }
402 ar >> NVP(nextId_);
403 JsonArchive& children = ar["filters"];
404 for (auto iter = children.begin(); iter != children.end(); ++iter) {
405 Filter child;
406 child.load(*iter, version);
407 std::stringstream ss(iter.name());
408 size_t id;
409 ss >> id;
410 insert(std::make_pair(id, child));
411 }
412 }
413
414 void save(JsonArchive& ar) const
415 {

Callers

nothing calls this directly

Calls 6

make_nvpFunction · 0.85
insertFunction · 0.85
strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected