Files
ArduinoJson/srcs/JsonBuffer.h

33 lines
585 B
C
Raw Normal View History

#pragma once
2014-10-05 14:40:03 +02:00
#include "JsonArray.h"
#include "JsonObject.h"
class JsonBuffer
{
friend class JsonContainer;
public:
2014-10-05 14:40:03 +02:00
virtual ~JsonBuffer() {};
JsonArray createArray()
{
return JsonArray(createContainerNode(JSON_ARRAY));
}
JsonObject createObject()
{
return JsonObject(createContainerNode(JSON_OBJECT));
}
JsonValue createValue();
protected:
virtual JsonNode* allocateNode() = 0;
private:
JsonNode* createNode(JsonNodeType type);
2014-10-05 14:40:03 +02:00
JsonNode* createContainerNode(JsonNodeType type);
};