FastLED 3.10.8
Loading...
Searching...
No Matches

◆ contains() [2/2]

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

Definition at line 1463 of file types.h.

1463 {
1464 // Handle regular json_array first
1465 if (data.is<json_array>()) {
1466 auto ptr = data.ptr<json_array>();
1467 return ptr && idx < ptr->size();
1468 }
1469
1470 // Handle specialized array types
1471 if (data.is<fl::vector<i16>>()) {
1472 auto ptr = data.ptr<fl::vector<i16>>();
1473 return ptr && idx < ptr->size();
1474 }
1475 if (data.is<fl::vector<u8>>()) {
1476 auto ptr = data.ptr<fl::vector<u8>>();
1477 return ptr && idx < ptr->size();
1478 }
1479 if (data.is<fl::vector<float>>()) {
1480 auto ptr = data.ptr<fl::vector<float>>();
1481 return ptr && idx < ptr->size();
1482 }
1483 return false;
1484 }
fl::size size() const FL_NO_EXCEPT
fl::vector< fl::shared_ptr< json_value > > json_array
Definition types.h:54
variant_t data
Definition types.h:760

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

+ Here is the call graph for this function: