Added JsonArrayIterator

This commit is contained in:
Benoit Blanchon
2014-10-22 17:59:59 +02:00
parent 9946abf731
commit d842e246c9
6 changed files with 87 additions and 5 deletions

View File

@ -0,0 +1,42 @@
#pragma once
#include "ArduinoJson/JsonValue.hpp"
namespace ArduinoJson
{
class JsonArray;
class JsonArrayIterator
{
friend class JsonArray;
public:
explicit JsonArrayIterator(Internals::JsonNode* node)
: _node(node)
{
}
void operator++()
{
_node = _node->next;
}
JsonValue operator*() const
{
return JsonValue(_node);
}
bool operator==(const JsonArrayIterator& other) const
{
return _node == other._node;
}
bool operator!=(const JsonArrayIterator& other) const
{
return _node != other._node;
}
private:
Internals::JsonNode* _node;
};
}