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

◆ readScreenMap()

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

Definition at line 144 of file file_system.cpp.hpp.

145 {
146 string text;
147 if (!readText(path, &text)) {
148 FL_WARN("Failed to read file: " << path);
149 if (error) {
150 *error = "Failed to read file: ";
151 error->append(path);
152 }
153 return false;
154 }
155 string err;
156 bool ok = ScreenMap::ParseJson(text.c_str(), name, out, &err);
157 if (!ok) {
158 FL_WARN("Failed to parse screen map: " << err.c_str());
159 *error = err;
160 return false;
161 }
162 return true;
163}
bool readText(const char *path, string *out)
static bool ParseJson(const char *jsonStrScreenMap, fl::flat_map< string, ScreenMap > *segmentMaps, string *err=nullptr) FL_NOEXCEPT
#define FL_WARN(X)
Definition log.h:276

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

+ Here is the call graph for this function: