mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
* Method to get JSON object value using Poco::Nullable
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user