79 Object(String &out) : mOut(out), mFirst(true) {
90 inline Object &
put(
const String &key,
const String &value,
bool quote =
true) {
92 mOut += (quote ?
"\"" + value +
"\"" : value);
103 return put(key, String(value),
false);
135 inline void _begin(
const String &key) {
139 mOut +=
"\"" + key +
"\":";
157 Array(String &out) : mOut(out), mFirst(true) {
169 mOut += (quote ?
"\"" + value +
"\"" : value);
179 return append(String(value),
false);
208 inline void _begin() {
209 if (!mFirst) mOut +=
",";
214inline Array Object::putArray(
const String &key) {
219inline Object Object::putObject(
const String &key) {
JSON array builder for creating ordered lists of values.
Definition MicroJSON.h:151
void close()
Close the JSON array by appending the closing bracket.
Definition MicroJSON.h:197
Array & append(const String &value, bool quote=true)
Append a string value to the array.
Definition MicroJSON.h:167
Array & append(int value)
Append an integer value to the array.
Definition MicroJSON.h:178
Array appendArray()
Create a nested array as an element.
Definition MicroJSON.h:224
Object appendObject()
Create a nested object as an element.
Definition MicroJSON.h:229
Array(String &out)
Construct a new JSON Array.
Definition MicroJSON.h:157
JSON object builder for creating key-value pairs.
Definition MicroJSON.h:73
Object & put(const String &key, const String &value, bool quote=true)
Add a string key-value pair to the object.
Definition MicroJSON.h:90
void close()
Close the JSON object by appending the closing brace.
Definition MicroJSON.h:123
Object & put(const String &key, int value)
Add an integer key-value pair to the object.
Definition MicroJSON.h:102
Object putObject(const String &key)
Create a nested object for the given key.
Definition MicroJSON.h:219
Object(String &out)
Construct a new JSON Object.
Definition MicroJSON.h:79
Array putArray(const String &key)
Create a nested array for the given key.
Definition MicroJSON.h:214
struct Obj * Object
A pointer to a Lisp object structure.
Definition LispHelper.h:61
Definition MicroJSON.h:62
Contains all classes and functions related to the Uniot Core.