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