mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 04:22:18 +02:00
Test that JsonArray grows after calling add()
This commit is contained in:
@ -32,12 +32,20 @@ bool JsonContainer::operator==(const JsonContainer & other) const
|
||||
return _node == other._node;
|
||||
}
|
||||
|
||||
void JsonContainer::insertChildAfter(JsonNode* newChild, JsonNode* previous)
|
||||
void JsonContainer::addChild(JsonNode* newChild)
|
||||
{
|
||||
if (previous)
|
||||
previous->next = newChild;
|
||||
else
|
||||
_node->content.asContainer.child = newChild;
|
||||
JsonNode* lastChild = _node->content.asContainer.child;
|
||||
|
||||
if (!lastChild)
|
||||
{
|
||||
_node->content.asContainer.child = newChild = newChild;
|
||||
return;
|
||||
}
|
||||
|
||||
while (lastChild->next)
|
||||
lastChild = lastChild->next;
|
||||
|
||||
lastChild->next = newChild;
|
||||
}
|
||||
|
||||
void JsonContainer::removeChildAfter(JsonNode* child, JsonNode* previous)
|
||||
|
Reference in New Issue
Block a user