|
ESPHome 2026.11.0-dev
|
Builder class for creating JSON documents without lambdas. More...
#include <json_util.h>
Public Member Functions | |
| JsonBuilder () | |
| JsonBuilder (ArduinoJson::Allocator *allocator) | |
| JsonObject | root () |
| size_t | serialize_to (char *buf, size_t cap) |
| Serialize into a caller owned buffer. | |
| SerializationBuffer | serialize () |
| Serialize the JSON document to a SerializationBuffer (stack-first allocation) Uses 512-byte stack buffer by default, falls back to heap for larger JSON. | |
Builder class for creating JSON documents without lambdas.
Definition at line 256 of file json_util.h.
| esphome::json::JsonBuilder::JsonBuilder | ( | ) |
Definition at line 67 of file json_util.cpp.
|
explicit |
Definition at line 69 of file json_util.cpp.
|
inline |
Definition at line 265 of file json_util.h.
| SerializationBuffer esphome::json::JsonBuilder::serialize | ( | ) |
Serialize the JSON document to a SerializationBuffer (stack-first allocation) Uses 512-byte stack buffer by default, falls back to heap for larger JSON.
Definition at line 96 of file json_util.cpp.
| size_t esphome::json::JsonBuilder::serialize_to | ( | char * | buf, |
| size_t | cap ) |
Serialize into a caller owned buffer.
Returns the length; cap or more means it did not fit and buf holds a truncated, unterminated copy. An overflowed document serializes as "{}".
Definition at line 80 of file json_util.cpp.