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

◆ contains() [2/2]

bool fl::json_value::contains ( size_t idx) const
inline

Definition at line 1434 of file types.h.

1434 {
1435 // Handle regular json_array first
1436 if (data.is<json_array>()) {
1437 auto ptr = data.ptr<json_array>();
1438 return ptr && idx < ptr->size();
1439 }
1440
1441 // Handle specialized array types
1442 if (data.is<fl::vector<i16>>()) {
1443 auto ptr = data.ptr<fl::vector<i16>>();
1444 return ptr && idx < ptr->size();
1445 }
1446 if (data.is<fl::vector<u8>>()) {
1447 auto ptr = data.ptr<fl::vector<u8>>();
1448 return ptr && idx < ptr->size();
1449 }
1450 if (data.is<fl::vector<float>>()) {
1451 auto ptr = data.ptr<fl::vector<float>>();
1452 return ptr && idx < ptr->size();
1453 }
1454 return false;
1455 }
fl::size size() const FL_NOEXCEPT
fl::vector< fl::shared_ptr< json_value > > json_array
Definition types.h:33
variant_t data
Definition types.h:700

References data, FL_NOEXCEPT, and fl::vector_basic::size().

+ Here is the call graph for this function: