Zipios++

# Introduction

Zipios++ is a java.util.zip-like C++ library for reading and writing Zip files. Access to individual entries is provided through standard C++ iostreams. A simple read-only virtual file system that mounts regular directories and zip files is also provided.

The source code is released under the GNU Lesser General Public License.

# Status

Spanned archives are not supported, and support is not planned.

The library has been tested and appears to be working with

- FreeBSD stable and current / gcc 2.95.3
- Red Hat Linux release 7.0 / gcc 2.96
- Red Hat Linux release 6.2 (Zoot) / egcs-2.91.66
- Linux Mandrake release 7.0 (Air) / gcc 2.95.2
- SGI IRIX64 6.5 / gcc 2.95.2
- SGI IRIX64 6.5 / MIPSpro Compilers: Version 7.30

If you are aware of any other platforms that Zipios++ works on, please let me know (thoma.nosp@m.ss@d.nosp@m.eltad.nosp@m.ata..nosp@m.dk).

# Documentation

This web page is the front page to the library documentation which is generated from the source files using Doxygen. Use the links at the top of the page to browse the API documentation. The documentation is also available in a printer-friendly format [pdf].

## Zip file access

The two most important classes are ZipFile and ZipInputStream. ZipInputStream is an istream for reading zipfiles. It can be instantiated directly, without the use of ZipFile. ZipInputStream::getNextEntry() positions the new ZipInputStream at the first entry. The following entry can be accessed by calling ZipInputStream::getNextEntry() again.

ZipFile scans the central directory of a zipfile and provides an interface to access that directory. The user may search for entries with a particular filename using ZipFile::getEntry(), or simply get the complete list of entries with ZipFile::entries(). To get an istream (ZipInputStream) to a particular entry simply use ZipFile::getInputStream().

example_zip.cpp demonstrates the central elements of Zipios++.

A Zip file appended to another file, e.g. a binary program, with the program appendzip, can be read with ZipFile::openEmbeddedZipFile().

## FileCollections

A ZipFile is actually just a special kind of FileCollection that obtains its entries from a .zip Zip archive. Zipios++ also implements a DirectoryCollection that obtains its entries from a specified directory, and a CollectionCollection that obtains its entries from other collections. Using a single CollectionCollection any number of other FileCollections can be placed under its control and accessed through the same single interface that is used to access a ZipFile or a DirectoryCollection. A singleton (a unique global instance) CollectionCollection can be obtained through

CollectionCollection::inst() ;

To save typing CollectionCollection has been typedef'ed to CColl. In the initialization part of an application FileCollections can be created, and placed under CColll::inst()'s control using

CColl::inst().addCollection()

and later an istream can be obtained using

CColl::inst().getInputStream().

# Download

Go to Zipios++ project page on SourceForge for tar balls and ChangeLog. http://sourceforge.net/project/?group_id=5418

# Links

zlib. The compression library that Zipios++ uses to perform the actual decompression.

Java 2 Platform, Standard Edition, v 1.3 API Specification . Zipios++ is heavily inspired by the java.util.zip package.

PKWARE zip format . A description of the zip file format.

# Bugs

Submit bug reports and patches to thoma.nosp@m.ss@d.nosp@m.eltad.nosp@m.ata..nosp@m.dk

Project hosted by http://sourceforge.net/

Logo created with