-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
There is no way to test for "key":null in a JsonVariant.
JsonVariant().is< char* >() returns false as expected, so is no use.
JsonVariant().asString() returns NULL, but it will also return NULL for "key":1, so is no use.
Needs something like:
inline bool JsonVariant::isNull() const {
using namespace Internals;
return (_type == JSON_UNPARSED && _content.asString &&
!strcmp("null", _content.asString));
}
However, this also needs bool JsonVariant::is< void* >();, or possibly class JsonNull; bool JsonVariant::is< JsonNull >();
Also there are no tests in JsonVariant_As_Tests.cpp and JsonVariant_Is_Tests.cpp for "key":null .