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 "JsonArrayIterator.hpp"
#include "JsonArrayConstIterator.hpp"
#include "JsonPrintable.hpp"
#include "JsonObject.hpp"
namespace ArduinoJson {
class JsonArray : public JsonPrintable {
@ -22,6 +23,8 @@ class JsonArray : public JsonPrintable {
int size() const;
bool success() {return _buffer != NULL;}
value_type &operator[](int index) const;
value_type &add();
@ -30,6 +33,14 @@ class JsonArray : public JsonPrintable {
add().set(value);
}
void add(JsonArray &nestedArray) {
add().set(nestedArray);
}
void add(JsonObject&nestedObject){
add().set(nestedObject);
}
JsonArray &createNestedArray();
JsonObject &createNestedObject();
@ -44,6 +55,9 @@ class JsonArray : public JsonPrintable {
virtual void writeTo(Internals::JsonWriter &writer) const;
private:
JsonArray(const JsonArray&); // copy is forbidden, use a reference instead
JsonArray& operator=(const JsonArray&); // copy is forbidden, use a reference instead
inline void addNode(Internals::JsonArrayNode *node);
JsonBuffer *_buffer;