Huge refactoring in progress...

This commit is contained in:
Benoit Blanchon
2014-10-29 21:18:27 +01:00
parent ba2b142c8a
commit 5cf744dbac
6 changed files with 58 additions and 16 deletions

View File

@ -10,6 +10,7 @@
#include "JsonObjectIterator.hpp"
#include "JsonPrintable.hpp"
#include "Internals/JsonObjectNode.hpp"
#include "JsonArray.hpp"
namespace ArduinoJson {
class JsonObject : public JsonPrintable {
@ -31,6 +32,14 @@ class JsonObject : public JsonPrintable {
(*this)[key] = value;
}
void add(key_type key, JsonArray &nestedArray) {
(*this)[key] = nestedArray;
}
void add(key_type key, JsonObject &nestedObject) {
(*this)[key] = nestedObject;
}
JsonArray &createNestedArray(key_type key);
JsonObject &createNestedObject(key_type key);
@ -45,6 +54,9 @@ class JsonObject : public JsonPrintable {
virtual void writeTo(Internals::JsonWriter &writer) const;
private:
JsonObject(const JsonObject&); // copy is forbidden, use a reference instead
JsonObject& operator=(const JsonObject&); // copy is forbidden, use a reference instead
void addNode(Internals::JsonObjectNode *nodeToAdd);
void removeNode(Internals::JsonObjectNode *nodeToRemove);