MCPcopy Create free account
hub / github.com/ElementsProject/elements / InterpretKey

Function InterpretKey

src/util/system.cpp:215–230  ·  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

213 * that debug log output is not sent to any file at all).
214 */
215KeyInfo InterpretKey(std::string key)
216{
217 KeyInfo result;
218 // Split section name from key name for keys like "testnet.foo" or "regtest.bar"
219 size_t option_index = key.find('.');
220 if (option_index != std::string::npos) {
221 result.section = key.substr(0, option_index);
222 key.erase(0, option_index + 1);
223 }
224 if (key.substr(0, 2) == "no") {
225 key.erase(0, 2);
226 result.negated = true;
227 }
228 result.name = key;
229 return result;
230}
231
232/**
233 * 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