| 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 | { |
no test coverage detected