1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fixed random map format test crash

This commit is contained in:
AlexVinS
2017-06-14 11:56:35 +03:00
parent bb0f388f23
commit 02ae95aca3
6 changed files with 58 additions and 49 deletions

View File

@@ -23,16 +23,16 @@ public:
* @brief constructs zip stream from already opened file
* @param archive archive handle, must be opened
* @param archiveFilename name of file to write
*/
*/
explicit CZipOutputStream(CZipSaver * owner_, zipFile archive, const std::string & archiveFilename);
~CZipOutputStream();
si64 write(const ui8 * data, si64 size) override;
si64 seek(si64 position) override {return -1;};
si64 tell() override {return 0;};
si64 skip(si64 delta) override {return 0;};
si64 getSize() override {return 0;};
si64 getSize() override {return 0;};
private:
zipFile handle;
CZipSaver * owner;
@@ -40,17 +40,17 @@ private:
class DLL_LINKAGE CZipSaver
{
public:
explicit CZipSaver(std::shared_ptr<CIOApi> api, const std::string & path);
public:
explicit CZipSaver(std::shared_ptr<CIOApi> api, const boost::filesystem::path & path);
virtual ~CZipSaver();
std::unique_ptr<COutputStream> addFile(const std::string & archiveFilename);
private:
std::shared_ptr<CIOApi> ioApi;
zlib_filefunc64_def zipApi;
zlib_filefunc64_def zipApi;
zipFile handle;
///due to minizip design only one file stream may opened at a time
COutputStream * activeStream;
friend class CZipOutputStream;