![]() |
Bitcoin ABC 0.32.12
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... | |
| class | SignalInterrupt |
| Helper class that manages an interrupt flag, and allows a thread or signal to interrupt another thread. More... | |
Typedefs | |
| using | SettingsValue = UniValue |
| Settings value type (string/integer/boolean/null variant). More... | |
Enumerations | |
| enum class | LockResult { Success , ErrorWrite , ErrorLock } |
Functions | |
| template<typename T > | |
| T * | AnyPtr (const std::any &any) noexcept |
| Helper function to access the contained object of a std::any instance. More... | |
| LockResult | LockDirectory (const fs::path &directory, const std::string lockfile_name, bool probe_only) |
| template<typename Tdst , typename Tsrc > | |
| void | insert (Tdst &dst, const Tsrc &src) |
| Simplification of std insertion. More... | |
| 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. More... | |
| bool | WriteSettings (const fs::path &path, const std::map< std::string, SettingsValue > &values, std::vector< std::string > &errors) |
| Write settings file. More... | |
| SettingsValue | GetSetting (const Settings &settings, const std::string §ion, const std::string &name, bool ignore_default_section_config, bool ignore_nonpersistent, bool get_chain_type) |
| Get settings value from combined sources: forced settings, command line arguments, runtime read-write settings, and the read-only config file. More... | |
| 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. More... | |
| 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. More... | |
| template<typename Map , typename Key > | |
| auto | FindKey (Map &&map, Key &&key) -> decltype(&map.at(key)) |
| Map lookup helper. More... | |
| void | ReplaceAll (std::string &in_out, const std::string &search, const std::string &substitute) |
| template<typename T = Span<const char>> | |
| std::vector< T > | Split (const Span< const char > &sp, std::string_view separators) |
| Split a string on any char found in separators, returning a vector. More... | |
| template<typename T = Span<const char>> | |
| std::vector< T > | Split (const Span< const char > &sp, char sep) |
| Split a string on every instance of sep, returning a vector. More... | |
| std::vector< std::string > | SplitString (std::string_view str, char sep) |
| std::vector< std::string > | SplitString (std::string_view str, std::string_view separators) |
| std::string_view | TrimStringView (std::string_view str, std::string_view pattern=" \f\n\r\t\v") |
| std::string | TrimString (std::string_view str, std::string_view pattern=" \f\n\r\t\v") |
| std::string_view | RemovePrefixView (std::string_view str, std::string_view prefix) |
| std::string | RemovePrefix (std::string_view str, std::string_view prefix) |
| template<typename T , typename BaseType , typename UnaryOp > | |
| auto | Join (const std::vector< T > &list, const BaseType &separator, UnaryOp unary_op) -> decltype(unary_op(list.at(0))) |
| Join a list of items. More... | |
| template<typename T , typename T2 > | |
| T | Join (const std::vector< T > &list, const T2 &separator) |
| std::string | Join (const std::vector< std::string > &list, std::string_view separator) |
| std::string | MakeUnorderedList (const std::vector< std::string > &items) |
| Create an unordered multi-line list of items. More... | |
| bool | ContainsNoNUL (std::string_view str) noexcept |
| Check if a string does not contain any embedded NUL (\0) characters. More... | |
| template<typename T > | |
| std::string | ToString (const T &t) |
| Locale-independent version of std::to_string. More... | |
| template<typename T1 , size_t PREFIX_LEN> | |
| bool | HasPrefix (const T1 &obj, const std::array< uint8_t, PREFIX_LEN > &prefix) |
| Check whether a container begins with the given prefix. More... | |
| void | TraceThread (std::string_view thread_name, std::function< void()> thread_func) |
| A wrapper for do-something-once thread functions. More... | |
| void | ThreadRename (std::string &&) |
| Rename a thread both in terms of an internal (in-memory) name as well as its system thread name. More... | |
| void | ThreadSetInternalName (std::string &&) |
| Set the internal (in-memory) name of the current thread only. More... | |
| const std::string & | ThreadGetInternalName () |
| Get the thread's internal (in-memory) name; used e.g. More... | |
| using util::SettingsValue = typedef UniValue |
Settings value type (string/integer/boolean/null variant).
Definition at line 27 of file settings.h.
|
strong |
| Enumerator | |
|---|---|
| Success | |
| ErrorWrite | |
| ErrorLock | |
Definition at line 39 of file fs_helpers.h.
|
noexcept |
|
inlinenoexcept |
| bilingual_str util::ErrorString | ( | const Result< T > & | result | ) |
| auto util::FindKey | ( | Map && | map, |
| Key && | key | ||
| ) | -> decltype(&map.at(key)) |
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_type | ||
| ) |
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_type | - enable special backwards compatible behavior for GetChainType |
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.
|
inline |
|
inline |
|
inline |
|
inline |
| auto util::Join | ( | const std::vector< T > & | list, |
| const BaseType & | separator, | ||
| UnaryOp | unary_op | ||
| ) | -> decltype(unary_op(list.at(0))) |
| T util::Join | ( | const std::vector< T > & | list, |
| const T2 & | separator | ||
| ) |
| LockResult util::LockDirectory | ( | const fs::path & | directory, |
| const std::string | lockfile_name, | ||
| bool | probe_only | ||
| ) |
Definition at line 56 of file fs_helpers.cpp.
|
inline |
| 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.
|
inline |
|
inline |
| void util::ReplaceAll | ( | std::string & | in_out, |
| const std::string & | search, | ||
| const std::string & | substitute | ||
| ) |
| std::vector< T > util::Split | ( | const Span< const char > & | sp, |
| char | sep | ||
| ) |
Split a string on every instance of sep, returning a vector.
If sep does not occur in sp, a singleton with the entirety of sp is returned.
Note that this function does not care about braces, so splitting "foo(bar(1),2),3) on ',' will return {"foo(bar(1)", "2)", "3)"}.
| std::vector< T > util::Split | ( | const Span< const char > & | sp, |
| std::string_view | separators | ||
| ) |
Split a string on any char found in separators, returning a vector.
If sep does not occur in sp, a singleton with the entirety of sp is returned.
Note that this function does not care about braces, so splitting "foo(bar(1),2),3) on ',' will return {"foo(bar(1)", "2)", "3)"}.
Definition at line 32 of file string.h.
|
inline |
|
inline |
| 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.
| std::string util::ToString | ( | const T & | t | ) |
| void util::TraceThread | ( | std::string_view | thread_name, |
| std::function< void()> | thread_func | ||
| ) |
A wrapper for do-something-once thread functions.
Definition at line 14 of file thread.cpp.
|
inline |
|
inline |
| 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.