forked from bblanchon/ArduinoJson
Fixed JsonVariant::is<bool>()
that was incorrectly returning false (issue #214)
This commit is contained in:
@ -86,6 +86,16 @@ String JsonVariant::as<String>() const {
|
||||
return s;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool JsonVariant::is<bool>() const {
|
||||
if (_type == JSON_BOOLEAN) return true;
|
||||
|
||||
if (_type != JSON_UNPARSED || _content.asString == NULL) return false;
|
||||
|
||||
return !strcmp(_content.asString, "true") ||
|
||||
!strcmp(_content.asString, "false");
|
||||
}
|
||||
|
||||
template <>
|
||||
bool JsonVariant::is<signed long>() const {
|
||||
if (_type == JSON_INTEGER) return true;
|
||||
|
Reference in New Issue
Block a user