2014-09-27 12:16:20 +02:00
|
|
|
#include "JsonBuffer.h"
|
2014-09-27 14:43:19 +02:00
|
|
|
#include "JsonNode.h"
|
2014-09-27 12:16:20 +02:00
|
|
|
#include "JsonObject.h"
|
2014-09-27 14:43:19 +02:00
|
|
|
#include <string.h> // for memset
|
2014-09-27 12:16:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
JsonObject JsonBuffer::createObject()
|
|
|
|
{
|
2014-09-27 14:43:19 +02:00
|
|
|
JsonNode* node = createNode(JSON_OBJECT);
|
|
|
|
return JsonObject(this, node);
|
2014-09-27 12:16:20 +02:00
|
|
|
}
|
|
|
|
|
2014-09-27 14:43:19 +02:00
|
|
|
JsonNode* JsonBuffer::createNode(JsonNodeType type)
|
2014-09-27 12:16:20 +02:00
|
|
|
{
|
2014-09-27 14:43:19 +02:00
|
|
|
JsonNode* node = allocateNode();
|
|
|
|
if (!node) return 0;
|
|
|
|
|
|
|
|
memset(node, 0, sizeof(JsonNode));
|
|
|
|
node->type = type;
|
|
|
|
return node;
|
2014-09-27 12:16:20 +02:00
|
|
|
}
|