mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
30 lines
599 B
C++
30 lines
599 B
C++
/*
|
|
* Arduino JSON library
|
|
* Benoit Blanchon 2014 - MIT License
|
|
*/
|
|
|
|
#include "JsonValue.h"
|
|
#include "JsonObjectBase.h"
|
|
|
|
void JsonValue::writeBooleanTo(StringBuilder& sb)
|
|
{
|
|
sb.append(content.boolean ? "true" : "false");
|
|
}
|
|
|
|
void JsonValue::writeNumberTo(StringBuilder& sb)
|
|
{
|
|
sb.append(content.number);
|
|
}
|
|
|
|
void JsonValue::writeObjectTo(StringBuilder& sb)
|
|
{
|
|
if (content.object)
|
|
((JsonObjectBase*) content.object)->writeTo(sb);
|
|
else
|
|
sb.append("null");
|
|
}
|
|
|
|
void JsonValue::writeStringTo(StringBuilder& sb)
|
|
{
|
|
sb.appendEscaped(content.string);
|
|
} |