mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
ArduinoJson 7.0.1
This commit is contained in:
@@ -51,7 +51,7 @@ class JsonArrayConst : public detail::VariantOperators<JsonArrayConst> {
|
||||
}
|
||||
|
||||
operator JsonVariantConst() const {
|
||||
return JsonVariantConst(collectionToVariant(data_), resources_);
|
||||
return JsonVariantConst(getData(), resources_);
|
||||
}
|
||||
|
||||
// Returns true if the reference is unbound.
|
||||
@@ -69,7 +69,7 @@ class JsonArrayConst : public detail::VariantOperators<JsonArrayConst> {
|
||||
// Returns the depth (nesting level) of the array.
|
||||
// https://arduinojson.org/v7/api/jsonarrayconst/nesting/
|
||||
FORCE_INLINE size_t nesting() const {
|
||||
return detail::VariantData::nesting(collectionToVariant(data_), resources_);
|
||||
return detail::VariantData::nesting(getData(), resources_);
|
||||
}
|
||||
|
||||
// Returns the number of elements in the array.
|
||||
|
||||
@@ -27,7 +27,7 @@ class JsonObjectConst : public detail::VariantOperators<JsonObjectConst> {
|
||||
: data_(data), resources_(resources) {}
|
||||
|
||||
operator JsonVariantConst() const {
|
||||
return JsonVariantConst(collectionToVariant(data_), resources_);
|
||||
return JsonVariantConst(getData(), resources_);
|
||||
}
|
||||
|
||||
// Returns true if the reference is unbound.
|
||||
@@ -45,7 +45,7 @@ class JsonObjectConst : public detail::VariantOperators<JsonObjectConst> {
|
||||
// Returns the depth (nesting level) of the object.
|
||||
// https://arduinojson.org/v7/api/jsonobjectconst/nesting/
|
||||
FORCE_INLINE size_t nesting() const {
|
||||
return detail::VariantData::nesting(collectionToVariant(data_), resources_);
|
||||
return detail::VariantData::nesting(getData(), resources_);
|
||||
}
|
||||
|
||||
// Returns the number of members in the object.
|
||||
@@ -101,8 +101,9 @@ class JsonObjectConst : public detail::VariantOperators<JsonObjectConst> {
|
||||
FORCE_INLINE typename detail::enable_if<detail::IsString<TChar*>::value,
|
||||
JsonVariantConst>::type
|
||||
operator[](TChar* key) const {
|
||||
return JsonVariantConst(
|
||||
detail::ObjectData::getMember(data_, detail::adaptString(key)));
|
||||
return JsonVariantConst(detail::ObjectData::getMember(
|
||||
data_, detail::adaptString(key), resources_),
|
||||
resources_);
|
||||
}
|
||||
|
||||
// DEPRECATED: always returns zero
|
||||
|
||||
@@ -132,7 +132,8 @@ VariantRefBase<TDerived>::operator[](const TString& key) const {
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline bool VariantRefBase<TDerived>::set(const T& value) const {
|
||||
Converter<T>::toJson(value, getOrCreateVariant());
|
||||
Converter<typename detail::remove_cv<T>::type>::toJson(value,
|
||||
getOrCreateVariant());
|
||||
auto resources = getResourceManager();
|
||||
return resources && !resources->overflowed();
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ARDUINOJSON_VERSION "7.0.0"
|
||||
#define ARDUINOJSON_VERSION "7.0.1"
|
||||
#define ARDUINOJSON_VERSION_MAJOR 7
|
||||
#define ARDUINOJSON_VERSION_MINOR 0
|
||||
#define ARDUINOJSON_VERSION_REVISION 0
|
||||
#define ARDUINOJSON_VERSION_MACRO V700
|
||||
#define ARDUINOJSON_VERSION_REVISION 1
|
||||
#define ARDUINOJSON_VERSION_MACRO V701
|
||||
|
||||
Reference in New Issue
Block a user