Made JsonNode::type private

This commit is contained in:
Benoit Blanchon
2014-10-09 14:17:09 +02:00
parent b0e12e8852
commit 24c60619d5
10 changed files with 62 additions and 61 deletions

View File

@ -1,5 +1,6 @@
#include "JsonBuffer.h"
#include <new>
#include <string.h> // for memset
#include "JsonObject.h"
@ -8,16 +9,13 @@
JsonValue JsonBuffer::createValue()
{
JsonNode* node = createNode(JSON_UNDEFINED);
return JsonValue(node);
return JsonValue(createNode());
}
JsonNode* JsonBuffer::createNode(JsonNodeType type)
JsonNode* JsonBuffer::createNode()
{
JsonNode* node = allocateNode();
void* node = allocateNode();
if (!node) return 0;
memset(node, 0, sizeof(JsonNode));
node->type = type;
return node;
return new (node) JsonNode();
}