mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
Huge refactoring in progress...
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user