MCPcopy Create free account
hub / github.com/AHXR/ghost / GetBoolean

Method GetBoolean

_src/server/INIReader.cpp:52–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool INIReader::GetBoolean(const string& section, const string& name, bool default_value) const
53{
54 string valstr = Get(section, name, "");
55 // Convert to lower case to make string comparisons case-insensitive
56 std::transform(valstr.begin(), valstr.end(), valstr.begin(), ::tolower);
57 if (valstr == "true" || valstr == "yes" || valstr == "on" || valstr == "1")
58 return true;
59 else if (valstr == "false" || valstr == "no" || valstr == "off" || valstr == "0")
60 return false;
61 else
62 return default_value;
63}
64
65string INIReader::MakeKey(const string& section, const string& name)
66{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected