44
55#pragma once
66
7- #include < ArduinoJson/Array/ArrayData.hpp>
87#include < ArduinoJson/Variant/VariantCompare.hpp>
9- #include < ArduinoJson/Variant/VariantData .hpp>
8+ #include < ArduinoJson/Variant/VariantImpl .hpp>
109
1110ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1211
13- inline ArrayImpl ::iterator ArrayImpl ::at (size_t index) const {
14- if (isNull ())
12+ inline VariantImpl ::iterator VariantImpl ::at (size_t index) const {
13+ if (! isArray ())
1514 return iterator ();
1615
1716 auto it = createIterator ();
@@ -22,8 +21,8 @@ inline ArrayImpl::iterator ArrayImpl::at(size_t index) const {
2221 return it;
2322}
2423
25- inline VariantData* ArrayImpl ::addElement (VariantData* data,
26- ResourceManager* resources) {
24+ inline VariantData* VariantImpl ::addElement (VariantData* data,
25+ ResourceManager* resources) {
2726 ARDUINOJSON_ASSERT (data != nullptr );
2827 ARDUINOJSON_ASSERT (data->isArray ());
2928 ARDUINOJSON_ASSERT (resources != nullptr );
@@ -35,7 +34,7 @@ inline VariantData* ArrayImpl::addElement(VariantData* data,
3534 return slot.ptr ();
3635}
3736
38- inline VariantData* ArrayImpl ::getOrAddElement (size_t index) {
37+ inline VariantData* VariantImpl ::getOrAddElement (size_t index) {
3938 auto it = createIterator ();
4039 while (!it.done () && index > 0 ) {
4140 it.next (resources_);
@@ -53,17 +52,17 @@ inline VariantData* ArrayImpl::getOrAddElement(size_t index) {
5352 return element;
5453}
5554
56- inline VariantData* ArrayImpl ::getElement (size_t index) const {
55+ inline VariantData* VariantImpl ::getElement (size_t index) const {
5756 return at (index).data ();
5857}
5958
60- inline void ArrayImpl ::removeElement (size_t index) {
59+ inline void VariantImpl ::removeElement (size_t index) {
6160 remove (at (index));
6261}
6362
6463template <typename T>
65- inline bool ArrayImpl ::addValue (const T& value, VariantData* data,
66- ResourceManager* resources) {
64+ inline bool VariantImpl ::addValue (const T& value, VariantData* data,
65+ ResourceManager* resources) {
6766 ARDUINOJSON_ASSERT (data != nullptr );
6867 ARDUINOJSON_ASSERT (resources != nullptr );
6968 auto slot = resources->allocVariant ();
0 commit comments