mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 00:38:26 +01:00
Rename ObjectRef to JsonObject
This commit is contained in:
@@ -20,7 +20,7 @@ namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
// Forward declarations.
|
||||
class JsonArray;
|
||||
class ObjectRef;
|
||||
class JsonObject;
|
||||
|
||||
class VariantConstRef : public VariantTag,
|
||||
public VariantOperators<VariantConstRef> {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <ArduinoJson/Configuration.hpp>
|
||||
#include <ArduinoJson/Numbers/convertNumber.hpp>
|
||||
#include <ArduinoJson/Numbers/parseNumber.hpp>
|
||||
#include <ArduinoJson/Object/ObjectRef.hpp>
|
||||
#include <ArduinoJson/Object/JsonObject.hpp>
|
||||
#include <ArduinoJson/Variant/VariantRef.hpp>
|
||||
|
||||
#include <string.h> // for strcmp
|
||||
@@ -128,9 +128,9 @@ VariantRefBase<TDerived>::to() const {
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
typename enable_if<is_same<T, ObjectRef>::value, ObjectRef>::type
|
||||
typename enable_if<is_same<T, JsonObject>::value, JsonObject>::type
|
||||
VariantRefBase<TDerived>::to() const {
|
||||
return ObjectRef(getPool(), variantToObject(getOrCreateData()));
|
||||
return JsonObject(getPool(), variantToObject(getOrCreateData()));
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
|
||||
@@ -78,9 +78,10 @@ class VariantRefBase : public VariantTag {
|
||||
template <typename T>
|
||||
typename enable_if<is_same<T, JsonArray>::value, JsonArray>::type to() const;
|
||||
//
|
||||
// ObjectRef to<ObjectRef>()
|
||||
// JsonObject to<JsonObject>()
|
||||
template <typename T>
|
||||
typename enable_if<is_same<T, ObjectRef>::value, ObjectRef>::type to() const;
|
||||
typename enable_if<is_same<T, JsonObject>::value, JsonObject>::type to()
|
||||
const;
|
||||
//
|
||||
// VariantRef to<VariantRef>()
|
||||
template <typename T>
|
||||
@@ -200,7 +201,7 @@ class VariantRefBase : public VariantTag {
|
||||
}
|
||||
|
||||
FORCE_INLINE JsonArray createNestedArray() const;
|
||||
FORCE_INLINE ObjectRef createNestedObject() const;
|
||||
FORCE_INLINE JsonObject createNestedObject() const;
|
||||
FORCE_INLINE ElementProxy<TDerived> operator[](size_t index) const;
|
||||
|
||||
template <typename TString>
|
||||
@@ -228,10 +229,10 @@ class VariantRefBase : public VariantTag {
|
||||
FORCE_INLINE JsonArray createNestedArray(TChar* key) const;
|
||||
|
||||
template <typename TString>
|
||||
ObjectRef createNestedObject(const TString& key) const;
|
||||
JsonObject createNestedObject(const TString& key) const;
|
||||
|
||||
template <typename TChar>
|
||||
ObjectRef createNestedObject(TChar* key) const;
|
||||
JsonObject createNestedObject(TChar* key) const;
|
||||
|
||||
private:
|
||||
TDerived& derived() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
class JsonArray;
|
||||
class ObjectRef;
|
||||
class JsonObject;
|
||||
class VariantRef;
|
||||
|
||||
// A metafunction that returns the type of the value returned by
|
||||
@@ -21,8 +21,8 @@ struct VariantTo<JsonArray> {
|
||||
typedef JsonArray type;
|
||||
};
|
||||
template <>
|
||||
struct VariantTo<ObjectRef> {
|
||||
typedef ObjectRef type;
|
||||
struct VariantTo<JsonObject> {
|
||||
typedef JsonObject type;
|
||||
};
|
||||
template <>
|
||||
struct VariantTo<VariantRef> {
|
||||
|
||||
Reference in New Issue
Block a user