Added JsonDocument::remove() and JsonVariant::remove()

This commit is contained in:
Benoit Blanchon
2019-02-25 13:21:10 +01:00
parent bc2ce178ea
commit c9d6bd76c9
14 changed files with 298 additions and 2 deletions

View File

@@ -169,6 +169,15 @@ class VariantData {
return type() == VALUE_IS_NULL;
}
void remove(size_t index) {
if (isArray()) _content.asCollection.remove(index);
}
template <typename TAdaptedString>
void remove(TAdaptedString key) {
if (isObject()) _content.asCollection.remove(key);
}
void setBoolean(bool value) {
setType(VALUE_IS_BOOLEAN);
_content.asInteger = static_cast<UInt>(value);