|
FastLED 3.9.15
|
FastLED's Elegant JSON Library: fl::json
The fl::json library provides a lightweight, type-safe, and highly ergonomic interface for both parsing and generating JSON data within the FastLED ecosystem.
json["key"]["nested_key"] or json["array_key"][index].operator|): The cornerstone of robust parsing. Safely extract values with a fallback, preventing crashes from missing keys or type mismatches: int value = json["path"]["to"]["key"] | 123;fl::optional<T> for explicit handling of potential absence or type errors, ensuring predictable behavior.fl::json::object() and fl::json::array().Parse a JSON string and extract values with graceful defaults.
Construct complex JSON objects and arrays programmatically.
json object can represent JSON null or be completely uninitialized. Use is_null() to explicitly check for JSON null values.fl::json uses fl::shared_ptr internally, enabling efficient copying and avoiding manual memory management pitfalls.fl::optional values that can be safely queried or defaulted using operator|.fl::json is not inherently thread-safe. If you need to share JSON data across threads, ensure proper synchronization using mutexes or similar mechanisms.
Definition in file json.h.
Include dependency graph for json.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | fl::json |
Namespaces | |
| namespace | fl |
| Base definition for an LED controller. | |
Variables | |
| volatile size_t | fl::g_json_max_stack_depth |
| volatile size_t | fl::g_json_stack_base |