|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Layer 6 (Presentation) - zero-heap JSON: a bounded writer and top-level reader. More...
Go to the source code of this file.
Classes | |
| class | JsonWriter |
| Builds a JSON document into a fixed caller buffer, no heap. More... | |
Functions | |
| bool | json_get_str (const char *json, const char *key, char *out, size_t out_cap) |
| Read a top-level string member from a JSON object body. | |
| bool | json_get_int (const char *json, const char *key, long *out) |
| Read a top-level integer member from a JSON object body. | |
| bool | json_get_bool (const char *json, const char *key, bool *out) |
Read a top-level boolean member (true/false) from a JSON object body. | |
Layer 6 (Presentation) - zero-heap JSON: a bounded writer and top-level reader.
A deliberately small JSON helper for the common IoT shapes (a flat-ish object of strings / numbers / booleans, with bounded nesting). It allocates nothing: the writer formats into a caller-provided buffer, and the reader scans a NUL-terminated body in place. ArduinoJson remains the option when you need a full DOM - it heap-allocates, which this library avoids.
Definition in file json.h.
| bool json_get_str | ( | const char * | json, |
| const char * | key, | ||
| char * | out, | ||
| size_t | out_cap | ||
| ) |
Read a top-level string member from a JSON object body.
Finds "key": "..." at the root object level (nested objects/arrays and string contents are skipped, so a same-named nested key is not matched), unescapes the value, and copies it (NUL-terminated, bounded by out_cap) into out.
| json | NUL-terminated JSON object text. |
| key | Member name to find. |
| out | Destination buffer. |
| out_cap | Capacity of out including the NUL. |
| bool json_get_int | ( | const char * | json, |
| const char * | key, | ||
| long * | out | ||
| ) |
Read a top-level integer member from a JSON object body.
Definition at line 552 of file json.cpp.
References det_strtol().