kusano 7d535a
These classes provide a C++ stream interface to the zlib library. It allows you
kusano 7d535a
to do things like:
kusano 7d535a
kusano 7d535a
  gzofstream outf("blah.gz");
kusano 7d535a
  outf << "These go into the gzip file " << 123 << endl;
kusano 7d535a
kusano 7d535a
It does this by deriving a specialized stream buffer for gzipped files, which is
kusano 7d535a
the way Stroustrup would have done it. :->
kusano 7d535a
kusano 7d535a
The gzifstream and gzofstream classes were originally written by Kevin Ruland
kusano 7d535a
and made available in the zlib contrib/iostream directory. The older version still
kusano 7d535a
compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of
kusano 7d535a
this version.
kusano 7d535a
kusano 7d535a
The new classes are as standard-compliant as possible, closely following the
kusano 7d535a
approach of the standard library's fstream classes. It compiles under gcc versions
kusano 7d535a
3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard
kusano 7d535a
library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs
kusano 7d535a
from the previous one in the following respects:
kusano 7d535a
- added showmanyc
kusano 7d535a
- added setbuf, with support for unbuffered output via setbuf(0,0)
kusano 7d535a
- a few bug fixes of stream behavior
kusano 7d535a
- gzipped output file opened with default compression level instead of maximum level
kusano 7d535a
- setcompressionlevel()/strategy() members replaced by single setcompression()
kusano 7d535a
kusano 7d535a
The code is provided "as is", with the permission to use, copy, modify, distribute
kusano 7d535a
and sell it for any purpose without fee.
kusano 7d535a
kusano 7d535a
Ludwig Schwardt
kusano 7d535a
<schwardt@sun.ac.za>
kusano 7d535a
kusano 7d535a
DSP Lab
kusano 7d535a
Electrical & Electronic Engineering Department
kusano 7d535a
University of Stellenbosch
kusano 7d535a
South Africa