MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / InterpretBool

Function InterpretBool

src/util.cpp:213–218  ·  view source on GitHub ↗

* Interpret a string argument as a boolean. * * The definition of atoi() 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 they probably expected

Source from the content-addressed store, hash-verified

211 * on the Right Way to change this code), see PR12713.
212 */
213static bool InterpretBool(const std::string& strValue)
214{
215 if (strValue.empty())
216 return true;
217 return (atoi(strValue) != 0);
218}
219
220/** Internal helper functions for ArgsManager */
221class ArgsManagerHelper {

Callers 3

GetNetBoolArgMethod · 0.85
InterpretNegatedOptionFunction · 0.85
GetBoolArgMethod · 0.85

Calls 2

atoiFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected