MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReadSettingsFile

Method ReadSettingsFile

src/util/system.cpp:537–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537bool ArgsManager::ReadSettingsFile(std::vector<std::string>* errors)
538{
539 fs::path path;
540 if (!GetSettingsPath(&path, /* temp= */ false)) {
541 return true; // Do nothing if settings file disabled.
542 }
543
544 LOCK(cs_args);
545 m_settings.rw_settings.clear();
546 std::vector<std::string> read_errors;
547 if (!util::ReadSettings(path, m_settings.rw_settings, read_errors)) {
548 SaveErrors(read_errors, errors);
549 return false;
550 }
551 for (const auto& setting : m_settings.rw_settings) {
552 KeyInfo key = InterpretKey(setting.first); // Split setting key into section and argname
553 if (!GetArgFlags('-' + key.name)) {
554 LogPrintf("Ignoring unknown rw_settings value %s\n", setting.first);
555 }
556 }
557 return true;
558}
559
560bool ArgsManager::WriteSettingsFile(std::vector<std::string>* errors) const
561{

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.80
InitSettingsFunction · 0.80

Calls 4

ReadSettingsFunction · 0.85
SaveErrorsFunction · 0.85
InterpretKeyFunction · 0.85
clearMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64