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

Method saveConfig

plugins/debug.cpp:464–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464command_result FilterManager::saveConfig(DFHack::color_ostream& out) const noexcept
465{
466 try {
467 DEBUG(command, out) << "Save config to '" << configPath << "'" << std::endl;
468 JsonArchive archive;
469 save(archive);
470 std::ofstream ofs(configPath);
471 if (!ofs.good())
472 throw std::runtime_error{"Failed to open configuration file for writing"};
473 ofs << archive;
474 } catch(std::exception & e) {
475 ERR(command, out) << "Serializing filters to '" << configPath << "' failed: "
476 << e.what() << std::endl;
477 return CR_FAILURE;
478 }
479 return CR_OK;
480}
481
482void FilterManager::connectTo(DebugManager::categorySignal_t& signal) noexcept
483{

Callers 4

setFilterFunction · 0.80
disableFilterFunction · 0.80
enableFilterFunction · 0.80
unsetFilterFunction · 0.80

Calls 2

saveFunction · 0.85
whatMethod · 0.45

Tested by

no test coverage detected