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