Create or assign a JsonDocument from a JsonArray/JsonObject/JsonVariant

This commit is contained in:
Benoit Blanchon
2019-01-23 10:47:20 +01:00
parent 2a3b51ac3a
commit 4167b11434
10 changed files with 334 additions and 98 deletions

View File

@@ -67,10 +67,7 @@ class VariantData {
}
CollectionData *asArray() {
if (type() == VALUE_IS_ARRAY)
return &_content.asCollection;
else
return 0;
return type() == VALUE_IS_ARRAY ? &_content.asCollection : 0;
}
const CollectionData *asArray() const {
@@ -78,10 +75,7 @@ class VariantData {
}
CollectionData *asObject() {
if (type() == VALUE_IS_OBJECT)
return &_content.asCollection;
else
return 0;
return type() == VALUE_IS_OBJECT ? &_content.asCollection : 0;
}
const CollectionData *asObject() const {