mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 01:45:33 +00:00
Port bsatool
This commit is contained in:
parent
8410966753
commit
460304b069
1 changed files with 6 additions and 4 deletions
|
@ -237,12 +237,14 @@ int extract(Bsa::BSAFile& bsa, Arguments& info)
|
|||
}
|
||||
|
||||
// Get a stream for the file to extract
|
||||
Ogre::DataStreamPtr data = bsa.getFile(archivePath.c_str());
|
||||
Files::IStreamPtr stream = bsa.getFile(archivePath.c_str());
|
||||
|
||||
bfs::ofstream out(target, std::ios::binary);
|
||||
|
||||
// Write the file to disk
|
||||
std::cout << "Extracting " << info.extractfile << " to " << target << std::endl;
|
||||
out.write(data->getAsString().c_str(), data->size());
|
||||
|
||||
out << stream->rdbuf();
|
||||
out.close();
|
||||
|
||||
return 0;
|
||||
|
@ -276,12 +278,12 @@ int extractAll(Bsa::BSAFile& bsa, Arguments& info)
|
|||
|
||||
// Get a stream for the file to extract
|
||||
// (inefficient because getFile iter on the list again)
|
||||
Ogre::DataStreamPtr data = bsa.getFile(archivePath);
|
||||
Files::IStreamPtr data = bsa.getFile(archivePath);
|
||||
bfs::ofstream out(target, std::ios::binary);
|
||||
|
||||
// Write the file to disk
|
||||
std::cout << "Extracting " << target << std::endl;
|
||||
out.write(data->getAsString().c_str(), data->size());
|
||||
out << data->rdbuf();
|
||||
out.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue