Skip to content

Commit

Permalink
Fixed o2r creation on lib mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Jan 16, 2025
1 parent b96910b commit 3c42ac5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/archive/ZWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 changes: 6 additions & 0 deletions src/archive/ZWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
#include <string>
#include "BinaryWrapper.h"

namespace miniz_cpp {
class zip_file;
}

class ZWrapper : public BinaryWrapper {
public:
explicit ZWrapper(const std::string& path);

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;
};

0 comments on commit 3c42ac5

Please sign in to comment.