mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
Add VariantData::removeMember()
This commit is contained in:
@ -261,6 +261,11 @@ class VariantData {
|
||||
flags_ = uint8_t((flags_ & OWNED_KEY_BIT) | (src.flags_ & ~OWNED_KEY_BIT));
|
||||
}
|
||||
|
||||
template <typename TAdaptedString>
|
||||
void removeMember(TAdaptedString key, MemoryPool* pool) {
|
||||
collectionRemoveMember(asObject(), key, pool);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
flags_ = VALUE_IS_NULL;
|
||||
}
|
||||
|
@ -15,9 +15,6 @@ bool collectionCopy(CollectionData* dst, const CollectionData* src,
|
||||
MemoryPool* pool);
|
||||
void collectionRemoveElement(CollectionData* data, size_t index,
|
||||
MemoryPool* pool);
|
||||
template <typename TAdaptedString>
|
||||
void collectionRemoveMember(CollectionData* data, TAdaptedString key,
|
||||
MemoryPool* pool);
|
||||
|
||||
template <typename TVisitor>
|
||||
inline typename TVisitor::result_type variantAccept(const VariantData* var,
|
||||
@ -183,7 +180,7 @@ void variantRemoveMember(VariantData* var, TAdaptedString key,
|
||||
MemoryPool* pool) {
|
||||
if (!var)
|
||||
return;
|
||||
collectionRemoveMember(var->asObject(), key, pool);
|
||||
var->removeMember(key, pool);
|
||||
}
|
||||
|
||||
inline bool variantIsNull(const VariantData* var) {
|
||||
|
Reference in New Issue
Block a user