Gzstream Library Home Page
Introduction
Gzstream is a small C++ library, basically just a wrapper,
that provides the functionality of the
zlib C-library in a C++ iostream.
It is freely available under the LGPL license.
Gzstream has been written by
Deepak Bandyopadhyay and
Lutz Kettner at
the Computational
Geometry Group at UNC Chapel Hill.
Supported Systems
Gzstream requires a standard compliant C++ compiler (we use the
new header file conventions and the new iostream in the std:: name space)
and, of course, zlib. We use zlib 1.1.3 right now. So, in theory,
the provided sources could run on many platforms. However, we used only
the following few platforms.
- PC Linux RedHat 6.1, g++ version 2.95.2
- SGI Irix 6.5, MIPSpro CC version 7.30
Installation
Either compile gzstream.C by hand, place it in some library,
and move gzstream.h into the include search path of your
compiler. Or use the provided Makefile, adapt its
variables, and follow the remarks in the Makefile. Two
test programs are provided, test_gzip.C and test_gunzip.C.
The Makefile contains a rule that performs a small test
with these programs.
Documentation
The library provides two classes, igzstream and ogzstream,
that can be used analogously to ifstream and ofstream
respectively.
The classes are by default in the global name space. This can
be changed by setting the macro GZSTREAM_NAMESPACE to
the desired name space, e.g., by setting the option
-DGZSTREAM_NAMESPACE=gz in the Makefile.
However, this needs to be consistent for both, the library compilation
and the application that uses the library.
What's Missing
- Seek. The zlib library provides the necessary functionality,
but we have not realized that in the wrapper (yet? ;-).
- Both streams are based on the same streambuffer. So, they
cannot be used to derive an iogzstream class that would allow
simultaneous reading and writing to the same file.
Download and Release Notes
- Gzstream library 1.4 (27 Apr 2002):
gzstream.tgz
Fixes a bug that stopped stream output after calling flush()
or using std::endl
- Gzstream library 1.3 (06 Nov 2001):
Fixed unsigned char -- signed char bug. Increased buffer size
for better performance.
Acknowledgements
Credits for finding bugs and improving this software go to:
Vincent Ricard.
Links
The Computational Geometry Group at UNC Chapel Hill, Apr. 27, 2002.