forked from bblanchon/ArduinoJson
Extracting a common base class for JsonArray and JsonObject...
This commit is contained in:
@ -34,6 +34,8 @@ class List {
|
||||
|
||||
protected:
|
||||
node_type *createNode();
|
||||
void addNode(node_type *node);
|
||||
void removeNode(node_type *nodeToRemove);
|
||||
|
||||
JsonBuffer *_buffer;
|
||||
node_type *_firstNode;
|
||||
|
@ -15,8 +15,8 @@ template <typename T>
|
||||
struct Node {
|
||||
Node() : next(NULL) {}
|
||||
|
||||
T content;
|
||||
Node<T>* next;
|
||||
T content;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -50,8 +50,6 @@ class JsonArray : public Internals::JsonPrintable<JsonArray>,
|
||||
// constructor is private: instance must be created via a JsonBuffer
|
||||
JsonArray(JsonBuffer *buffer) : List(buffer) {}
|
||||
|
||||
inline void addNode(node_type *node);
|
||||
|
||||
static JsonArray _invalid;
|
||||
};
|
||||
}
|
||||
|
@ -55,8 +55,6 @@ class JsonObject : public Internals::JsonPrintable<JsonObject>,
|
||||
JsonObject(JsonBuffer *buffer) : List(buffer) {}
|
||||
|
||||
JsonVariant &add(key_type key) { return (*this)[key]; }
|
||||
void addNode(node_type *nodeToAdd);
|
||||
void removeNode(node_type *nodeToRemove);
|
||||
|
||||
node_type *getNodeAt(key_type key) const;
|
||||
node_type *getOrCreateNodeAt(key_type key);
|
||||
|
Reference in New Issue
Block a user