Bitcoin ABC 0.26.3
P2P Digital Currency
|
Classes | |
struct | Error |
class | Result |
struct | Settings |
Stored settings. More... | |
struct | SettingsSpan |
Accessor for list of settings that skips negated values when iterated over. More... | |
Typedefs | |
using | SettingsValue = UniValue |
Settings value type (string/integer/boolean/null variant). | |
Functions | |
template<typename T > | |
T * | AnyPtr (const std::any &any) noexcept |
Helper function to access the contained object of a std::any instance. | |
template<typename Tdst , typename Tsrc > | |
void | insert (Tdst &dst, const Tsrc &src) |
Simplification of std insertion. | |
template<typename TsetT , typename Tsrc > | |
void | insert (std::set< TsetT > &dst, const Tsrc &src) |
template<typename T > | |
bilingual_str | ErrorString (const Result< T > &result) |
bool | ReadSettings (const fs::path &path, std::map< std::string, SettingsValue > &values, std::vector< std::string > &errors) |
Read settings file. | |
bool | WriteSettings (const fs::path &path, const std::map< std::string, SettingsValue > &values, std::vector< std::string > &errors) |
Write settings file. | |
SettingsValue | GetSetting (const Settings &settings, const std::string §ion, const std::string &name, bool ignore_default_section_config, bool ignore_nonpersistent, 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. | |
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, return a list of all the values specified. | |
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 priority command-line or network section value. | |
template<typename Map , typename Key > | |
auto | FindKey (Map &&map, Key &&key) -> decltype(&map.at(key)) |
Map lookup helper. | |
void | TraceThread (const char *thread_name, std::function< void()> thread_func) |
A wrapper for do-something-once thread functions. | |
void | ThreadRename (std::string &&) |
Rename a thread both in terms of an internal (in-memory) name as well as its system thread name. | |
void | ThreadSetInternalName (std::string &&) |
Set the internal (in-memory) name of the current thread only. | |
const std::string & | ThreadGetInternalName () |
Get the thread's internal (in-memory) name; used e.g. | |
Settings value type (string/integer/boolean/null variant).
Definition at line 27 of file settings.h.
|
noexcept |
bilingual_str util::ErrorString | ( | const Result< T > & | result | ) |
Map lookup helper.
Definition at line 115 of file settings.h.
SettingsValue util::GetSetting | ( | const Settings & | settings, |
const std::string & | section, | ||
const std::string & | name, | ||
bool | ignore_default_section_config, | ||
bool | ignore_nonpersistent, | ||
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.
ignore_default_section_config | - ignore values in the default section of the config file (part before any [section] keywords) |
ignore_nonpersistent | - ignore non-persistent settings values (forced settings values and values specified on the command line). Only return settings in the read-only config and read-write settings files. |
get_chain_name | - enable special backwards compatible behavior for GetChainName |
Definition at line 142 of file settings.cpp.
std::vector< SettingsValue > util::GetSettingsList | ( | const Settings & | settings, |
const std::string & | section, | ||
const std::string & | name, | ||
bool | ignore_default_section_config | ||
) |
Get combined setting value similar to GetSetting(), except if setting was specified multiple times, return a list of all the values specified.
Definition at line 209 of file settings.cpp.
bool util::OnlyHasDefaultSectionSetting | ( | const Settings & | settings, |
const std::string & | section, | ||
const std::string & | name | ||
) |
Return true if a setting is set in the default config file section, and not overridden by a higher priority command-line or network section value.
This is used to provide user warnings about values that might be getting ignored unintentionally.
Definition at line 261 of file settings.cpp.
bool util::ReadSettings | ( | const fs::path & | path, |
std::map< std::string, SettingsValue > & | values, | ||
std::vector< std::string > & | errors | ||
) |
Read settings file.
Definition at line 67 of file settings.cpp.
const std::string & util::ThreadGetInternalName | ( | ) |
Get the thread's internal (in-memory) name; used e.g.
for identification in logging.
Definition at line 39 of file threadnames.cpp.
void util::ThreadRename | ( | std::string && | name | ) |
Rename a thread both in terms of an internal (in-memory) name as well as its system thread name.
Definition at line 48 of file threadnames.cpp.
void util::ThreadSetInternalName | ( | std::string && | name | ) |
Set the internal (in-memory) name of the current thread only.
Definition at line 53 of file threadnames.cpp.
A wrapper for do-something-once thread functions.
Definition at line 13 of file thread.cpp.
bool util::WriteSettings | ( | const fs::path & | path, |
const std::map< std::string, SettingsValue > & | values, | ||
std::vector< std::string > & | errors | ||
) |
Write settings file.
Definition at line 122 of file settings.cpp.