mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 10:47:34 +02:00
Renamed NodeIterator into ListIterator
This commit is contained in:
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "NodeIterator.hpp"
|
#include "ListIterator.hpp"
|
||||||
#include "NodeConstIterator.hpp"
|
#include "ListConstIterator.hpp"
|
||||||
#include "../JsonBuffer.hpp"
|
#include "../JsonBuffer.hpp"
|
||||||
|
|
||||||
namespace ArduinoJson {
|
namespace ArduinoJson {
|
||||||
@ -18,8 +18,8 @@ class List {
|
|||||||
public:
|
public:
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef Node<T> node_type;
|
typedef Node<T> node_type;
|
||||||
typedef NodeIterator<T> iterator;
|
typedef ListIterator<T> iterator;
|
||||||
typedef NodeConstIterator<T> const_iterator;
|
typedef ListConstIterator<T> const_iterator;
|
||||||
|
|
||||||
List(JsonBuffer *buffer) : _buffer(buffer), _firstNode(NULL) {}
|
List(JsonBuffer *buffer) : _buffer(buffer), _firstNode(NULL) {}
|
||||||
|
|
||||||
@ -41,4 +41,4 @@ class List {
|
|||||||
node_type *_firstNode;
|
node_type *_firstNode;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,22 +10,22 @@ namespace ArduinoJson {
|
|||||||
namespace Internals {
|
namespace Internals {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class NodeConstIterator {
|
class ListConstIterator {
|
||||||
public:
|
public:
|
||||||
explicit NodeConstIterator(const Node<T> *node = NULL) : _node(node) {}
|
explicit ListConstIterator(const Node<T> *node = NULL) : _node(node) {}
|
||||||
|
|
||||||
const T &operator*() const { return _node->content; }
|
const T &operator*() const { return _node->content; }
|
||||||
const T *operator->() { return &_node->content; }
|
const T *operator->() { return &_node->content; }
|
||||||
|
|
||||||
bool operator==(const NodeConstIterator<T> &other) const {
|
bool operator==(const ListConstIterator<T> &other) const {
|
||||||
return _node == other._node;
|
return _node == other._node;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const NodeConstIterator<T> &other) const {
|
bool operator!=(const ListConstIterator<T> &other) const {
|
||||||
return _node != other._node;
|
return _node != other._node;
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeConstIterator<T> &operator++() {
|
ListConstIterator<T> &operator++() {
|
||||||
if (_node) _node = _node->next;
|
if (_node) _node = _node->next;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
@ -12,22 +12,22 @@ namespace ArduinoJson {
|
|||||||
namespace Internals {
|
namespace Internals {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class NodeIterator {
|
class ListIterator {
|
||||||
public:
|
public:
|
||||||
explicit NodeIterator(Node<T> *node = NULL) : _node(node) {}
|
explicit ListIterator(Node<T> *node = NULL) : _node(node) {}
|
||||||
|
|
||||||
T &operator*() const { return _node->content; }
|
T &operator*() const { return _node->content; }
|
||||||
T *operator->() { return &_node->content; }
|
T *operator->() { return &_node->content; }
|
||||||
|
|
||||||
bool operator==(const NodeIterator<T> &other) const {
|
bool operator==(const ListIterator<T> &other) const {
|
||||||
return _node == other._node;
|
return _node == other._node;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const NodeIterator<T> &other) const {
|
bool operator!=(const ListIterator<T> &other) const {
|
||||||
return _node != other._node;
|
return _node != other._node;
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeIterator<T> &operator++() {
|
ListIterator<T> &operator++() {
|
||||||
if (_node) _node = _node->next;
|
if (_node) _node = _node->next;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
Reference in New Issue
Block a user