11Zip (or ELevenZip) is a dead simple zipping / unzipping C++ Lib
I didn't really wanted to make my own zipping / unzipping library but as I found nothing else, I made my own.
That's why I called this lib 11Zip, 11 is the atomic number of the sodium as it describes pretty well my salty feeling when searching for a zipping / unzipping C++ Lib.
By the same time it's also a reference to 7zip.
The lib is based on zlib & minizip : https://github.com/madler/zlib
It does also include some wrapper code from here : www.vilipetek.com/2013/11/22/zippingunzipping-files-in-c/
Clone this repository using the following command :
git clone --recurse-submodules https://github.com/Sygmei/11Zip.git
(don't forget about the
--recurse-submodules part or dependencies are not going to be downloaded).
Once downloaded, put the content into your
extlibs/ (or equivalent) directory and put the following lines in your
add_subdirectory(extlibs/elzip) # Path to the 11zip target_link_libraries(YourTargetName elzip)
void elz::extractZip(std::string zipname, std::string target = ".", std::string password = "");
Unzips the content of a zip in "target" folder (which is current folder by default).
void elz::extractFile(std::string zipname, std::string filename, std::string target = ".", std::string password = "");
Extracts a single file from a zip archive
void elz::zipFolder(std::string folderName, std::string zipTarget = "");
Zips the folder "folderName" to "zipTarget" (Which is "folderName".zip by default).