niftest now scans BSA files in directories for nif errors

The program is explicit so the user knows exactly where the bad file is.
pull/710/head
Arthur Moore 10 years ago
parent 6a6da42b85
commit 3d78ee0c2b

@ -45,9 +45,9 @@ bool isBSA(std::string filename)
/// Check all the nif files in a given VFS::Archive
/// \note Takes ownership!
void readVFS(VFS::Archive* anArchive)
void readVFS(VFS::Archive* anArchive,std::string archivePath = "")
{
VFS::Manager myManager(false);
VFS::Manager myManager(true);
myManager.addArchive(anArchive);
myManager.buildIndex();
@ -62,6 +62,15 @@ void readVFS(VFS::Archive* anArchive)
// std::cout << "Decoding: " << name << std::endl;
Nif::NIFFile temp_nif(myManager.get(name),name);
}
else if(isBSA(name))
{
if(!archivePath.empty())
{
std::cout << "Reading BSA File: " << name << std::endl;
readVFS(new VFS::BsaArchive(archivePath+name));
std::cout << "Done with BSA File: " << name << std::endl;
}
}
}
catch (std::exception& e)
{
@ -139,7 +148,7 @@ int main(int argc, char **argv)
else if(bfs::is_directory(bfs::path(name)))
{
std::cout << "Reading All Files in: " << name << std::endl;
readVFS(new VFS::FileSystemArchive(name));
readVFS(new VFS::FileSystemArchive(name),name);
}
else
{

Loading…
Cancel
Save