forked from bblanchon/ArduinoJson
Epic refactoring in progress
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
#include "Internals/JsonObjectConstIterator.hpp"
|
||||
#include "Internals/JsonObjectIterator.hpp"
|
||||
#include "JsonContainer.hpp"
|
||||
#include "Internals/JsonObjectNode.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
class JsonObject : public JsonContainer {
|
||||
@ -17,9 +18,7 @@ class JsonObject : public JsonContainer {
|
||||
typedef Internals::JsonObjectIterator iterator;
|
||||
typedef Internals::JsonObjectConstIterator const_iterator;
|
||||
|
||||
JsonObject() {}
|
||||
|
||||
explicit JsonObject(Internals::JsonNode *node) : JsonContainer(node) {}
|
||||
JsonObject(JsonBuffer *buffer) : _buffer(buffer) {}
|
||||
|
||||
JsonValue operator[](const char *key);
|
||||
void remove(const char *key);
|
||||
@ -27,16 +26,17 @@ class JsonObject : public JsonContainer {
|
||||
JsonArray createNestedArray(const char *key);
|
||||
JsonObject createNestedObject(const char *key);
|
||||
|
||||
bool success() { return _node && _node->isObject(); }
|
||||
|
||||
iterator begin() { return iterator(firstChild()); }
|
||||
iterator begin() { return iterator(_firstChild); }
|
||||
iterator end() { return iterator(0); }
|
||||
|
||||
const_iterator begin() const { return const_iterator(firstChild()); }
|
||||
const_iterator begin() const { return const_iterator(_firstChild); }
|
||||
const_iterator end() const { return const_iterator(0); }
|
||||
|
||||
private:
|
||||
Internals::JsonNode *getPairAt(const char *key);
|
||||
Internals::JsonNode *getOrCreateValueAt(const char *key);
|
||||
|
||||
JsonBuffer *_buffer;
|
||||
Internals::JsonObjectNode *_firstChild;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user