* Method to get JSON object value using Poco::Nullable

This commit is contained in:
Rangel Reale
2013-08-21 10:34:21 -03:00
parent fd6433eb4e
commit 29885348ba
2 changed files with 21 additions and 0 deletions

View File

@@ -51,6 +51,7 @@
#include "Poco/UTF8Encoding.h"
#include "Poco/Latin1Encoding.h"
#include "Poco/TextConverter.h"
#include "Poco/Nullable.h"
#include "Poco/Dynamic/Struct.h"
@@ -105,6 +106,9 @@ void JSONTest::testNullProperty()
Var test = object->get("test");
assert(test.isEmpty());
Poco::Nullable<int> test2 = object->getNullableValue<int>("test");
assert(test2.isNull());
DynamicStruct ds = *object;
assert (ds["test"].isEmpty());