mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
Fix some getVariant()
that were accidentally renamed to getSlot()
This commit is contained in:
@ -80,14 +80,14 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
// https://arduinojson.org/v6/api/jsondocument/as/
|
||||
template <typename T>
|
||||
T as() {
|
||||
return getSlot().template as<T>();
|
||||
return getVariant().template as<T>();
|
||||
}
|
||||
|
||||
// Casts the root to the specified type.
|
||||
// https://arduinojson.org/v6/api/jsondocument/as/
|
||||
template <typename T>
|
||||
T as() const {
|
||||
return getSlot().template as<T>();
|
||||
return getVariant().template as<T>();
|
||||
}
|
||||
|
||||
// Empties the document and resets the memory pool
|
||||
@ -101,20 +101,20 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
// https://arduinojson.org/v6/api/jsondocument/is/
|
||||
template <typename T>
|
||||
bool is() {
|
||||
return getSlot().template is<T>();
|
||||
return getVariant().template is<T>();
|
||||
}
|
||||
|
||||
// Returns true if the root is of the specified type.
|
||||
// https://arduinojson.org/v6/api/jsondocument/is/
|
||||
template <typename T>
|
||||
bool is() const {
|
||||
return getSlot().template is<T>();
|
||||
return getVariant().template is<T>();
|
||||
}
|
||||
|
||||
// Returns true if the root is null.
|
||||
// https://arduinojson.org/v6/api/jsondocument/isnull/
|
||||
bool isNull() const {
|
||||
return getSlot().isNull();
|
||||
return getVariant().isNull();
|
||||
}
|
||||
|
||||
// Returns trues if the memory pool was too small.
|
||||
@ -155,7 +155,7 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
template <typename T>
|
||||
typename detail::VariantTo<T>::type to() {
|
||||
clear();
|
||||
return getSlot().template to<T>();
|
||||
return getVariant().template to<T>();
|
||||
}
|
||||
|
||||
// Creates an array and appends it to the root array.
|
||||
@ -314,11 +314,11 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
}
|
||||
|
||||
FORCE_INLINE operator JsonVariant() {
|
||||
return getSlot();
|
||||
return getVariant();
|
||||
}
|
||||
|
||||
FORCE_INLINE operator JsonVariantConst() const {
|
||||
return getSlot();
|
||||
return getVariant();
|
||||
}
|
||||
|
||||
friend void swap(JsonDocument& a, JsonDocument& b) {
|
||||
@ -327,11 +327,11 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
}
|
||||
|
||||
private:
|
||||
JsonVariant getSlot() {
|
||||
JsonVariant getVariant() {
|
||||
return JsonVariant(&data_, &resources_);
|
||||
}
|
||||
|
||||
JsonVariantConst getSlot() const {
|
||||
JsonVariantConst getVariant() const {
|
||||
return JsonVariantConst(&data_, &resources_);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ inline JsonVariant VariantRefBase<TDerived>::add() const {
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
inline JsonVariant VariantRefBase<TDerived>::getSlot() const {
|
||||
inline JsonVariant VariantRefBase<TDerived>::getVariant() const {
|
||||
return JsonVariant(getData(), getResourceManager());
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ class VariantRefBase : public VariantTag {
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<ConverterNeedsWriteableRef<T>::value, T>::type
|
||||
as() const {
|
||||
return Converter<T>::fromJson(getSlot());
|
||||
return Converter<T>::fromJson(getVariant());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -92,7 +92,7 @@ class VariantRefBase : public VariantTag {
|
||||
FORCE_INLINE
|
||||
typename enable_if<ConverterNeedsWriteableRef<T>::value, bool>::type
|
||||
is() const {
|
||||
return Converter<T>::checkJson(getSlot());
|
||||
return Converter<T>::checkJson(getVariant());
|
||||
}
|
||||
|
||||
// Returns true if the value is of the specified type.
|
||||
@ -262,7 +262,7 @@ class VariantRefBase : public VariantTag {
|
||||
}
|
||||
|
||||
private:
|
||||
FORCE_INLINE ArduinoJson::JsonVariant getSlot() const;
|
||||
FORCE_INLINE ArduinoJson::JsonVariant getVariant() const;
|
||||
|
||||
FORCE_INLINE ArduinoJson::JsonVariantConst getVariantConst() const {
|
||||
return ArduinoJson::JsonVariantConst(getData(), getResourceManager());
|
||||
|
Reference in New Issue
Block a user