mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Port bsatool
This commit is contained in:
parent
8410966753
commit
460304b069
@ -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 New Issue
Block a user