FastLED 3.9.15
Loading...
Searching...
No Matches

◆ to_string_native()

fl::string fl::json::to_string_native ( ) const

Definition at line 1276 of file json.cpp.hpp.

1276 {
1277 if (!mValue) {
1278 return "null";
1279 }
1280
1281 // Use fl::deque for memory-efficient JSON serialization
1282 fl::deque<char> json_chars;
1283
1284 // Use the visitor to serialize the value recursively
1285 SerializerVisitor visitor{json_chars};
1286 visitor.serialize_value(mValue.get());
1287
1288 // Convert deque to fl::string efficiently
1289 fl::string result;
1290 if (!json_chars.empty()) {
1291 result.assign(&json_chars[0], json_chars.size());
1292 }
1293
1294 return result;
1295}
fl::size size() const
Definition deque.h:428
bool empty() const
Definition deque.h:424
fl::shared_ptr< json_value > mValue
Definition json.h:130
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References fl::deque< T >::empty(), mValue, fl::SerializerVisitor::serialize_value(), and fl::deque< T >::size().

Referenced by to_string(), fl::json_value::to_string(), and to_string_native_public().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: