ctabin / libzippp

C++ wrapper for libzip
Other
376 stars 93 forks source link

setCompressionMethod silently fail when the archive is not yet opened #188

Closed fdgStilla closed 1 year ago

fdgStilla commented 1 year ago

I expected the following code to work:

ZipArchive zip_archive{archive_path};
zip_archive.setCompressionMethod(libzippp::CompressionMethod::STORE);
zip_archive.open(ZipArchive::Write);

But the setCompressionMethod method silently fail. I had to look at the sources to understand why. The solution is simple, we just have to move the setCompressionMethod after the open method, but it would be simpler to allow to set the compression on archive that are not yet opened.