|
|
|
@ -7,15 +7,13 @@ namespace VFS
|
|
|
|
|
|
|
|
|
|
BsaArchive::BsaArchive(const std::string &filename)
|
|
|
|
|
{
|
|
|
|
|
mFile = nullptr;
|
|
|
|
|
|
|
|
|
|
Bsa::BsaVersion bsaVersion = Bsa::TES4BSAFile::detectVersion(filename);
|
|
|
|
|
|
|
|
|
|
if (bsaVersion == Bsa::BSAVER_TES4PLUS) {
|
|
|
|
|
mFile = new Bsa::TES4BSAFile();
|
|
|
|
|
mFile = std::make_unique<Bsa::TES4BSAFile>();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
mFile = new Bsa::BSAFile();
|
|
|
|
|
mFile = std::make_unique<Bsa::BSAFile>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mFile->open(filename);
|
|
|
|
@ -23,12 +21,11 @@ BsaArchive::BsaArchive(const std::string &filename)
|
|
|
|
|
const Bsa::BSAFile::FileList &filelist = mFile->getList();
|
|
|
|
|
for(Bsa::BSAFile::FileList::const_iterator it = filelist.begin();it != filelist.end();++it)
|
|
|
|
|
{
|
|
|
|
|
mResources.push_back(BsaArchiveFile(&*it, mFile));
|
|
|
|
|
mResources.push_back(BsaArchiveFile(&*it, mFile.get()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BsaArchive::~BsaArchive() {
|
|
|
|
|
delete mFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BsaArchive::listResources(std::map<std::string, File *> &out, char (*normalize_function)(char))
|
|
|
|
|