forked from bblanchon/ArduinoJson
Test that JsonObject.size() is increased when values are added
This commit is contained in:
@ -1,42 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
class JsonBuffer;
|
||||
struct JsonNode;
|
||||
class JsonValue;
|
||||
struct JsonNode;
|
||||
|
||||
class JsonObject
|
||||
{
|
||||
// friend class JsonValue;
|
||||
//
|
||||
//public:
|
||||
// JsonObject(JsonBuffer& buffer, JsonNode& node)
|
||||
// : _buffer(buffer), _node(node)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// JsonObject createObject(const char* key)
|
||||
// {
|
||||
// JsonObject innerObject = _buffer.createObject();
|
||||
// addNodeAt(key, innerObject._node);
|
||||
// return innerObject;
|
||||
// }
|
||||
//
|
||||
// JsonValue& operator[](const char* key);
|
||||
// friend class JsonValue;
|
||||
//
|
||||
//public:
|
||||
// JsonObject(JsonBuffer& buffer, JsonNode& node)
|
||||
// : _buffer(buffer), _node(node)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// JsonObject createObject(const char* key)
|
||||
// {
|
||||
// JsonObject innerObject = _buffer.createObject();
|
||||
// addNodeAt(key, innerObject._node);
|
||||
// return innerObject;
|
||||
// }
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
int size()
|
||||
|
||||
explicit JsonObject()
|
||||
: _size(0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//private:
|
||||
// JsonBuffer& _buffer;
|
||||
// JsonNode& _node;
|
||||
//
|
||||
// void addNodeAt(char const* key, JsonNode& node);
|
||||
// JsonNode& getNodeAt(const char* key);
|
||||
//
|
||||
// // TODO: pull up
|
||||
// void appendChild(JsonNode& newChild);
|
||||
int size()
|
||||
{
|
||||
return _size;
|
||||
}
|
||||
|
||||
JsonValue operator[](const char* key);
|
||||
|
||||
private:
|
||||
|
||||
int _size;
|
||||
|
||||
// JsonBuffer& _buffer;
|
||||
// JsonNode& _node;
|
||||
//
|
||||
// void addNodeAt(char const* key, JsonNode& node);
|
||||
// JsonNode& getNodeAt(const char* key);
|
||||
//
|
||||
// // TODO: pull up
|
||||
// void appendChild(JsonNode& newChild);
|
||||
};
|
Reference in New Issue
Block a user