mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 00:38:26 +01:00
Disambiguated the name get() with getElement() and getMember()
This commit is contained in:
@@ -83,7 +83,7 @@ class JsonDocument : public Visitable {
|
||||
}
|
||||
|
||||
ArrayRef createNestedArray() {
|
||||
return add().to<ArrayRef>();
|
||||
return addElement().to<ArrayRef>();
|
||||
}
|
||||
|
||||
// createNestedArray(char*)
|
||||
@@ -91,18 +91,18 @@ class JsonDocument : public Visitable {
|
||||
// createNestedArray(const __FlashStringHelper*)
|
||||
template <typename TChar>
|
||||
ArrayRef createNestedArray(TChar* key) {
|
||||
return getOrCreate(key).template to<ArrayRef>();
|
||||
return getOrAddMember(key).template to<ArrayRef>();
|
||||
}
|
||||
|
||||
// createNestedArray(const std::string&)
|
||||
// createNestedArray(const String&)
|
||||
template <typename TString>
|
||||
ArrayRef createNestedArray(const TString& key) {
|
||||
return getOrCreate(key).template to<ArrayRef>();
|
||||
return getOrAddMember(key).template to<ArrayRef>();
|
||||
}
|
||||
|
||||
ObjectRef createNestedObject() {
|
||||
return add().to<ObjectRef>();
|
||||
return addElement().to<ObjectRef>();
|
||||
}
|
||||
|
||||
// createNestedObject(char*)
|
||||
@@ -110,14 +110,14 @@ class JsonDocument : public Visitable {
|
||||
// createNestedObject(const __FlashStringHelper*)
|
||||
template <typename TChar>
|
||||
ObjectRef createNestedObject(TChar* key) {
|
||||
return getOrCreate(key).template to<ObjectRef>();
|
||||
return getOrAddMember(key).template to<ObjectRef>();
|
||||
}
|
||||
|
||||
// createNestedObject(const std::string&)
|
||||
// createNestedObject(const String&)
|
||||
template <typename TString>
|
||||
ObjectRef createNestedObject(const TString& key) {
|
||||
return getOrCreate(key).template to<ObjectRef>();
|
||||
return getOrAddMember(key).template to<ObjectRef>();
|
||||
}
|
||||
|
||||
// operator[](const std::string&)
|
||||
@@ -164,51 +164,51 @@ class JsonDocument : public Visitable {
|
||||
}
|
||||
|
||||
FORCE_INLINE VariantConstRef operator[](size_t index) const {
|
||||
return VariantConstRef(_data.get(index));
|
||||
return VariantConstRef(_data.getElement(index));
|
||||
}
|
||||
|
||||
FORCE_INLINE VariantRef get(size_t index) {
|
||||
return VariantRef(&_pool, _data.get(index));
|
||||
FORCE_INLINE VariantRef getElement(size_t index) {
|
||||
return VariantRef(&_pool, _data.getElement(index));
|
||||
}
|
||||
|
||||
// get(char*) const
|
||||
// get(const char*) const
|
||||
// get(const __FlashStringHelper*) const
|
||||
// getMember(char*) const
|
||||
// getMember(const char*) const
|
||||
// getMember(const __FlashStringHelper*) const
|
||||
template <typename TChar>
|
||||
FORCE_INLINE VariantRef get(TChar* key) {
|
||||
return VariantRef(&_pool, _data.get(adaptString(key)));
|
||||
FORCE_INLINE VariantRef getMember(TChar* key) {
|
||||
return VariantRef(&_pool, _data.getMember(adaptString(key)));
|
||||
}
|
||||
|
||||
// get(const std::string&) const
|
||||
// get(const String&) const
|
||||
// getMember(const std::string&) const
|
||||
// getMember(const String&) const
|
||||
template <typename TString>
|
||||
FORCE_INLINE typename enable_if<IsString<TString>::value, VariantRef>::type
|
||||
get(const TString& key) {
|
||||
return VariantRef(&_pool, _data.get(adaptString(key)));
|
||||
getMember(const TString& key) {
|
||||
return VariantRef(&_pool, _data.getMember(adaptString(key)));
|
||||
}
|
||||
|
||||
// getOrCreate(char*)
|
||||
// getOrCreate(const char*)
|
||||
// getOrCreate(const __FlashStringHelper*)
|
||||
// getOrAddMember(char*)
|
||||
// getOrAddMember(const char*)
|
||||
// getOrAddMember(const __FlashStringHelper*)
|
||||
template <typename TChar>
|
||||
FORCE_INLINE VariantRef getOrCreate(TChar* key) {
|
||||
return VariantRef(&_pool, _data.getOrCreate(adaptString(key), &_pool));
|
||||
FORCE_INLINE VariantRef getOrAddMember(TChar* key) {
|
||||
return VariantRef(&_pool, _data.getOrAddMember(adaptString(key), &_pool));
|
||||
}
|
||||
|
||||
// getOrCreate(const std::string&)
|
||||
// getOrCreate(const String&)
|
||||
// getOrAddMember(const std::string&)
|
||||
// getOrAddMember(const String&)
|
||||
template <typename TString>
|
||||
FORCE_INLINE VariantRef getOrCreate(const TString& key) {
|
||||
return VariantRef(&_pool, _data.getOrCreate(adaptString(key), &_pool));
|
||||
FORCE_INLINE VariantRef getOrAddMember(const TString& key) {
|
||||
return VariantRef(&_pool, _data.getOrAddMember(adaptString(key), &_pool));
|
||||
}
|
||||
|
||||
FORCE_INLINE VariantRef add() {
|
||||
return VariantRef(&_pool, _data.add(&_pool));
|
||||
FORCE_INLINE VariantRef addElement() {
|
||||
return VariantRef(&_pool, _data.addElement(&_pool));
|
||||
}
|
||||
|
||||
template <typename TValue>
|
||||
FORCE_INLINE bool add(const TValue& value) {
|
||||
return add().set(value);
|
||||
return addElement().set(value);
|
||||
}
|
||||
|
||||
// add(char*) const
|
||||
@@ -216,7 +216,7 @@ class JsonDocument : public Visitable {
|
||||
// add(const __FlashStringHelper*) const
|
||||
template <typename TChar>
|
||||
FORCE_INLINE bool add(TChar* value) {
|
||||
return add().set(value);
|
||||
return addElement().set(value);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user