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

◆ push_back()

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

Definition at line 745 of file json.h.

747 {
748 if (!mValue || !mValue->is_array()) {
750 }
751 // If we're pushing to a packed array, convert it to regular json_array first
752 if (mValue->is_array() &&
753 (mValue->data.is<fl::vector<i16>>() ||
754 mValue->data.is<fl::vector<u8>>() ||
755 mValue->data.is<fl::vector<float>>())) {
756 // Convert to regular json_array (needs a copy/conversion)
757 auto arr = mValue->clone_array();
758 if (arr) {
760 }
761 }
762 // For arrays, we need to manually handle the insertion since our indexing
763 // mechanism auto-creates elements
764 auto ptr = mValue->data.ptr<json_array>();
765 if (ptr) {
766 ptr->push_back(value.mValue);
fl::shared_ptr< json_value > mValue
Definition json.h:130
T value() const FL_NOEXCEPT
Definition json.h:336
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
Definition s16x16x4.h:28
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414
fl::vector< fl::shared_ptr< json_value > > json_array
Definition types.h:33

References json(), FL_NOEXCEPT, fl::make_shared(), fl::fl::move(), mValue, and value().

Referenced by fl::detail::MethodSchema< R(Args...)>::addParams(), fl::detail::MethodSchema< void(Args...)>::addParams(), fl::detail::TypeToJson< fl::vector< T > >::convert(), AutoResearchRemoteControl::findConnectedPinsImpl(), fl::WLED::getPlaylistConfig(), fl::WLED::getState(), fl::Rpc::handle(), fl::Rpc::methods(), AutoResearchRemoteControl::registerFunctions(), AutoResearchRemoteControl::runParallelTestImpl(), AutoResearchRemoteControl::runSingleTestImpl(), sendAsyncRequest(), sendAsyncStreamRequest(), sendSyncRequest(), and fl::ScreenMap::toJson().

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