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

Function InterpretKey

src/common/args.cpp:77–92  ·  view source on GitHub ↗

* Parse "name", "section.name", "noname", "section.noname" settings keys. * * @note Where an option was negated can be later checked using the * IsArgNegated() method. One use case for this is to have a way to disable * options that are not normally boolean (e.g. using -nodebuglogfile to request * that debug log output is not sent to any file at all). */

Source from the content-addressed store, hash-verified

75 * that debug log output is not sent to any file at all).
76 */
77KeyInfo InterpretKey(std::string key)
78{
79 KeyInfo result;
80 // Split section name from key name for keys like "testnet.foo" or "regtest.bar"
81 size_t option_index = key.find('.');
82 if (option_index != std::string::npos) {
83 result.section = key.substr(0, option_index);
84 key.erase(0, option_index + 1);
85 }
86 if (key.starts_with("no")) {
87 key.erase(0, 2);
88 result.negated = true;
89 }
90 result.name = key;
91 return result;
92}
93
94/**
95 * Interpret settings value based on registered flags.

Callers 3

ParseParametersMethod · 0.85
ReadSettingsFileMethod · 0.85
ReadConfigStreamMethod · 0.85

Calls 2

findMethod · 0.80
eraseMethod · 0.45

Tested by

no test coverage detected