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