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

◆ readScreenMaps()

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

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

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