Test JsonObject::prettyPrintTo()

This commit is contained in:
Benoit Blanchon
2014-10-07 11:58:59 +02:00
parent 7a40711af3
commit e28119f03b
7 changed files with 126 additions and 6 deletions

View File

@ -33,6 +33,20 @@ void JsonObject::remove(char const* key)
}
}
JsonObject JsonObject::createNestedObject(char const* key)
{
JsonNode* node = getOrCreateNodeAt(key);
if (node)
{
node->type = JSON_OBJECT;
node->content.asContainer.child = 0;
node->content.asContainer.buffer = _node->content.asContainer.buffer;
}
return JsonObject(node);
}
JsonNode* JsonObject::getOrCreateNodeAt(const char* key)
{
if (!checkNodeType(JSON_OBJECT)) return 0;