| 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 ® = 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 | |
| 248 | FileDataPtr _findIfExists(const fl::string &path) { |