Skip to content
Riccardo edited this page Oct 8, 2023 · 20 revisions

bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries

GitHub releaseC++14WindowsLinuxmacOSx86, x64, arm, arm64donatedocsBuild status
MSVC 2015+GCC 4.9+Clang 3.6+CodeFactor GradeLicense

⚡️ Introduction

bit7z is a cross-platform C++ static library that allows the compression/extraction of archive files through a clean and simple wrapper interface to the dynamic libraries from the 7-zip project.
It supports compression and extraction to and from the filesystem or the memory, reading archives metadata, updating existing ones, creating multi-volume archives, operation progress callbacks, and many other functionalities.

🎯 Supported Features

  • Compression using the following archive formats: 7z, XZ, BZIP2, GZIP, TAR, ZIP, and WIM.
  • Extraction of many archive formats: 7z, AR, ARJ, BZIP2, CAB, CHM, CPIO, CramFS, DEB, DMG, EXT, FAT, GPT, GZIP, HFS, HXS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RAR5, RPM, SquashFS, TAR, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR, XZ, Z, and ZIP.
  • Reading metadata of archives and their content.
  • Testing archives for errors.
  • Updating existing file archives with new files.
  • Renaming, updating, or deleting old items in existing file archives.
  • Compression and extraction to and from memory and C++ standard streams.
  • Compression using custom path aliases for the items in the output archives.
  • Selective extraction of only specified files/folders using wildcards and regexes.
  • Creation of encrypted archives (strong AES-256 encryption — only for 7z and ZIP formats).
  • Archive header encryption (only for 7z format).
  • Possibility to choose the compression level (if supported by the archive format), the compression method (supported methods), the dictionary size, and the word size.
  • Automatic input archive format detection.
  • Solid archives (only for 7z).
  • Multi-volume archives.
  • Operation callbacks for obtaining real-time information about ongoing operations.
  • Canceling or pausing the current operation.

Notes

The presence or not of some of the above features depends on the particular shared library used along with bit7z.
For example, 7z.dll should support all these features, 7za.dll should work only with the 7z file format, and 7zxa.dll can only extract 7z files. For more information about the 7-zip DLLs, please see this wiki page.

In the end, some other features (e.g., automatic format detection and selective extraction using regexes) are disabled by default, and macro definitions must be used during compilation to have them available (wiki).

☕️ Donate

If you have found this project helpful, please consider supporting me with a small donation so that I can keep improving it! Thank you! 🙏

Sponsor me on GitHubBuy Me a Coffee at ko-fi.comDonations

📜 License

This project is licensed under the terms of the Mozilla Public License v2.0.
For more details, please check:

Older versions (v3.x and earlier) of bit7z were released under the GNU General Public License v2.

Clone this wiki locally