5 #ifndef BITCOIN_UTIL_SETTINGS_H 6 #define BITCOIN_UTIL_SETTINGS_H 40 std::map<std::string, std::map<std::string, std::vector<SettingsValue>>>
46 std::map<std::string, SettingsValue> &values,
47 std::vector<std::string> &errors);
51 const std::map<std::string, SettingsValue> &values,
52 std::vector<std::string> &errors);
63 const std::string &
name,
64 bool ignore_default_section_config,
70 const std::string §ion,
71 const std::string &
name,
72 bool ignore_default_section_config);
80 const std::string §ion,
81 const std::string &
name);
91 : data(dataIn), size(sizeIn) {}
92 explicit SettingsSpan(
const std::vector<SettingsValue> &vec) noexcept;
100 bool last_negated()
const;
102 size_t negated()
const;
109 template <
typename Map,
typename Key>
110 auto FindKey(Map &&map, Key &&key) -> decltype(&map.at(key)) {
111 auto it = map.find(key);
112 return it == map.end() ? nullptr : &it->second;
117 #endif // BITCOIN_UTIL_SETTINGS_H std::map< std::string, SettingsValue > rw_settings
Map of setting name to read-write file setting value.
bool OnlyHasDefaultSectionSetting(const Settings &settings, const std::string §ion, const std::string &name)
Return true if a setting is set in the default config file section, and not overridden by a higher pr...
SettingsValue GetSetting(const Settings &settings, const std::string §ion, const std::string &name, bool ignore_default_section_config, bool get_chain_name)
Get settings value from combined sources: forced settings, command line arguments, runtime read-write settings, and the read-only config file.
auto FindKey(Map &&map, Key &&key) -> decltype(&map.at(key))
Map lookup helper.
std::vector< SettingsValue > GetSettingsList(const Settings &settings, const std::string §ion, const std::string &name, bool ignore_default_section_config)
Get combined setting value similar to GetSetting(), except if setting was specified multiple times...
bool WriteSettings(const fs::path &path, const std::map< std::string, SettingsValue > &values, std::vector< std::string > &errors)
Write settings file.
std::map< std::string, std::vector< SettingsValue > > command_line_options
Map of setting name to list of command line values.
Accessor for list of settings that skips negated values when iterated over.
std::map< std::string, std::map< std::string, std::vector< SettingsValue > > > ro_config
Map of config section name and setting name to list of config file values.
SettingsSpan(const SettingsValue &value) noexcept
SettingsSpan(const SettingsValue *dataIn, size_t sizeIn) noexcept
std::map< std::string, SettingsValue > forced_settings
Map of setting name to forced setting value.
bool ReadSettings(const fs::path &path, std::map< std::string, SettingsValue > &values, std::vector< std::string > &errors)
Read settings file.