FastLED 3.10.6
Loading...
Searching...
No Matches

◆ readScreenMap()

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

Definition at line 149 of file fs.cpp.hpp.

150 {
151 string text;
152 if (!readText(path, &text)) {
153 FL_WARN("Failed to read file: %s", path);
154 if (error) {
155 *error = "Failed to read file: ";
156 error->append(path);
157 }
158 return false;
159 }
160 string err;
161 bool ok = ScreenMap::ParseJson(text.c_str(), name, out, &err);
162 if (!ok) {
163 FL_WARN("Failed to parse screen map: %s", err.c_str());
164 *error = err;
165 return false;
166 }
167 return true;
168}
bool readText(const char *path, string *out)
Definition fs.cpp.hpp:191
static bool ParseJson(const char *jsonStrScreenMap, fl::flat_map< string, ScreenMap > *segmentMaps, string *err=nullptr) FL_NO_EXCEPT
#define FL_WARN(...)
Definition log.h:440

References fl::string::append(), fl::basic_string::c_str(), FL_WARN, fl::ScreenMap::ParseJson(), and readText().

+ Here is the call graph for this function: