mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 12:02:14 +02:00
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Arduino/Printable.h"
|
|
#include "Internals/JsonNodeIterator.h"
|
|
#include "Internals/JsonNode.h"
|
|
#include "Internals/IndentedPrint.h"
|
|
#include "Internals/JsonNodeWrapper.h"
|
|
class JsonArray;
|
|
class JsonObject;
|
|
class JsonValue;
|
|
|
|
class JsonContainer : public Printable, public JsonNodeWrapper
|
|
{
|
|
// friend JsonValue;
|
|
friend JsonArray;
|
|
|
|
public:
|
|
|
|
|
|
JsonContainer() {}
|
|
|
|
explicit JsonContainer(JsonNode* node)
|
|
: JsonNodeWrapper(node)
|
|
{
|
|
}
|
|
|
|
size_t size() const;
|
|
|
|
bool operator==(JsonContainer const& other) const;
|
|
|
|
size_t printTo(char* buffer, size_t bufferSize) const;
|
|
virtual size_t printTo(Print& print) const;
|
|
|
|
size_t prettyPrintTo(char* buffer, size_t bufferSize) const;
|
|
size_t prettyPrintTo(ArduinoJson::Generator::IndentedPrint& print) const;
|
|
size_t prettyPrintTo(Print& print) const;
|
|
|
|
protected:
|
|
|
|
JsonNodeIterator beginChildren() const
|
|
{
|
|
return JsonNodeIterator(_node ? _node->getContainerChild() : 0);
|
|
}
|
|
|
|
JsonNodeIterator endChildren() const
|
|
{
|
|
return JsonNodeIterator(0);
|
|
}
|
|
|
|
void addChild(JsonNode*);
|
|
void removeChild(JsonNode*);
|
|
JsonNode* createNode();
|
|
};
|
|
|