Parse long values

This commit is contained in:
Benoit Blanchon
2014-10-14 21:24:26 +02:00
parent 31c1a3d804
commit 5b6b38564f
6 changed files with 146 additions and 21 deletions

View File

@ -3,6 +3,7 @@
#include <new>
#include "JsonValue.h"
#include "Internals/JsonParser.h"
#include "Internals/JsonNode.h"
JsonValue JsonBuffer::createValue()
@ -18,21 +19,8 @@ JsonNode* JsonBuffer::createNode()
return new (node) JsonNode();
}
JsonArray JsonBuffer::parseArray(const char* json)
JsonArray JsonBuffer::parseArray(char* json)
{
JsonNode* root;
while(*json == ' ') json++;
if (json[0] == '[')
{
root = createNode();
root->setAsArray(this);
}
else
{
root = 0;
}
return JsonArray(root);
JsonParser parser(this, json);
return JsonArray(parser.parseNode());
}