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

Function InterpretBool

src/util/system.cpp:189–194  ·  view source on GitHub ↗

* Interpret a string argument as a boolean. * * The definition of LocaleIndependentAtoi () requires that non-numeric string values * like "foo", return 0. This means that if a user unintentionally supplies a * non-integer argument here, the return value is always false. This means that * -foo=false does what the user probably expects, but -foo=true is well defined * but does not do what

Source from the content-addressed store, hash-verified

187 * on the Right Way to change this code), see PR12713.
188 */
189static bool InterpretBool(const std::string& strValue)
190{
191 if (strValue.empty())
192 return true;
193 return (LocaleIndependentAtoi<int>(strValue) != 0);
194}
195
196static std::string SettingName(const std::string& arg)
197{

Callers 3

InterpretValueFunction · 0.85
GetBoolArgMethod · 0.85
GetChainNameMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected