{"id":19267640,"url":"https://github.com/winsoft666/easyzip","last_synced_at":"2025-04-21T19:33:05.882Z","repository":{"id":130007226,"uuid":"240192706","full_name":"winsoft666/easyzip","owner":"winsoft666","description":"C++ wrapper around zlib compression library.","archived":false,"fork":false,"pushed_at":"2023-10-09T08:01:40.000Z","size":155,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-10-09T09:26:05.309Z","etag":null,"topics":["zip","zipper","zlib"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winsoft666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-02-13T06:29:06.000Z","updated_at":"2023-10-09T09:26:10.385Z","dependencies_parsed_at":"2023-06-14T04:32:00.302Z","dependency_job_id":null,"html_url":"https://github.com/winsoft666/easyzip","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2Feasyzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2Feasyzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2Feasyzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2Feasyzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winsoft666","download_url":"https://codeload.github.com/winsoft666/easyzip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223876432,"owners_count":17218389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zip","zipper","zlib"],"created_at":"2024-11-09T20:13:36.222Z","updated_at":"2024-11-09T20:13:36.961Z","avatar_url":"https://github.com/winsoft666.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/winsoft666/easyzip.svg?branch=master)](https://travis-ci.com/winsoft666/easyzip)\n\n# 1. EasyZip\nC++ wrapper around minizip compression library.\n\n**EasyZip**'s goal is to bring the power and simplicity of minizip to a more object oriented/c++ user friendly library.\nIt was born out of the necessity of a compression library that would be reliable, simple and flexible. \nBy flexibility I mean supporting all kinds of inputs and outputs, but specifically been able to compress into memory instead of been restricted to file compression only, and using data from memory instead of just files as well.\n\n---\n\n# 2. Features\n- [x] Create zip in memory\n- [x] Allow files, vector and generic streams as input to zip\n- [x] File mappings for replacing strategies (overwrite if exists or use alternative name from mapping)\n- [x] Password protected zip\n- [x] Multi platform\n\n---\n\n# 3. Compiling/Install\n\nIn order to use and compile `EasyZip` you need to have [zlib](http://www.zlib.net).\n\nThe preferred way is to use [vckpg](https://github.com/microsoft/vcpkg) to install zlib.\n\nThe preferred way is to create a folder for the compilation output to avoid polluting the root folder.\n\n## 3.1 Compiling/Install from source\n### 3.1.1 Windows Platform\n\n```shell\nvcpkg install zlib:x86-windows\nvcpkg install gtest:x86-windows\ngit clone https://github.com/winsoft666/easyzip.git\ncd easyzip\nmkdir build\ncd build\ncmake ../\n```\n\nAfter run above commands, you can use Visual Studio to open solution, compile.\n\n### 3.1.2 Linux Platform\n\n```shell\nvcpkg install zlib:x64-linux\nvcpkg install gtest:x64-linux\ngit clone https://github.com/winsoft666/easyzip.git\ncd easyzip\nmkdir build\ncd build\ncmake ../\nmake\nmake install\n```\n\n## 3.2 Compiling/Install with [vcpkg](https://github.com/microsoft/vcpkg)\n1. Copy `vcpkg_port\\easyzip` folder to `\u003cvcpkg\u003e\\ports` folder.\n2. Using `vcpkg` command to install.\n```bat\n# Shared library\nvcpkg install easyzip:x86-windows\n\n# Static library\nvcpkg install easyzip:x86-windows-static\n```\n\n\n---\n\n# Getting Started\n\nThere are two classes available Zipper and Unzipper. \n\nThey behave in the same manner regarding constructors and storage parameters. \n\n##### Zipping\n\n- Creating a zip file with 2 files:\n```c++\n#include \"easyzip.h\"\n\nusing namespace easyzip;\n\nstd::ifstream input1(\"some file\");\nstd::ifstream input2(\"some file\");\n\nZipper zipper(\"ziptest.zip\");\nzipper.add(input1, \"Test1\");\nzipper.add(input2, \"Test1\");\n\nzipper.close();\n```\n\n- Adding a file by name and an entire folder to a zip:\n```c++\n\nZipper zipper(\"ziptest.zip\");\nzipper.add(\"somefile.txt\");\nzipper.add(\"myFolder\");\nzipper.close();\n```\n- Creating a zip file using the awesome streams from boost that lets us use a vector as a stream:\n\n```c++\n#include \u003cboost\\interprocess\\streams\\vectorstream.hpp\u003e\n...\n\nboost::interprocess::basic_vectorstream\u003cstd::vector\u003cchar\u003e\u003e input_data(some_vector);\n\nZipper zipper(\"ziptest.zip\");\nzipper.add(input_data, \"Test1\");\nzipper.close();\n```\n\n- Creating a zip in memory stream with files:\n```c++\n#include \u003cboost\\interprocess\\streams\\vectorstream.hpp\u003e\n...\n\nboost::interprocess::basic_vectorstream\u003cstd::vector\u003cchar\u003e\u003e zip_in_memory;\nstd::ifstream input1(\"some file\");\n\nZipper zipper(zip_in_memory);\nzipper.add(input1, \"Test1\");\nzipper.close();\n```\n\n- Creating a zip in a vector with files:\n```c++\n\nstd::vector\u003cchar\u003e zip_vect;\nstd::ifstream input1(\"some file\");\n\nZipper zipper(zip_vect);\nzipper.add(input1, \"Test1\");\nzipper.close();\n```\n\n##### Unzipping\n- Getting all entries in zip\n```c++\nUnzipper unzipper(\"zipfile.zip\");\nstd::vector\u003cZipEntry\u003e entries = unzipper.entries();\nunzipper.close();\n```\n\n- Extracting all entries from zip\n```c++\nUnzipper unzipper(\"zipfile.zip\");\nunzipper.extract();\nunzipper.close();\n```\n\n- Extracting all entries from zip using alternative names for existing files on disk\n```c++\nstd::map\u003cstd::string, std::string\u003e alternativeNames = { {\"Test1\", \"alternative_name_test1\"} };\nUnzipper unzipper(\"zipfile.zip\");\nunzipper.extract(\".\", alternativeNames);\nunzipper.close();\n```\n\n- Extracting a single entry from zip\n```c++\nUnzipper unzipper(\"zipfile.zip\");\nunzipper.extractEntry(\"entry name\");\nunzipper.close();\n```\n\n- Extracting a single entry from zip to memory\n```c++\nstd::vector\u003cunsigned char\u003e unzipped_entry;\nUnzipper unzipper(\"zipfile.zip\");\nunzipper.extractEntryToMemory(\"entry name\", unzipped_entry);\nunzipper.close();\n```\n\n**Note:** Methods `extract`, `extractEntry`, `extractEntryToMemory` return a boolean indicating the success (`true`) or the failure (`false`).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinsoft666%2Feasyzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinsoft666%2Feasyzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinsoft666%2Feasyzip/lists"}