forked from bblanchon/ArduinoJson
-
Notifications
You must be signed in to change notification settings - Fork 2
/
JsonArrayIterator.h
46 lines (38 loc) · 991 Bytes
/
JsonArrayIterator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#pragma once
#include "JsonValue.h"
#include "JsonToken.h"
namespace ArduinoJson
{
namespace Parser
{
// An iterator for JsonArray
class JsonArrayIterator : JsonToken
{
public:
// Create an iterator pointing at the specified JsonToken
JsonArrayIterator(JsonToken token)
: JsonToken(token)
{
}
// Move iterator forward
void operator++()
{
*this = JsonArrayIterator(nextSibling());
}
// Get the value pointed by the iterator
JsonValue operator*() const
{
return JsonValue(*this);
}
// Test iterator equality
bool operator!= (const JsonArrayIterator& other) const
{
return JsonToken::operator!=(other);
}
};
}
}