{"id":17549199,"url":"https://github.com/yhirose/cpp-zipper","last_synced_at":"2025-04-24T02:10:51.645Z","repository":{"id":138076114,"uuid":"429646730","full_name":"yhirose/cpp-zipper","owner":"yhirose","description":"A single file C++ header-only minizip wrapper library","archived":false,"fork":false,"pushed_at":"2022-08-01T17:16:05.000Z","size":10,"stargazers_count":27,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T09:34:33.658Z","etag":null,"topics":["cpp","cpp11","header-only","minizip","zip"],"latest_commit_sha":null,"homepage":"","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/yhirose.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-19T02:36:37.000Z","updated_at":"2025-04-14T18:48:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"8415771f-9275-40a9-b734-ef2e159d684a","html_url":"https://github.com/yhirose/cpp-zipper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fcpp-zipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fcpp-zipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fcpp-zipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fcpp-zipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhirose","download_url":"https://codeload.github.com/yhirose/cpp-zipper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546086,"owners_count":21448260,"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":["cpp","cpp11","header-only","minizip","zip"],"created_at":"2024-10-21T02:50:15.382Z","updated_at":"2025-04-24T02:10:51.638Z","avatar_url":"https://github.com/yhirose.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"cpp-zipper\n===========\n\nA single file C++ header-only minizip wrapper library\n\nThis code is based on 'Making MiniZip Easier to Use' by John Schember.\nhttps://nachtimwald.com/2019/09/08/making-minizip-easier-to-use/\n\nExample\n-------\n\n```cpp\n#include \u003cfilesystem\u003e\n#include \u003ciostream\u003e\n\n#include \"zipper.h\"\n\nnamespace fs = std::filesystem;\n\nint main() {\n  {\n    zipper::Zip zip(\"test_copy.zip\");\n\n    zipper::enumerate(\"test.zip\", [\u0026zip](auto \u0026unzip) {\n      if (unzip.is_dir()) {\n        zip.add_dir(unzip.file_path());\n      } else {\n        std::string buf;\n        if (unzip.read(buf)) {\n          zip.add_file(unzip.file_path(), buf);\n        }\n      }\n    });\n  }\n\n  {\n    zipper::UnZip zip0(\"test.zip\");\n    zipper::UnZip zip1(\"test_copy.zip\");\n\n    do {\n      assert(zip0.is_dir() == zip1.is_dir());\n      assert(zip0.is_file() == zip1.is_file());\n      assert(zip0.file_path() == zip1.file_path());\n      assert(zip0.file_size() == zip1.file_size());\n\n      if (zip0.is_file()) {\n        std::string buf0, buf1;\n        assert(zip0.read(buf0) == zip1.read(buf1));\n        assert(buf0 == buf1);\n      }\n    } while (zip0.next() \u0026\u0026 zip1.next());\n  }\n\n  return 0;\n}\n```\n\nLicense\n-------\n\nMIT license (© 2021 Yuji Hirose)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirose%2Fcpp-zipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhirose%2Fcpp-zipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirose%2Fcpp-zipper/lists"}