zipios++
2.0.2
Zipios++ – a small C++ library that provides easy access to .zip files.
|
Zipios++ is a java.util.zip-like C++ library for reading and writing Zip files (ZipFile). Access to individual entries is provided through a Zipios++ class (FileEntry) for the meta data of the and a standard C++ iostreams for the contents of the file.
A simple virtual file system that mounts regular directories and zip files is also provided (FileCollection).
The library is fully re-entrant. It is not otherwise thread safe.
The source code is released under the GNU Lesser General Public License.
This was the status of version 1.x. At this point, 2.x has a brand new version out and we are waiting for good news about the current status. That being said, version 2.x comes a test suite which produces a 100% coverage of the library (except gzip which is not yet publicly available.)
Spanned archives are not supported, and support is not planned.
The library v1.x has been tested and appears to be working with:
The library v2.x has been compiled and appears to be working with:
If you make zipios++ work on other platforms, let us know by posting a message on Sourceforge.net
http://sourceforge.net/projects/zipios/
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. Your Doxygen installation may also be capable of generating other formats (Latex, PDF, etc.) if you would prefer such (we only offer the HTML documentation.)
The two most important classes are DirectoryCollection and ZipFile.
A ZipFile is also a FileCollection, only the collection is loaded from a Zip archive instead of a directory. A ZipFile is composed of ZipCentralDirectoryEntry objects. As far as you are concerned though, you can only use it as FileEntry objects.
Note that the ZipFile constructor immediately scans the Central Directory of the Zip archive so the entries are immediately accessible.
The DirectoryCollection can be created one file at a time, so it is possible to create a collection without having to include all the files from a directory. However, the files still have to exist on disk. The DirectoryCollection is composed of DirectoryEntry objects.
To access the entries in a collection, use the entries() function which returns a vector of FileEntry objects. If you know the exact filename of an entry, you may also use the getEntry() with that name. This is particularly useful if you want to use Zipios++ as a way to handle the resources of your executable (see the openEmbeddedZipFile() function and the appendzip.cpp tool). Finally, you want to use the getInputStream() function to read the data of a file defined in a collection.
zipios_example.cpp demonstrates the central elements of Zipios++ when used in read mode.
A ZipFile is actually just a special kind of FileCollection that obtains its entries from a Zip archive. Zipios++ also implements a DirectoryCollection that obtains its entries from an on disk directory and a CollectionCollection that obtains its entries from other collections.
Using a single CollectionCollection, any number of other FileCollection's can be placed under its control and accessed through the same single interface that is used to access a ZipFile or a DirectoryCollection.
Go to Zipios++ project page on SourceForge for tar balls, source code (CVS for v1.x and GIT for v2.x), and ChangeLog. https://sourceforge.net/projects/zipios/
zlib. The compression library that Zipios++ uses to perform the actual compression and decompression.
Java. Zipios++ version 1.0 is heavily inspired by the java.util.zip package. Version 2.0 is following the same philosophy without (1) attempting to follow the interface one to one and (2) without updating to the newer version, if there were changes...
You will find a text file in the doc directory named zip-format.txt with a complete description of the zip file format as of October 1, 2014.
Submit bug reports and patches on:
http://sourceforge.net/projects/zipios/
Project hosted by