| 50 | } |
| 51 | |
| 52 | bool MultiFileLoader::fileExists(std::string_view path) { |
| 53 | auto it = _cacheWhere.find(path); |
| 54 | if (it != _cacheWhere.end()) { |
| 55 | return it->second != -1; |
| 56 | } |
| 57 | |
| 58 | int i = 0; |
| 59 | for (const auto &provider : _providers) { |
| 60 | if (provider->has(path)) { |
| 61 | _cacheWhere[path] = i; |
| 62 | return true; |
| 63 | } |
| 64 | ++i; |
| 65 | } |
| 66 | |
| 67 | _cacheWhere[path] = -1; |
| 68 | return false; |
| 69 | } |
| 70 | |
| 71 | void MultiFileLoader::addProvider(std::unique_ptr<Provider> provider) { |
| 72 | auto lock = std::lock_guard(_mutex); |