Fixed o2r creation on lib mode

This commit is contained in:
KiritoDv
2025-01-16 02:04:30 -06:00
parent b96910b18f
commit 3c42ac507f
2 changed files with 10 additions and 4 deletions
+4 -4
View File
@@ -8,10 +8,10 @@
#include <miniz/zip_file.hpp>
namespace fs = std::filesystem;
miniz_cpp::zip_file mZip;
ZWrapper::ZWrapper(const std::string& path) {
mPath = path;
this->mPath = path;
this->mZip = new miniz_cpp::zip_file;
}
int32_t ZWrapper::CreateArchive() {
@@ -34,11 +34,11 @@ bool ZWrapper::AddFile(const std::string& path, std::vector<char> data) {
stream.close();
}
mZip.writebytes(path, data);
this->mZip->writebytes(path, data);
return true;
}
int32_t ZWrapper::Close(void) {
mZip.save(this->mPath);
this->mZip->save(this->mPath);
return 0;
}
+6
View File
@@ -4,6 +4,10 @@
#include <string>
#include "BinaryWrapper.h"
namespace miniz_cpp {
class zip_file;
}
class ZWrapper : public BinaryWrapper {
public:
explicit ZWrapper(const std::string& path);
@@ -11,4 +15,6 @@ public:
int32_t CreateArchive(void) override;
bool AddFile(const std::string& path, std::vector<char> data) override;
int32_t Close(void) override;
miniz_cpp::zip_file* mZip;
};