MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / loadFile

Method loadFile

src/Abyss/FileSystem/FileLoader.cpp:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34InputStream MultiFileLoader::loadFile(std::string_view path) {
35 auto it = _cacheWhere.find(path);
36 if (it != _cacheWhere.end()) {
37 return _providers[it->second]->load(path);
38 }
39
40 int i = 0;
41 for (const auto &provider : _providers) {
42 if (provider->has(path)) {
43 _cacheWhere[path] = i;
44 return provider->load(path);
45 }
46 ++i;
47 }
48
49 throw std::runtime_error(absl::StrCat("File not found: ", path));
50}
51
52bool MultiFileLoader::fileExists(std::string_view path) {
53 auto it = _cacheWhere.find(path);

Callers 5

SpriteFontMethod · 0.45
ButtonMethod · 0.45
DT1Method · 0.45
DC6Method · 0.45
DS1Method · 0.45

Calls 2

loadMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected