Files
ArduinoJson/include/ArduinoJson/JsonPair.hpp

27 lines
569 B
C++
Raw Normal View History

2014-10-25 15:55:58 +02:00
// Copyright Benoit Blanchon 2014
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
#pragma once
2014-10-26 21:18:09 +01:00
#include "JsonValue.hpp"
2014-10-27 22:50:50 +01:00
#include "Internals/JsonObjectNode.hpp"
2014-10-25 15:55:58 +02:00
namespace ArduinoJson {
class JsonPair {
2014-10-27 22:50:50 +01:00
friend class Internals::JsonObjectIterator;
friend class Internals::JsonObjectConstIterator;
2014-10-25 15:55:58 +02:00
public:
2014-10-27 22:50:50 +01:00
JsonPair(Internals::JsonObjectNode *node) : _node(node) {}
2014-10-25 15:55:58 +02:00
2014-10-27 22:50:50 +01:00
const char *key() const { return _node->key; }
JsonValue value() { return JsonValue(&_node->value); }
2014-10-25 15:55:58 +02:00
2014-10-26 21:18:09 +01:00
private:
2014-10-27 22:50:50 +01:00
Internals::JsonObjectNode *_node;
2014-10-25 15:55:58 +02:00
};
}