mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Rename ObjectRef to JsonObject
				
					
				
			This commit is contained in:
		| @@ -187,8 +187,8 @@ TEST_CASE("Polyfills/type_traits") { | |||||||
|     CHECK((is_convertible<ElementProxy<JsonArray>, JsonVariantConst>::value == |     CHECK((is_convertible<ElementProxy<JsonArray>, JsonVariantConst>::value == | ||||||
|            true)); |            true)); | ||||||
|     CHECK((is_convertible<JsonArrayConst, JsonVariantConst>::value == true)); |     CHECK((is_convertible<JsonArrayConst, JsonVariantConst>::value == true)); | ||||||
|     CHECK((is_convertible<ObjectRef, JsonVariantConst>::value == true)); |     CHECK((is_convertible<JsonObject, JsonVariantConst>::value == true)); | ||||||
|     CHECK((is_convertible<MemberProxy<ObjectRef, const char*>, |     CHECK((is_convertible<MemberProxy<JsonObject, const char*>, | ||||||
|                           JsonVariantConst>::value == true)); |                           JsonVariantConst>::value == true)); | ||||||
|     CHECK((is_convertible<ObjectConstRef, JsonVariantConst>::value == true)); |     CHECK((is_convertible<ObjectConstRef, JsonVariantConst>::value == true)); | ||||||
|     CHECK( |     CHECK( | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #include "ArduinoJson/Array/JsonArray.hpp" | #include "ArduinoJson/Array/JsonArray.hpp" | ||||||
| #include "ArduinoJson/Object/ObjectRef.hpp" | #include "ArduinoJson/Object/JsonObject.hpp" | ||||||
| #include "ArduinoJson/Variant/VariantConstRef.hpp" | #include "ArduinoJson/Variant/VariantConstRef.hpp" | ||||||
|  |  | ||||||
| #include "ArduinoJson/Document/DynamicJsonDocument.hpp" | #include "ArduinoJson/Document/DynamicJsonDocument.hpp" | ||||||
| @@ -32,8 +32,8 @@ | |||||||
| #include "ArduinoJson/Array/JsonArrayImpl.hpp" | #include "ArduinoJson/Array/JsonArrayImpl.hpp" | ||||||
| #include "ArduinoJson/Array/Utilities.hpp" | #include "ArduinoJson/Array/Utilities.hpp" | ||||||
| #include "ArduinoJson/Collection/CollectionImpl.hpp" | #include "ArduinoJson/Collection/CollectionImpl.hpp" | ||||||
|  | #include "ArduinoJson/Object/JsonObjectImpl.hpp" | ||||||
| #include "ArduinoJson/Object/MemberProxy.hpp" | #include "ArduinoJson/Object/MemberProxy.hpp" | ||||||
| #include "ArduinoJson/Object/ObjectImpl.hpp" |  | ||||||
| #include "ArduinoJson/Variant/ConverterImpl.hpp" | #include "ArduinoJson/Variant/ConverterImpl.hpp" | ||||||
| #include "ArduinoJson/Variant/VariantCompare.hpp" | #include "ArduinoJson/Variant/VariantCompare.hpp" | ||||||
| #include "ArduinoJson/Variant/VariantImpl.hpp" | #include "ArduinoJson/Variant/VariantImpl.hpp" | ||||||
| @@ -52,7 +52,7 @@ using ARDUINOJSON_NAMESPACE::JsonArrayConst; | |||||||
| typedef ARDUINOJSON_NAMESPACE::Float JsonFloat; | typedef ARDUINOJSON_NAMESPACE::Float JsonFloat; | ||||||
| typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger; | typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger; | ||||||
| typedef ARDUINOJSON_NAMESPACE::ObjectConstRef JsonObjectConst; | typedef ARDUINOJSON_NAMESPACE::ObjectConstRef JsonObjectConst; | ||||||
| typedef ARDUINOJSON_NAMESPACE::ObjectRef JsonObject; | using ARDUINOJSON_NAMESPACE::JsonObject; | ||||||
| typedef ARDUINOJSON_NAMESPACE::Pair JsonPair; | typedef ARDUINOJSON_NAMESPACE::Pair JsonPair; | ||||||
| typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst; | typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst; | ||||||
| typedef ARDUINOJSON_NAMESPACE::String JsonString; | typedef ARDUINOJSON_NAMESPACE::String JsonString; | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| class ObjectRef; | class JsonObject; | ||||||
|  |  | ||||||
| class JsonArray : public VariantOperators<JsonArray> { | class JsonArray : public VariantOperators<JsonArray> { | ||||||
|   friend class VariantAttorney; |   friend class VariantAttorney; | ||||||
| @@ -92,7 +92,7 @@ class JsonArray : public VariantOperators<JsonArray> { | |||||||
|     return ElementProxy<JsonArray>(*this, index); |     return ElementProxy<JsonArray>(*this, index); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   FORCE_INLINE ObjectRef createNestedObject() const; |   FORCE_INLINE JsonObject createNestedObject() const; | ||||||
|  |  | ||||||
|   FORCE_INLINE JsonArray createNestedArray() const { |   FORCE_INLINE JsonArray createNestedArray() const { | ||||||
|     return add().to<JsonArray>(); |     return add().to<JsonArray>(); | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ | |||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| class ObjectRef; | class JsonObject; | ||||||
|  |  | ||||||
| class JsonArrayConst : public VariantOperators<JsonArrayConst> { | class JsonArrayConst : public VariantOperators<JsonArrayConst> { | ||||||
|   friend class JsonArray; |   friend class JsonArray; | ||||||
|   | |||||||
| @@ -5,12 +5,12 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #include <ArduinoJson/Array/JsonArray.hpp> | #include <ArduinoJson/Array/JsonArray.hpp> | ||||||
| #include <ArduinoJson/Object/ObjectRef.hpp> | #include <ArduinoJson/Object/JsonObject.hpp> | ||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| inline ObjectRef JsonArray::createNestedObject() const { | inline JsonObject JsonArray::createNestedObject() const { | ||||||
|   return add().to<ObjectRef>(); |   return add().to<JsonObject>(); | ||||||
| } | } | ||||||
|  |  | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| @@ -19,8 +19,8 @@ inline JsonArray VariantRefBase<TDerived>::createNestedArray() const { | |||||||
| } | } | ||||||
|  |  | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| inline ObjectRef VariantRefBase<TDerived>::createNestedObject() const { | inline JsonObject VariantRefBase<TDerived>::createNestedObject() const { | ||||||
|   return add().template to<ObjectRef>(); |   return add().template to<JsonObject>(); | ||||||
| } | } | ||||||
|  |  | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
|   | |||||||
| @@ -67,7 +67,7 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument { | |||||||
|       typename enable_if< |       typename enable_if< | ||||||
|           is_same<T, VariantRef>::value || is_same<T, VariantConstRef>::value || |           is_same<T, VariantRef>::value || is_same<T, VariantConstRef>::value || | ||||||
|           is_same<T, JsonArray>::value || is_same<T, JsonArrayConst>::value || |           is_same<T, JsonArray>::value || is_same<T, JsonArrayConst>::value || | ||||||
|           is_same<T, ObjectRef>::value || |           is_same<T, JsonObject>::value || | ||||||
|           is_same<T, ObjectConstRef>::value>::type* = 0) |           is_same<T, ObjectConstRef>::value>::type* = 0) | ||||||
|       : JsonDocument(allocPool(src.memoryUsage())) { |       : JsonDocument(allocPool(src.memoryUsage())) { | ||||||
|     set(src); |     set(src); | ||||||
|   | |||||||
| @@ -6,12 +6,13 @@ | |||||||
|  |  | ||||||
| #include <ArduinoJson/Array/ElementProxy.hpp> | #include <ArduinoJson/Array/ElementProxy.hpp> | ||||||
| #include <ArduinoJson/Memory/MemoryPool.hpp> | #include <ArduinoJson/Memory/MemoryPool.hpp> | ||||||
|  | #include <ArduinoJson/Object/JsonObject.hpp> | ||||||
| #include <ArduinoJson/Object/MemberProxy.hpp> | #include <ArduinoJson/Object/MemberProxy.hpp> | ||||||
| #include <ArduinoJson/Object/ObjectRef.hpp> |  | ||||||
| #include <ArduinoJson/Strings/StoragePolicy.hpp> | #include <ArduinoJson/Strings/StoragePolicy.hpp> | ||||||
| #include <ArduinoJson/Variant/VariantConstRef.hpp> | #include <ArduinoJson/Variant/VariantConstRef.hpp> | ||||||
| #include <ArduinoJson/Variant/VariantTo.hpp> | #include <ArduinoJson/Variant/VariantTo.hpp> | ||||||
|  |  | ||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| class JsonDocument : public VariantOperators<const JsonDocument&> { | class JsonDocument : public VariantOperators<const JsonDocument&> { | ||||||
| @@ -102,23 +103,23 @@ class JsonDocument : public VariantOperators<const JsonDocument&> { | |||||||
|     return operator[](key).template to<JsonArray>(); |     return operator[](key).template to<JsonArray>(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ObjectRef createNestedObject() { |   JsonObject createNestedObject() { | ||||||
|     return add().to<ObjectRef>(); |     return add().to<JsonObject>(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // createNestedObject(char*) |   // createNestedObject(char*) | ||||||
|   // createNestedObject(const char*) |   // createNestedObject(const char*) | ||||||
|   // createNestedObject(const __FlashStringHelper*) |   // createNestedObject(const __FlashStringHelper*) | ||||||
|   template <typename TChar> |   template <typename TChar> | ||||||
|   ObjectRef createNestedObject(TChar* key) { |   JsonObject createNestedObject(TChar* key) { | ||||||
|     return operator[](key).template to<ObjectRef>(); |     return operator[](key).template to<JsonObject>(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // createNestedObject(const std::string&) |   // createNestedObject(const std::string&) | ||||||
|   // createNestedObject(const String&) |   // createNestedObject(const String&) | ||||||
|   template <typename TString> |   template <typename TString> | ||||||
|   ObjectRef createNestedObject(const TString& key) { |   JsonObject createNestedObject(const TString& key) { | ||||||
|     return operator[](key).template to<ObjectRef>(); |     return operator[](key).template to<JsonObject>(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // containsKey(char*) const |   // containsKey(char*) const | ||||||
|   | |||||||
| @@ -11,14 +11,14 @@ namespace ARDUINOJSON_NAMESPACE { | |||||||
| 
 | 
 | ||||||
| class JsonArray; | class JsonArray; | ||||||
| 
 | 
 | ||||||
| class ObjectRef : public VariantOperators<ObjectRef> { | class JsonObject : public VariantOperators<JsonObject> { | ||||||
|   friend class VariantAttorney; |   friend class VariantAttorney; | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|   typedef ObjectIterator iterator; |   typedef ObjectIterator iterator; | ||||||
| 
 | 
 | ||||||
|   FORCE_INLINE ObjectRef() : _data(0), _pool(0) {} |   FORCE_INLINE JsonObject() : _data(0), _pool(0) {} | ||||||
|   FORCE_INLINE ObjectRef(MemoryPool* buf, CollectionData* data) |   FORCE_INLINE JsonObject(MemoryPool* buf, CollectionData* data) | ||||||
|       : _data(data), _pool(buf) {} |       : _data(data), _pool(buf) {} | ||||||
| 
 | 
 | ||||||
|   operator VariantRef() const { |   operator VariantRef() const { | ||||||
| @@ -76,22 +76,22 @@ class ObjectRef : public VariantOperators<ObjectRef> { | |||||||
|     return _data->copyFrom(*src._data, _pool); |     return _data->copyFrom(*src._data, _pool); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   FORCE_INLINE bool operator==(ObjectRef rhs) const { |   FORCE_INLINE bool operator==(JsonObject rhs) const { | ||||||
|     return ObjectConstRef(_data) == ObjectConstRef(rhs._data); |     return ObjectConstRef(_data) == ObjectConstRef(rhs._data); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   template <typename TString> |   template <typename TString> | ||||||
|   FORCE_INLINE typename enable_if<IsString<TString>::value, |   FORCE_INLINE typename enable_if<IsString<TString>::value, | ||||||
|                                   MemberProxy<ObjectRef, TString> >::type |                                   MemberProxy<JsonObject, TString> >::type | ||||||
|   operator[](const TString& key) const { |   operator[](const TString& key) const { | ||||||
|     return MemberProxy<ObjectRef, TString>(*this, key); |     return MemberProxy<JsonObject, TString>(*this, key); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   template <typename TChar> |   template <typename TChar> | ||||||
|   FORCE_INLINE typename enable_if<IsString<TChar*>::value, |   FORCE_INLINE typename enable_if<IsString<TChar*>::value, | ||||||
|                                   MemberProxy<ObjectRef, TChar*> >::type |                                   MemberProxy<JsonObject, TChar*> >::type | ||||||
|   operator[](TChar* key) const { |   operator[](TChar* key) const { | ||||||
|     return MemberProxy<ObjectRef, TChar*>(*this, key); |     return MemberProxy<JsonObject, TChar*>(*this, key); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   FORCE_INLINE void remove(iterator it) const { |   FORCE_INLINE void remove(iterator it) const { | ||||||
| @@ -134,13 +134,13 @@ class ObjectRef : public VariantOperators<ObjectRef> { | |||||||
|   FORCE_INLINE JsonArray createNestedArray(TChar* key) const; |   FORCE_INLINE JsonArray createNestedArray(TChar* key) const; | ||||||
| 
 | 
 | ||||||
|   template <typename TString> |   template <typename TString> | ||||||
|   ObjectRef createNestedObject(const TString& key) const { |   JsonObject createNestedObject(const TString& key) const { | ||||||
|     return operator[](key).template to<ObjectRef>(); |     return operator[](key).template to<JsonObject>(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   template <typename TChar> |   template <typename TChar> | ||||||
|   ObjectRef createNestedObject(TChar* key) const { |   JsonObject createNestedObject(TChar* key) const { | ||||||
|     return operator[](key).template to<ObjectRef>(); |     return operator[](key).template to<JsonObject>(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  private: |  private: | ||||||
| @@ -175,18 +175,18 @@ class ObjectRef : public VariantOperators<ObjectRef> { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| template <> | template <> | ||||||
| struct Converter<ObjectRef> : private VariantAttorney { | struct Converter<JsonObject> : private VariantAttorney { | ||||||
|   static void toJson(VariantConstRef src, VariantRef dst) { |   static void toJson(VariantConstRef src, VariantRef dst) { | ||||||
|     variantCopyFrom(getData(dst), getData(src), getPool(dst)); |     variantCopyFrom(getData(dst), getData(src), getPool(dst)); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static ObjectRef fromJson(VariantRef src) { |   static JsonObject fromJson(VariantRef src) { | ||||||
|     VariantData* data = getData(src); |     VariantData* data = getData(src); | ||||||
|     MemoryPool* pool = getPool(src); |     MemoryPool* pool = getPool(src); | ||||||
|     return ObjectRef(pool, data != 0 ? data->asObject() : 0); |     return JsonObject(pool, data != 0 ? data->asObject() : 0); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static InvalidConversion<VariantConstRef, ObjectRef> fromJson( |   static InvalidConversion<VariantConstRef, JsonObject> fromJson( | ||||||
|       VariantConstRef); |       VariantConstRef); | ||||||
| 
 | 
 | ||||||
|   static bool checkJson(VariantConstRef) { |   static bool checkJson(VariantConstRef) { | ||||||
| @@ -5,17 +5,17 @@ | |||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <ArduinoJson/Array/JsonArray.hpp> | #include <ArduinoJson/Array/JsonArray.hpp> | ||||||
| #include <ArduinoJson/Object/ObjectRef.hpp> | #include <ArduinoJson/Object/JsonObject.hpp> | ||||||
| 
 | 
 | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
| 
 | 
 | ||||||
| template <typename TString> | template <typename TString> | ||||||
| inline JsonArray ObjectRef::createNestedArray(const TString& key) const { | inline JsonArray JsonObject::createNestedArray(const TString& key) const { | ||||||
|   return operator[](key).template to<JsonArray>(); |   return operator[](key).template to<JsonArray>(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| template <typename TChar> | template <typename TChar> | ||||||
| inline JsonArray ObjectRef::createNestedArray(TChar* key) const { | inline JsonArray JsonObject::createNestedArray(TChar* key) const { | ||||||
|   return operator[](key).template to<JsonArray>(); |   return operator[](key).template to<JsonArray>(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @@ -34,16 +34,16 @@ inline JsonArray VariantRefBase<TDerived>::createNestedArray(TChar* key) const { | |||||||
| 
 | 
 | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| template <typename TString> | template <typename TString> | ||||||
| inline ObjectRef VariantRefBase<TDerived>::createNestedObject( | inline JsonObject VariantRefBase<TDerived>::createNestedObject( | ||||||
|     const TString& key) const { |     const TString& key) const { | ||||||
|   return operator[](key).template to<ObjectRef>(); |   return operator[](key).template to<JsonObject>(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| template <typename TChar> | template <typename TChar> | ||||||
| inline ObjectRef VariantRefBase<TDerived>::createNestedObject( | inline JsonObject VariantRefBase<TDerived>::createNestedObject( | ||||||
|     TChar* key) const { |     TChar* key) const { | ||||||
|   return operator[](key).template to<ObjectRef>(); |   return operator[](key).template to<JsonObject>(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| @@ -10,7 +10,7 @@ | |||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| class ObjectConstRef : public VariantOperators<ObjectConstRef> { | class ObjectConstRef : public VariantOperators<ObjectConstRef> { | ||||||
|   friend class ObjectRef; |   friend class JsonObject; | ||||||
|   friend class VariantAttorney; |   friend class VariantAttorney; | ||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ class PairPtr { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| class ObjectIterator { | class ObjectIterator { | ||||||
|   friend class ObjectRef; |   friend class JsonObject; | ||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   ObjectIterator() : _slot(0) {} |   ObjectIterator() : _slot(0) {} | ||||||
| @@ -81,7 +81,7 @@ class PairConstPtr { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| class ObjectConstIterator { | class ObjectConstIterator { | ||||||
|   friend class ObjectRef; |   friend class JsonObject; | ||||||
|  |  | ||||||
|  public: |  public: | ||||||
|   ObjectConstIterator() : _slot(0) {} |   ObjectConstIterator() : _slot(0) {} | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ namespace ARDUINOJSON_NAMESPACE { | |||||||
|  |  | ||||||
| // Forward declarations. | // Forward declarations. | ||||||
| class JsonArray; | class JsonArray; | ||||||
| class ObjectRef; | class JsonObject; | ||||||
|  |  | ||||||
| class VariantConstRef : public VariantTag, | class VariantConstRef : public VariantTag, | ||||||
|                         public VariantOperators<VariantConstRef> { |                         public VariantOperators<VariantConstRef> { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
| #include <ArduinoJson/Configuration.hpp> | #include <ArduinoJson/Configuration.hpp> | ||||||
| #include <ArduinoJson/Numbers/convertNumber.hpp> | #include <ArduinoJson/Numbers/convertNumber.hpp> | ||||||
| #include <ArduinoJson/Numbers/parseNumber.hpp> | #include <ArduinoJson/Numbers/parseNumber.hpp> | ||||||
| #include <ArduinoJson/Object/ObjectRef.hpp> | #include <ArduinoJson/Object/JsonObject.hpp> | ||||||
| #include <ArduinoJson/Variant/VariantRef.hpp> | #include <ArduinoJson/Variant/VariantRef.hpp> | ||||||
|  |  | ||||||
| #include <string.h>  // for strcmp | #include <string.h>  // for strcmp | ||||||
| @@ -128,9 +128,9 @@ VariantRefBase<TDerived>::to() const { | |||||||
|  |  | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
| template <typename T> | 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 { | VariantRefBase<TDerived>::to() const { | ||||||
|   return ObjectRef(getPool(), variantToObject(getOrCreateData())); |   return JsonObject(getPool(), variantToObject(getOrCreateData())); | ||||||
| } | } | ||||||
|  |  | ||||||
| template <typename TDerived> | template <typename TDerived> | ||||||
|   | |||||||
| @@ -78,9 +78,10 @@ class VariantRefBase : public VariantTag { | |||||||
|   template <typename T> |   template <typename T> | ||||||
|   typename enable_if<is_same<T, JsonArray>::value, JsonArray>::type to() const; |   typename enable_if<is_same<T, JsonArray>::value, JsonArray>::type to() const; | ||||||
|   // |   // | ||||||
|   // ObjectRef to<ObjectRef>() |   // JsonObject to<JsonObject>() | ||||||
|   template <typename T> |   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>() |   // VariantRef to<VariantRef>() | ||||||
|   template <typename T> |   template <typename T> | ||||||
| @@ -200,7 +201,7 @@ class VariantRefBase : public VariantTag { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   FORCE_INLINE JsonArray createNestedArray() const; |   FORCE_INLINE JsonArray createNestedArray() const; | ||||||
|   FORCE_INLINE ObjectRef createNestedObject() const; |   FORCE_INLINE JsonObject createNestedObject() const; | ||||||
|   FORCE_INLINE ElementProxy<TDerived> operator[](size_t index) const; |   FORCE_INLINE ElementProxy<TDerived> operator[](size_t index) const; | ||||||
|  |  | ||||||
|   template <typename TString> |   template <typename TString> | ||||||
| @@ -228,10 +229,10 @@ class VariantRefBase : public VariantTag { | |||||||
|   FORCE_INLINE JsonArray createNestedArray(TChar* key) const; |   FORCE_INLINE JsonArray createNestedArray(TChar* key) const; | ||||||
|  |  | ||||||
|   template <typename TString> |   template <typename TString> | ||||||
|   ObjectRef createNestedObject(const TString& key) const; |   JsonObject createNestedObject(const TString& key) const; | ||||||
|  |  | ||||||
|   template <typename TChar> |   template <typename TChar> | ||||||
|   ObjectRef createNestedObject(TChar* key) const; |   JsonObject createNestedObject(TChar* key) const; | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   TDerived& derived() { |   TDerived& derived() { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
| class JsonArray; | class JsonArray; | ||||||
| class ObjectRef; | class JsonObject; | ||||||
| class VariantRef; | class VariantRef; | ||||||
|  |  | ||||||
| // A metafunction that returns the type of the value returned by | // A metafunction that returns the type of the value returned by | ||||||
| @@ -21,8 +21,8 @@ struct VariantTo<JsonArray> { | |||||||
|   typedef JsonArray type; |   typedef JsonArray type; | ||||||
| }; | }; | ||||||
| template <> | template <> | ||||||
| struct VariantTo<ObjectRef> { | struct VariantTo<JsonObject> { | ||||||
|   typedef ObjectRef type; |   typedef JsonObject type; | ||||||
| }; | }; | ||||||
| template <> | template <> | ||||||
| struct VariantTo<VariantRef> { | struct VariantTo<VariantRef> { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user