{"id":16358240,"url":"https://github.com/hzeller/ziplain","last_synced_at":"2025-10-26T04:31:23.551Z","repository":{"id":58023718,"uuid":"529694722","full_name":"hzeller/ziplain","owner":"hzeller","description":"A plain, no-frills ZIP file writer.","archived":false,"fork":false,"pushed_at":"2024-03-26T16:30:05.000Z","size":33,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-17T00:18:48.804Z","etag":null,"topics":["zip","zipfile"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hzeller.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}},"created_at":"2022-08-27T20:53:29.000Z","updated_at":"2024-03-21T15:45:26.000Z","dependencies_parsed_at":"2024-03-21T17:44:29.072Z","dependency_job_id":null,"html_url":"https://github.com/hzeller/ziplain","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/hzeller%2Fziplain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzeller%2Fziplain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzeller%2Fziplain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hzeller%2Fziplain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hzeller","download_url":"https://codeload.github.com/hzeller/ziplain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219864027,"owners_count":16555943,"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","zipfile"],"created_at":"2024-10-11T02:05:09.229Z","updated_at":"2025-10-26T04:31:18.230Z","avatar_url":"https://github.com/hzeller.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZIPlain\n\nA plain, no-frills [ZIP-file] encoder with a simple [API](./ziplain.h).\n\nProvides class `ziplain::Encoder` to create a ZIP file. Abstractions\nfor `ByteSource` and `ByteSink` allow to adapt it to local IO requirements.\n\n## Build\n\nThere is a simple Makefile included for a standard build and test.\n```\nmake test\n```\n(TODO: create a make install with pkg-config).\n\nAlso, for integration in bazel-based builds, a `MODULE.bazel` and `BUILD` is\nincluded.\n\n```\nbazel build :ziplain\n```\n\n## Example use\nIn the following example, we provide the output `ByteSink` by implementing\na closure wrapping a `FILE*` stream.\nAs input `ByteSource`, ziplain-provided wrappers for files and in-memory\nrepresentations are used.\n\nSee [`demo.cc`](demo.cc) for full example.\n```c++\nconstexpr int kCompressionLevel = 9;\nFILE *out = fopen(\"test-output.zip\", \"wb\");\nziplain::Encoder zipper(kCompressionLevel, [out](std::string_view s) {\n  return fwrite(s.data(), 1, s.size(), out) == s.size();\n});\n\nzipper.AddFile(\"ziplain.h\", ziplain::FileByteSource(\"ziplain.h\"));\nzipper.AddFile(\"ziplain.cc\", ziplain::FileByteSource(\"ziplain.cc\"));\nzipper.AddFile(\"readme.txt\", ziplain::MemoryByteSource(\"Hello world!\\n\"));\nzipper.Finish();\n\nfclose(out);\n```\n\n[ZIP-file]: https://en.wikipedia.org/wiki/ZIP_(file_format)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhzeller%2Fziplain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhzeller%2Fziplain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhzeller%2Fziplain/lists"}