mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 04:52:22 +02:00
39 lines
836 B
C++
39 lines
836 B
C++
// Copyright Benoit Blanchon 2014
|
|
// MIT License
|
|
//
|
|
// Arduino JSON library
|
|
// https://github.com/bblanchon/ArduinoJson
|
|
|
|
#pragma once
|
|
|
|
#include "ForwardDeclarations.hpp"
|
|
#include "Internals/JsonObjectNode.hpp"
|
|
|
|
namespace ArduinoJson {
|
|
|
|
class JsonObjectConstIterator {
|
|
public:
|
|
explicit JsonObjectConstIterator(Internals::JsonObjectNode *node)
|
|
: _node(node) {}
|
|
|
|
const JsonPair &operator*() { return _node->pair; }
|
|
const JsonPair *operator->() { return &_node->pair; }
|
|
|
|
bool operator==(const JsonObjectConstIterator &other) const {
|
|
return _node == other._node;
|
|
}
|
|
|
|
bool operator!=(const JsonObjectConstIterator &other) const {
|
|
return _node != other._node;
|
|
}
|
|
|
|
JsonObjectConstIterator &operator++() {
|
|
if (_node) _node = _node->next;
|
|
return *this;
|
|
}
|
|
|
|
private:
|
|
Internals::JsonObjectNode *_node;
|
|
};
|
|
}
|