mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 12:32:17 +02:00
32 lines
508 B
C++
32 lines
508 B
C++
#pragma once
|
|
|
|
#include "JsonContainer.h"
|
|
|
|
class JsonArray : public JsonContainer
|
|
{
|
|
public:
|
|
JsonArray()
|
|
{
|
|
}
|
|
|
|
explicit JsonArray(JsonNode* node)
|
|
: JsonContainer(node)
|
|
{
|
|
}
|
|
|
|
JsonValue operator[](int index) const;
|
|
|
|
template<typename T>
|
|
void add(T value)
|
|
{
|
|
JsonNode* node = createNode(JSON_UNDEFINED);
|
|
if (!node) return;
|
|
|
|
JsonValue jsonValue(node);
|
|
jsonValue = value;
|
|
|
|
addChild(node);
|
|
}
|
|
};
|
|
|