MCPcopy Create free account
hub / github.com/FastLED/FastLED / openRead

Method openRead

src/platforms/wasm/fs_wasm.cpp.hpp:227–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 void end() override {}
226
227 fl::filebuf_ptr openRead(const char *_path) override {
228 // FL_DBG("Opening file: " << _path);
229 string path(_path);
230 filebuf_ptr out;
231 {
232 auto &reg = FileRegistry::instance();
233 fl::unique_lock<fl::mutex> lock(reg.mutex);
234 auto it = reg.files.find(path);
235 if (it != reg.files.end()) {
236 auto &data = it->second;
237 out = fl::make_shared<WasmFileHandle>(path, data);
238 // FL_DBG("Opened file: " << _path);
239 } else {
240 out = fl::filebuf_ptr();
241 FL_DBG("File not found: " << _path);
242 }
243 }
244 return out;
245 }
246};
247
248FileDataPtr _findIfExists(const fl::string &path) {

Callers

nothing calls this directly

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected