mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Added JsonDocument::remove() and JsonVariant::remove()
This commit is contained in:
@@ -310,9 +310,28 @@ class VariantRef : public VariantRefBase<VariantData>,
|
||||
template <typename TString>
|
||||
FORCE_INLINE VariantRef getOrAddMember(const TString &) const;
|
||||
|
||||
FORCE_INLINE void remove(size_t index) const {
|
||||
if (_data) _data->remove(index);
|
||||
}
|
||||
// remove(char*) const
|
||||
// remove(const char*) const
|
||||
// remove(const __FlashStringHelper*) const
|
||||
template <typename TChar>
|
||||
FORCE_INLINE typename enable_if<IsString<TChar *>::value>::type remove(
|
||||
TChar *key) const {
|
||||
if (_data) _data->remove(adaptString(key));
|
||||
}
|
||||
// remove(const std::string&) const
|
||||
// remove(const String&) const
|
||||
template <typename TString>
|
||||
FORCE_INLINE typename enable_if<IsString<TString>::value>::type remove(
|
||||
const TString &key) const {
|
||||
if (_data) _data->remove(adaptString(key));
|
||||
}
|
||||
|
||||
private:
|
||||
MemoryPool *_pool;
|
||||
};
|
||||
}; // namespace ARDUINOJSON_NAMESPACE
|
||||
|
||||
class VariantConstRef : public VariantRefBase<const VariantData>,
|
||||
public VariantOperators<VariantConstRef>,
|
||||
|
||||
Reference in New Issue
Block a user