Forward compatibility - config substitutions:

1) Verify whether a value looks like an enum
2) Always report substitution of an enum with a boolean.
This commit is contained in:
bubnikv 2021-06-30 16:19:06 +02:00 committed by Vojtech Bubnik
parent 4fa651456d
commit c7691ec95e
2 changed files with 16 additions and 3 deletions

View file

@ -1330,11 +1330,11 @@ public:
bool deserialize(const std::string &str, bool append = false) override
{
UNUSED(append);
if (str == "1" || boost::iequals(str, "enabled") || boost::iequals(str, "on")) {
if (str == "1") {
this->value = true;
return true;
}
if (str == "0" || boost::iequals(str, "disabled") || boost::iequals(str, "off")) {
if (str == "0") {
this->value = false;
return true;
}