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 133 of file file_system.cpp.

133 {
134 Str text;
135 if (!readText(path, &text)) {
136 FASTLED_WARN("Failed to read file: " << path);
137 if (error) {
138 *error = "Failed to read file: ";
139 error->append(path);
140 }
141 return false;
142 }
143 Str err;
144 bool ok = ScreenMap::ParseJson(text.c_str(), name, out, &err);
145 if (!ok) {
146 FASTLED_WARN("Failed to parse screen map: " << err.c_str());
147 *error = err;
148 return false;
149 }
150 return true;
151}
bool readText(const char *path, Str *out)
static bool ParseJson(const char *jsonStrScreenMap, FixedMap< Str, ScreenMap, 16 > *segmentMaps, Str *err=nullptr)
Definition screenmap.cpp:37
#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: