Added RawJson() to insert pregenerated JSON portions (issue #259)

This commit is contained in:
Benoit Blanchon
2016-04-16 16:15:01 +02:00
parent c77c3f33ef
commit a6724bd03f
11 changed files with 131 additions and 130 deletions

View File

@ -47,8 +47,7 @@ String JsonVariant::toString() const {
return s;
}
template <>
bool JsonVariant::is<bool>() const {
bool JsonVariant::isBoolean() const {
if (_type == JSON_BOOLEAN) return true;
if (_type != JSON_UNPARSED || _content.asString == NULL) return false;
@ -57,8 +56,7 @@ bool JsonVariant::is<bool>() const {
!strcmp(_content.asString, "false");
}
template <>
bool JsonVariant::is<signed long>() const {
bool JsonVariant::isInteger() const {
if (_type == JSON_INTEGER) return true;
if (_type != JSON_UNPARSED || _content.asString == NULL) return false;
@ -70,8 +68,7 @@ bool JsonVariant::is<signed long>() const {
return *end == '\0' && errno == 0;
}
template <>
bool JsonVariant::is<double>() const {
bool JsonVariant::isFloat() const {
if (_type >= JSON_FLOAT_0_DECIMALS) return true;
if (_type != JSON_UNPARSED || _content.asString == NULL) return false;