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

◆ readScreenMap()

bool fl::FileSystem::readScreenMap ( const char * path,
const char * name,
ScreenMap * out,
Str * error = nullptr )

Definition at line 127 of file file_system.cpp.

128 {
129 Str text;
130 if (!readText(path, &text)) {
131 FASTLED_WARN("Failed to read file: " << path);
132 if (error) {
133 *error = "Failed to read file: ";
134 error->append(path);
135 }
136 return false;
137 }
138 Str err;
139 bool ok = ScreenMap::ParseJson(text.c_str(), name, out, &err);
140 if (!ok) {
141 FASTLED_WARN("Failed to parse screen map: " << err.c_str());
142 *error = err;
143 return false;
144 }
145 return true;
146}
bool readText(const char *path, Str *out)
static bool ParseJson(const char *jsonStrScreenMap, FixedMap< Str, ScreenMap, 16 > *segmentMaps, Str *err=nullptr)
Definition screenmap.cpp:51
#define FASTLED_WARN
Definition warn.h:7

References fl::Str::append(), fl::StrN< SIZE >::c_str(), FASTLED_WARN, fl::ScreenMap::ParseJson(), and readText().

+ Here is the call graph for this function: