forked from bblanchon/ArduinoJson
Test that JsonArray can store booleans
This commit is contained in:
@ -13,6 +13,15 @@ JsonValue JsonArray::operator[](int index) const
|
||||
return JsonValue();
|
||||
}
|
||||
|
||||
void JsonArray::add(bool value)
|
||||
{
|
||||
JsonNode* node = createNode(JSON_BOOLEAN);
|
||||
if (!node) return;
|
||||
|
||||
node->content.asBoolean = value;
|
||||
addChild(node);
|
||||
}
|
||||
|
||||
void JsonArray::add(char const* value)
|
||||
{
|
||||
JsonNode* node = createNode(JSON_STRING);
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
|
||||
JsonValue operator[](int index) const;
|
||||
|
||||
void add(bool value);
|
||||
void add(const char* value);
|
||||
void add(double value, int decimals=2);
|
||||
void add(int value) { add((long) value); }
|
||||
|
Reference in New Issue
Block a user