MCPcopy Create free account
hub / github.com/FastLED/FastLED / to_string_native

Method to_string_native

src/fl/stl/json.cpp.hpp:1276–1295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274};
1275
1276fl::string json::to_string_native() const {
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}
1296
1297// Forward declaration for the serializeValue function
1298fl::string serializeValue(const json_value& value);

Callers 1

to_stringMethod · 0.80

Calls 5

serialize_valueMethod · 0.80
getMethod · 0.45
emptyMethod · 0.45
assignMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected