SimpCfg:Bools:Make lowercase b4 checking true/false for bool path
TODO: string check wrt true/false, doesnt seem to be working after str_tolower was introduced. I seem to be doing some silly mistake not able to make out, moving in and out of sleep, need to check tomorrow. string == string-literal failed string == string-view failed string.compare(string-literal) failed Bit strange
This commit is contained in:
parent
ef5a2cf391
commit
eb56517f20
1 changed files with 4 additions and 2 deletions
|
@ -65,7 +65,7 @@ std::string str_trim_single(std::string sin, std::string trimChars=" \t\n") {
|
|||
std::string str_tolower(const std::string &sin) {
|
||||
std::string sout;
|
||||
std::transform(sin.begin(), sin.end(),sout.begin(), [](char c)->char {return std::tolower(c);});
|
||||
LDBUG_LN("DBUG:%s:%s:%s", __func__, sin.c_str(), sout.c_str());
|
||||
//LDBUG_LN("DBUG:%s:%s:%s", __func__, sin.c_str(), sout.c_str());
|
||||
return sout;
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,9 @@ public:
|
|||
value = str_trim(value);
|
||||
value = str_trim(value, ",");
|
||||
std::string vtype = "bool";
|
||||
if ((value == "true") || (value == "false")) {
|
||||
auto valueLower = str_tolower(value);
|
||||
LDBUG_LN("DBUG:%s:BoolCheck:%s:%s", __func__, value.c_str(), valueLower.c_str());
|
||||
if ((valueLower.compare("true") == 0) || (valueLower.compare("false") == 0)) {
|
||||
set_bool(group, key, value);
|
||||
} else if (std::regex_match(value, rInt)) {
|
||||
vtype = "int";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue