forked from bblanchon/ArduinoJson
Renamed NodeIterator into ListIterator
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "NodeIterator.hpp"
|
||||
#include "NodeConstIterator.hpp"
|
||||
#include "ListIterator.hpp"
|
||||
#include "ListConstIterator.hpp"
|
||||
#include "../JsonBuffer.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
@ -18,8 +18,8 @@ class List {
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef Node<T> node_type;
|
||||
typedef NodeIterator<T> iterator;
|
||||
typedef NodeConstIterator<T> const_iterator;
|
||||
typedef ListIterator<T> iterator;
|
||||
typedef ListConstIterator<T> const_iterator;
|
||||
|
||||
List(JsonBuffer *buffer) : _buffer(buffer), _firstNode(NULL) {}
|
||||
|
||||
@ -41,4 +41,4 @@ class List {
|
||||
node_type *_firstNode;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,22 +10,22 @@ namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
template <typename T>
|
||||
class NodeConstIterator {
|
||||
class ListConstIterator {
|
||||
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->() { return &_node->content; }
|
||||
|
||||
bool operator==(const NodeConstIterator<T> &other) const {
|
||||
bool operator==(const ListConstIterator<T> &other) const {
|
||||
return _node == other._node;
|
||||
}
|
||||
|
||||
bool operator!=(const NodeConstIterator<T> &other) const {
|
||||
bool operator!=(const ListConstIterator<T> &other) const {
|
||||
return _node != other._node;
|
||||
}
|
||||
|
||||
NodeConstIterator<T> &operator++() {
|
||||
ListConstIterator<T> &operator++() {
|
||||
if (_node) _node = _node->next;
|
||||
return *this;
|
||||
}
|
@ -12,22 +12,22 @@ namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
template <typename T>
|
||||
class NodeIterator {
|
||||
class ListIterator {
|
||||
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->() { return &_node->content; }
|
||||
|
||||
bool operator==(const NodeIterator<T> &other) const {
|
||||
bool operator==(const ListIterator<T> &other) const {
|
||||
return _node == other._node;
|
||||
}
|
||||
|
||||
bool operator!=(const NodeIterator<T> &other) const {
|
||||
bool operator!=(const ListIterator<T> &other) const {
|
||||
return _node != other._node;
|
||||
}
|
||||
|
||||
NodeIterator<T> &operator++() {
|
||||
ListIterator<T> &operator++() {
|
||||
if (_node) _node = _node->next;
|
||||
return *this;
|
||||
}
|
Reference in New Issue
Block a user