Parse invalid array

This commit is contained in:
Benoit Blanchon
2014-10-14 17:28:57 +02:00
parent f468db6757
commit 081b345e7c
5 changed files with 51 additions and 20 deletions

View File

@ -1,9 +1,7 @@
#include "JsonBuffer.h"
#include <new>
#include <string.h> // for memset
#include "JsonObject.h"
#include "JsonValue.h"
#include "Internals/JsonNode.h"
@ -20,7 +18,19 @@ JsonNode* JsonBuffer::createNode()
return new (node) JsonNode();
}
JsonArray JsonBuffer::parseArray(char const *string)
JsonArray JsonBuffer::parseArray(const char* json)
{
return JsonArray();
JsonNode* root;
if (json[0] == '[')
{
root = createNode();
root->setAsArray(this);
}
else
{
root = 0;
}
return JsonArray(root);
}