Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::JSON::Array Class Reference

JSON array builder for creating ordered lists of values. More...

#include <MicroJSON.h>

Public Member Functions

 Array (String &out)
 Construct a new JSON Array.
 
Arrayappend (const String &value, bool quote=true)
 Append a string value to the array.
 
Arrayappend (int value)
 Append an integer value to the array.
 
Array appendArray ()
 Create a nested array as an element.
 
Object appendObject ()
 Create a nested object as an element.
 
void close ()
 Close the JSON array by appending the closing bracket.
 

Detailed Description

JSON array builder for creating ordered lists of values.

This class provides a fluent interface for building JSON arrays by appending values to a String buffer. It automatically handles JSON formatting including quotes, commas, and brackets.

Constructor & Destructor Documentation

◆ Array()

uniot::JSON::Array::Array ( String & out)
inline

Construct a new JSON Array.

Parameters
outReference to the String buffer where JSON will be written

Member Function Documentation

◆ append() [1/2]

Array & uniot::JSON::Array::append ( const String & value,
bool quote = true )
inline

Append a string value to the array.

Parameters
valueThe string value to append
quoteWhether to quote the value (default: true)
Return values
Array&Reference to this array for method chaining

◆ append() [2/2]

Array & uniot::JSON::Array::append ( int value)
inline

Append an integer value to the array.

Parameters
valueThe integer value to append
Return values
Array&Reference to this array for method chaining

◆ appendArray()

Array uniot::JSON::Array::appendArray ( )
inline

Create a nested array as an element.

Return values
ArrayNew Array object for the nested array

◆ appendObject()

Object uniot::JSON::Array::appendObject ( )
inline

Create a nested object as an element.

Return values
ObjectNew Object for the nested object

◆ close()

void uniot::JSON::Array::close ( )
inline

Close the JSON array by appending the closing bracket.


The documentation for this class was generated from the following file: