mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Fixed o2r creation on lib mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user