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

◆ push_back()

void fl::Json::push_back ( const Json & value)
inline

Definition at line 2172 of file json.h.

2174 {
2175 if (!m_value || !m_value->is_array()) {
2177 }
2178 // If we're pushing to a packed array, convert it to regular JsonArray first
2179 if (m_value->is_array() &&
2180 (m_value->data.is<fl::vector<int16_t>>() ||
2181 m_value->data.is<fl::vector<uint8_t>>() ||
2182 m_value->data.is<fl::vector<float>>())) {
2183 // Convert to regular JsonArray
2184 auto arr = m_value->as_array();
2185 if (arr) {
2187 }
2188 }
2189 // For arrays, we need to manually handle the insertion since our indexing
2190 // mechanism auto-creates elements
2191 auto ptr = m_value->data.ptr<JsonArray>();
2192 if (ptr) {
2193 ptr->push_back(value.m_value);
T value() const
Definition json.h:1802
fl::shared_ptr< JsonValue > m_value
Definition json.h:1622
constexpr remove_reference< T >::type && move(T &&t) noexcept
Definition move.h:27
shared_ptr< T > make_shared(Args &&... args)
Definition shared_ptr.h:348
fl::vector< fl::shared_ptr< JsonValue > > JsonArray
Definition json.h:170
HeapVector< T, Allocator > vector
Definition vector.h:1214

References Json(), m_value, fl::make_shared(), fl::move(), and value().

Referenced by fl::ScreenMap::toJson().

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