MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / OnlyHasDefaultSectionSetting

Function OnlyHasDefaultSectionSetting

src/common/settings.cpp:256–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256bool OnlyHasDefaultSectionSetting(const Settings& settings, const std::string& section, const std::string& name)
257{
258 bool has_default_section_setting = false;
259 bool has_other_setting = false;
260 MergeSettings(settings, section, name, [&](SettingsSpan span, Source source) {
261 if (span.empty()) return;
262 else if (source == Source::CONFIG_FILE_DEFAULT_SECTION) has_default_section_setting = true;
263 else has_other_setting = true;
264 });
265 // If a value is set in the default section and not explicitly overwritten by the
266 // user on the command line or in a different section, then we want to enable
267 // warnings about the value being ignored.
268 return has_default_section_setting && !has_other_setting;
269}
270
271SettingsSpan::SettingsSpan(const std::vector<SettingsValue>& vec) noexcept : SettingsSpan(vec.data(), vec.size()) {}
272const SettingsValue* SettingsSpan::begin() const { return data + negated(); }

Callers 3

BOOST_FIXTURE_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 2

MergeSettingsFunction · 0.85
emptyMethod · 0.45

Tested by 2

BOOST_FIXTURE_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68