mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-15 19:42:12 +02:00
Test that adding the same value twice doesn't increase the size of the object
This commit is contained in:
@ -1,15 +1,21 @@
|
||||
#include "JsonBuffer.h"
|
||||
//#include "JsonNode.h"
|
||||
#include "JsonNode.h"
|
||||
#include "JsonObject.h"
|
||||
#include <string.h> // for memset
|
||||
|
||||
|
||||
JsonObject JsonBuffer::createObject()
|
||||
{
|
||||
allocateNode();
|
||||
return JsonObject(this);
|
||||
JsonNode* node = createNode(JSON_OBJECT);
|
||||
return JsonObject(this, node);
|
||||
}
|
||||
|
||||
void JsonBuffer::createNode()
|
||||
JsonNode* JsonBuffer::createNode(JsonNodeType type)
|
||||
{
|
||||
allocateNode();
|
||||
JsonNode* node = allocateNode();
|
||||
if (!node) return 0;
|
||||
|
||||
memset(node, 0, sizeof(JsonNode));
|
||||
node->type = type;
|
||||
return node;
|
||||
}
|
Reference in New Issue
Block a user