Improved JsonArrayIterator

This commit is contained in:
Benoit Blanchon
2014-10-24 16:12:05 +02:00
parent 8071434515
commit bbef8931a6
5 changed files with 46 additions and 31 deletions

View File

@@ -9,10 +9,12 @@
#include "ArduinoJson/JsonValue.hpp"
namespace ArduinoJson {
class JsonObjectKeyValue {
public:
explicit JsonObjectKeyValue(Internals::JsonNode *node) : _node(node) {}
class JsonObjectIterator;
class JsonObjectKeyValue {
friend class JsonObjectIterator;
public:
const char *key() const { return _node->getAsObjectKey(); }
JsonValue value() { return JsonValue(_node->getAsObjectValue()); }
@@ -25,9 +27,9 @@ class JsonObjectKeyValue {
return _node != other._node;
}
Internals::JsonNode *next() { return _node->next; }
private:
explicit JsonObjectKeyValue(Internals::JsonNode *node) : _node(node) {}
Internals::JsonNode *_node;
};
}