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

◆ readScreenMaps()

bool fl::FileSystem::readScreenMaps ( const char * path,
fl::flat_map< string, ScreenMap > * out,
string * error = nullptr )

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

129 {
130 string text;
131 if (!readText(path, &text)) {
132 FL_WARN("Failed to read file: " << path);
133 if (error) {
134 *error = "Failed to read file: ";
135 error->append(path);
136 }
137 return false;
138 }
139 string err;
140 bool ok = ScreenMap::ParseJson(text.c_str(), out, &err);
141 if (!ok) {
142 FL_WARN("Failed to parse screen map: " << err.c_str());
143 *error = err;
144 return false;
145 }
146 return true;
147}
bool readText(const char *path, string *out) FL_NO_EXCEPT
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:437

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

+ Here is the call graph for this function: