Definition at line 34 of file crgb_json.cpp.hpp.
35 {
37 return false;
38 }
39
40 const json versionJson = document[
"version"];
42 if (!versionJson.
is_int() || versionJson.
is_bool() || !version ||
43 *version != 1) {
44 return false;
45 }
46
47 const json encodedPixels = document["pixels"];
48 if (!encodedPixels.is_array() || encodedPixels.size() != pixels.
size()) {
49 return false;
50 }
51
52 for (size i = 0; i < encodedPixels.size(); ++i) {
54 if (!decoded || *decoded != pixels[i]) {
55 return false;
56 }
57 }
58 return true;
59}
bool is_object() const FL_NO_EXCEPT
size_t size() const FL_NO_EXCEPT
bool is_int() const FL_NO_EXCEPT
bool is_bool() const FL_NO_EXCEPT
fl::optional< T > as() const FL_NO_EXCEPT
constexpr fl::size size() const FL_NO_EXCEPT
optional< CRGB > crgbJsonPixel(const json &value) FL_NO_EXCEPT
References fl::json::as(), crgbJsonMatches(), crgbJsonPixel(), fl::FL_NO_EXCEPT, fl::json::is_array(), fl::json::is_bool(), fl::json::is_int(), and fl::json::size().
Referenced by crgbJsonMatches().