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

Method WriteSettingsFile

src/util/system.cpp:560–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560bool ArgsManager::WriteSettingsFile(std::vector<std::string>* errors) const
561{
562 fs::path path, path_tmp;
563 if (!GetSettingsPath(&path, /* temp= */ false) || !GetSettingsPath(&path_tmp, /* temp= */ true)) {
564 throw std::logic_error("Attempt to write settings file when dynamic settings are disabled.");
565 }
566
567 LOCK(cs_args);
568 std::vector<std::string> write_errors;
569 if (!util::WriteSettings(path_tmp, m_settings.rw_settings, write_errors)) {
570 SaveErrors(write_errors, errors);
571 return false;
572 }
573 if (!RenameOver(path_tmp, path)) {
574 SaveErrors({strprintf("Failed renaming settings file %s to %s\n", fs::PathToString(path_tmp), fs::PathToString(path))}, errors);
575 return false;
576 }
577 return true;
578}
579
580bool ArgsManager::IsArgNegated(const std::string& strArg) const
581{

Callers 4

BOOST_AUTO_TEST_CASEFunction · 0.80
InitSettingsFunction · 0.80
optionTestsMethod · 0.80
updateRwSettingMethod · 0.80

Calls 4

WriteSettingsFunction · 0.85
SaveErrorsFunction · 0.85
RenameOverFunction · 0.85
PathToStringFunction · 0.85

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
optionTestsMethod · 0.64