forked from bblanchon/ArduinoJson
Remove createNestedArray() and createNestedObject()
This commit is contained in:
1 parent
cdc1262127
commit
7f459adc4b
37 files changed
+99
-547
No files matched your search
@@ -130,16 +130,6 @@ class JsonArray : public detail::VariantOperators<JsonArray> {
|
||||
return {*this, index};
|
||||
}
|
||||
|
||||
// Creates an object and appends it to the array.
|
||||
// https://arduinojson.org/v6/api/jsonarray/createnestedobject/
|
||||
FORCE_INLINE JsonObject createNestedObject() const;
|
||||
|
||||
// Creates an array and appends it to the array.
|
||||
// https://arduinojson.org/v6/api/jsonarray/createnestedarray/
|
||||
FORCE_INLINE JsonArray createNestedArray() const {
|
||||
return add<JsonArray>();
|
||||
}
|
||||
|
||||
operator JsonVariantConst() const {
|
||||
return JsonVariantConst(collectionToVariant(data_), resources_);
|
||||
}
|
||||
|
||||
@@ -7,26 +7,8 @@
|
||||
#include <ArduinoJson/Array/JsonArray.hpp>
|
||||
#include <ArduinoJson/Object/JsonObject.hpp>
|
||||
|
||||
ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||
|
||||
inline JsonObject JsonArray::createNestedObject() const {
|
||||
return add<JsonObject>();
|
||||
}
|
||||
|
||||
ARDUINOJSON_END_PUBLIC_NAMESPACE
|
||||
|
||||
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
||||
|
||||
template <typename TDerived>
|
||||
inline JsonArray VariantRefBase<TDerived>::createNestedArray() const {
|
||||
return add<JsonArray>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
inline JsonObject VariantRefBase<TDerived>::createNestedObject() const {
|
||||
return add<JsonObject>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
inline ElementProxy<TDerived> VariantRefBase<TDerived>::operator[](
|
||||
size_t index) const {
|
||||
|
||||
@@ -152,46 +152,6 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
|
||||
return getVariant().template to<T>();
|
||||
}
|
||||
|
||||
// Creates an array and appends it to the root array.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedarray/
|
||||
JsonArray createNestedArray() {
|
||||
return add<JsonArray>();
|
||||
}
|
||||
|
||||
// Creates an array and adds it to the root object.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedarray/
|
||||
template <typename TChar>
|
||||
JsonArray createNestedArray(TChar* key) {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
// Creates an array and adds it to the root object.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedarray/
|
||||
template <typename TString>
|
||||
JsonArray createNestedArray(const TString& key) {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
// Creates an object and appends it to the root array.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedobject/
|
||||
JsonObject createNestedObject() {
|
||||
return add<JsonObject>();
|
||||
}
|
||||
|
||||
// Creates an object and adds it to the root object.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedobject/
|
||||
template <typename TChar>
|
||||
JsonObject createNestedObject(TChar* key) {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
// Creates an object and adds it to the root object.
|
||||
// https://arduinojson.org/v6/api/jsondocument/createnestedobject/
|
||||
template <typename TString>
|
||||
JsonObject createNestedObject(const TString& key) {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
// Returns true if the root object contains the specified key.
|
||||
// https://arduinojson.org/v6/api/jsondocument/containskey/
|
||||
template <typename TChar>
|
||||
|
||||
@@ -166,30 +166,6 @@ class JsonObject : public detail::VariantOperators<JsonObject> {
|
||||
resources_) != 0;
|
||||
}
|
||||
|
||||
// Creates an array and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonobject/createnestedarray/
|
||||
template <typename TString>
|
||||
FORCE_INLINE JsonArray createNestedArray(const TString& key) const;
|
||||
|
||||
// Creates an array and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonobject/createnestedarray/
|
||||
template <typename TChar>
|
||||
FORCE_INLINE JsonArray createNestedArray(TChar* key) const;
|
||||
|
||||
// Creates an object and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonobject/createnestedobject/
|
||||
template <typename TString>
|
||||
JsonObject createNestedObject(const TString& key) const {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
// Creates an object and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonobject/createnestedobject/
|
||||
template <typename TChar>
|
||||
JsonObject createNestedObject(TChar* key) const {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
private:
|
||||
detail::ResourceManager* getResourceManager() const {
|
||||
return resources_;
|
||||
|
||||
@@ -7,49 +7,8 @@
|
||||
#include <ArduinoJson/Array/JsonArray.hpp>
|
||||
#include <ArduinoJson/Object/JsonObject.hpp>
|
||||
|
||||
ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||
|
||||
template <typename TString>
|
||||
inline JsonArray JsonObject::createNestedArray(const TString& key) const {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
template <typename TChar>
|
||||
inline JsonArray JsonObject::createNestedArray(TChar* key) const {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
ARDUINOJSON_END_PUBLIC_NAMESPACE
|
||||
|
||||
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename TString>
|
||||
inline JsonArray VariantRefBase<TDerived>::createNestedArray(
|
||||
const TString& key) const {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename TChar>
|
||||
inline JsonArray VariantRefBase<TDerived>::createNestedArray(TChar* key) const {
|
||||
return operator[](key).template to<JsonArray>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename TString>
|
||||
inline JsonObject VariantRefBase<TDerived>::createNestedObject(
|
||||
const TString& key) const {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename TChar>
|
||||
inline JsonObject VariantRefBase<TDerived>::createNestedObject(
|
||||
TChar* key) const {
|
||||
return operator[](key).template to<JsonObject>();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename TString>
|
||||
inline typename enable_if<IsString<TString>::value, bool>::type
|
||||
|
||||
@@ -191,14 +191,6 @@ class VariantRefBase : public VariantTag {
|
||||
getResourceManager());
|
||||
}
|
||||
|
||||
// Creates an array and appends it to the array.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedarray/
|
||||
FORCE_INLINE JsonArray createNestedArray() const;
|
||||
|
||||
// Creates an object and appends it to the array.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedobject/
|
||||
FORCE_INLINE JsonObject createNestedObject() const;
|
||||
|
||||
// Gets or sets an array element.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/subscript/
|
||||
FORCE_INLINE ElementProxy<TDerived> operator[](size_t index) const;
|
||||
@@ -229,26 +221,6 @@ class VariantRefBase : public VariantTag {
|
||||
MemberProxy<TDerived, TChar*>>::type
|
||||
operator[](TChar* key) const;
|
||||
|
||||
// Creates an array and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedarray/
|
||||
template <typename TString>
|
||||
FORCE_INLINE JsonArray createNestedArray(const TString& key) const;
|
||||
|
||||
// Creates an array and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedarray/
|
||||
template <typename TChar>
|
||||
FORCE_INLINE JsonArray createNestedArray(TChar* key) const;
|
||||
|
||||
// Creates an object and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedobject/
|
||||
template <typename TString>
|
||||
JsonObject createNestedObject(const TString& key) const;
|
||||
|
||||
// Creates an object and adds it to the object.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/createnestedobject/
|
||||
template <typename TChar>
|
||||
JsonObject createNestedObject(TChar* key) const;
|
||||
|
||||
private:
|
||||
TDerived& derived() {
|
||||
return static_cast<TDerived&>(*this);
|
||||
|
||||
Reference in new issue
Block a user