MCPcopy Create free account
hub / github.com/OpenMW/openmw / shallowLoad

Function shallowLoad

components/esmloader/load.cpp:209–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207 }
208
209 ShallowContent shallowLoad(const Query& query, const std::vector<std::string>& contentFiles,
210 const Files::Collections& fileCollections, ESM::ReadersCache& readers, ToUTF8::Utf8Encoder* encoder,
211 Loading::Listener* listener)
212 {
213 ShallowContent result;
214
215 const std::set<std::string_view, Misc::StringUtils::CiComp> supportedFormats{
216 "esm",
217 "esp",
218 "omwgame",
219 "omwaddon",
220 "project",
221 };
222
223 for (std::size_t i = 0; i < contentFiles.size(); ++i)
224 {
225 const std::string& file = contentFiles[i];
226 const std::string_view extension = Misc::getFileExtension(file);
227
228 if (!supportedFormats.contains(extension))
229 {
230 Log(Debug::Warning) << "Skipping unsupported content file: " << file;
231 continue;
232 }
233
234 if (listener != nullptr)
235 {
236 listener->setLabel(file);
237 listener->setProgressRange(fileProgress);
238 }
239
240 const Files::MultiDirCollection& collection = fileCollections.getCollection(extension);
241
242 const ESM::ReadersCache::BusyItem reader = readers.get(i);
243 reader->setEncoder(encoder);
244 reader->setIndex(static_cast<int>(i));
245 reader->open(collection.getPath(file));
246 if (query.mLoadCells)
247 reader->resolveParentFileIndices(readers);
248
249 loadEsm(query, *reader, result, listener);
250 }
251
252 return result;
253 }
254
255 struct WithType
256 {

Callers 1

loadEsmDataFunction · 0.85

Calls 13

getFileExtensionFunction · 0.85
LogClass · 0.85
loadEsmFunction · 0.85
sizeMethod · 0.45
containsMethod · 0.45
setLabelMethod · 0.45
setProgressRangeMethod · 0.45
getMethod · 0.45
setEncoderMethod · 0.45
setIndexMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected