Files
thirdparty-ArduinoJson/include/ArduinoJson/JsonObjectIterator.hpp
2014-10-23 23:45:36 +02:00

42 lines
926 B
C++

// Copyright Benoit Blanchon 2014
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
#pragma once
#include "ArduinoJson/JsonObjectKeyValue.hpp"
namespace ArduinoJson {
class JsonObject;
class JsonObjectIterator {
friend class JsonObject;
public:
explicit JsonObjectIterator(Internals::JsonNode *node)
: _objectKeyValue(node) {}
JsonObjectIterator &operator++() {
_objectKeyValue = JsonObjectKeyValue(_objectKeyValue.next());
return *this;
}
JsonObjectKeyValue operator*() const { return _objectKeyValue; }
JsonObjectKeyValue *operator->() { return &_objectKeyValue; }
bool operator==(const JsonObjectIterator &other) const {
return _objectKeyValue == other._objectKeyValue;
}
bool operator!=(const JsonObjectIterator &other) const {
return _objectKeyValue != other._objectKeyValue;
}
private:
JsonObjectKeyValue _objectKeyValue;
};
}