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

Method push_value

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

Source from the content-addressed store, hash-verified

891 }
892
893 void push_value(const fl::shared_ptr<json_value>& val) {
894 if (mStack.empty()) {
895 mRoot = val;
896 } else {
897 StackFrame& top = mStack.back();
898
899 if (top.type == StackFrame::OBJECT) {
900 // Attach to object with pending key
901 auto obj = top.value->data.ptr<json_object>();
902 if (obj && !top.pending_key.empty()) {
903 (*obj)[top.pending_key] = val;
904 top.pending_key.clear();
905 }
906 } else {
907 // Attach to array
908 auto arr = top.value->data.ptr<json_array>();
909 if (arr) {
910 arr->push_back(val);
911 }
912 }
913 }
914 }
915
916public:
917 JsonBuilder() FL_NOEXCEPT : mRoot(), mDepth(0) {}

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.45
backMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected