ESPHome  1.15.2
Data Structures | Typedefs | Functions | Variables
esphome::json Namespace Reference

Data Structures

class  VectorJsonBuffer
 

Typedefs

using json_parse_t = std::function< void(JsonObject &)>
 Callback function typedef for parsing JsonObjects. More...
 
using json_build_t = std::function< void(JsonObject &)>
 Callback function typedef for building JsonObjects. More...
 

Functions

void reserve_global_json_build_buffer (size_t required_size)
 
const char * build_json (const json_build_t &f, size_t *length)
 Build a JSON string with the provided json build function. More...
 
void parse_json (const std::string &data, const json_parse_t &f)
 Parse a JSON string and run the provided json parse function if it's valid. More...
 
std::string build_json (const json_build_t &f)
 

Variables

VectorJsonBuffer global_json_buffer
 

Typedef Documentation

◆ json_build_t

using esphome::json::json_build_t = typedef std::function<void(JsonObject &)>

Callback function typedef for building JsonObjects.

Definition at line 13 of file json_util.h.

◆ json_parse_t

using esphome::json::json_parse_t = typedef std::function<void(JsonObject &)>

Callback function typedef for parsing JsonObjects.

Definition at line 10 of file json_util.h.

Function Documentation

◆ build_json() [1/2]

const char * esphome::json::build_json ( const json_build_t f,
size_t *  length 
)

Build a JSON string with the provided json build function.

Definition at line 25 of file json_util.cpp.

◆ build_json() [2/2]

std::string esphome::json::build_json ( const json_build_t f)

Definition at line 60 of file json_util.cpp.

◆ parse_json()

void esphome::json::parse_json ( const std::string &  data,
const json_parse_t f 
)

Parse a JSON string and run the provided json parse function if it's valid.

Definition at line 49 of file json_util.cpp.

◆ reserve_global_json_build_buffer()

void esphome::json::reserve_global_json_build_buffer ( size_t  required_size)

Definition at line 12 of file json_util.cpp.

Variable Documentation

◆ global_json_buffer

VectorJsonBuffer esphome::json::global_json_buffer

Definition at line 126 of file json_util.cpp.