mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
removed one too many implementation of extractToFolder.
changed parameter 2 from CFileInputStream to CInputStream
This commit is contained in:
parent
14b031118c
commit
6130776fe4
@ -209,7 +209,7 @@ std::unordered_set<ResourceID> CArchiveLoader::getFilteredFiles(std::function<bo
|
|||||||
return foundID;
|
return foundID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CArchiveLoader::extractToFolder(const std::string & outputSubFolder, CFileInputStream & fileStream, ArchiveEntry entry)
|
void CArchiveLoader::extractToFolder(const std::string & outputSubFolder, CInputStream & fileStream, ArchiveEntry entry)
|
||||||
{
|
{
|
||||||
si64 currentPosition = fileStream.tell(); // save filestream position
|
si64 currentPosition = fileStream.tell(); // save filestream position
|
||||||
|
|
||||||
@ -231,15 +231,7 @@ void CArchiveLoader::extractToFolder(const std::string & outputSubFolder, const
|
|||||||
{
|
{
|
||||||
std::unique_ptr<CInputStream> inputStream = load(ResourceID(mountPoint + entry.name));
|
std::unique_ptr<CInputStream> inputStream = load(ResourceID(mountPoint + entry.name));
|
||||||
|
|
||||||
std::vector<ui8> data(entry.fullSize);
|
extractToFolder(outputSubFolder, *inputStream, entry);
|
||||||
inputStream->read(data.data(), entry.fullSize);
|
|
||||||
|
|
||||||
bfs::path extractedFilePath = createExtractedFilePath(outputSubFolder, entry.name);
|
|
||||||
|
|
||||||
// writeToOutputFile
|
|
||||||
std::ofstream out(extractedFilePath.string(), std::ofstream::binary);
|
|
||||||
out.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
|
||||||
out.write((char*)&data[0], entry.fullSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bfs::path createExtractedFilePath(const std::string & outputSubFolder, const std::string & entryName)
|
bfs::path createExtractedFilePath(const std::string & outputSubFolder, const std::string & entryName)
|
||||||
|
@ -68,7 +68,7 @@ public:
|
|||||||
void updateFilteredFiles(std::function<bool(const std::string &)> filter) const override {}
|
void updateFilteredFiles(std::function<bool(const std::string &)> filter) const override {}
|
||||||
std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const override;
|
std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const override;
|
||||||
/** Extracts one archive entry to the specified subfolder. Used for Video and Sound */
|
/** Extracts one archive entry to the specified subfolder. Used for Video and Sound */
|
||||||
void extractToFolder(const std::string & outputSubFolder, CFileInputStream & fileStream, ArchiveEntry entry);
|
void extractToFolder(const std::string & outputSubFolder, CInputStream & fileStream, ArchiveEntry entry);
|
||||||
/** Extracts one archive entry to the specified subfolder. Used for Images, Sprites, etc */
|
/** Extracts one archive entry to the specified subfolder. Used for Images, Sprites, etc */
|
||||||
void extractToFolder(const std::string & outputSubFolder, const std::string & mountPoint, ArchiveEntry entry);
|
void extractToFolder(const std::string & outputSubFolder, const std::string & mountPoint, ArchiveEntry entry);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user