Contents
Compression utilities

Overview

This header provides user friendly compression utility functions defined within the Balau::Util::Compression namespace, and the Unzipper / Zipper class pair for zip file access and mutation.

Quick start

Gzip utilities

The Gzip class is a namespace class that contains functions to deflate and inflate data between files, strings, and streams.

The following static methods are currently defined.

Function name Description
gzip Gzip the input file/string/ostream to the specified output file.
gunzip Gunzip the input file to the specified output file/string/istream.

Each method is overloaded to allow file, string, and stream input/output.

Zipper and Unzipper

These classes provide reading and writing functionality for zip files. Unzipper provides a reading API for immutable zip files. Zipper extends the reading API Unzipper with mutation functionality.

The implementation uses LibZip as the backend implementation. Consequently, the read and write APIs reflect the functionality of the backend library. Refer to the Balau Unzipper and Zipper API documentation for more information on these classes.

In addition to the Zipper and Unzipper classes, the ZipFile and associated ZipEntry resource classes use the Unzipper class to provide a recursive iterator into zip archives. For more information, refer to the ZipFile and ZipEntry documentation.