Files
thirdparty-ArduinoJson/include/ArduinoJson/JsonObjectKeyValue.hpp
2014-10-24 16:12:05 +02:00

36 lines
743 B
C++

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