annotate src/zlib-1.2.7/contrib/iostream/test.cpp @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents 8a15ff55d9af
children
rev   line source
cannam@89 1
cannam@89 2 #include "zfstream.h"
cannam@89 3
cannam@89 4 int main() {
cannam@89 5
cannam@89 6 // Construct a stream object with this filebuffer. Anything sent
cannam@89 7 // to this stream will go to standard out.
cannam@89 8 gzofstream os( 1, ios::out );
cannam@89 9
cannam@89 10 // This text is getting compressed and sent to stdout.
cannam@89 11 // To prove this, run 'test | zcat'.
cannam@89 12 os << "Hello, Mommy" << endl;
cannam@89 13
cannam@89 14 os << setcompressionlevel( Z_NO_COMPRESSION );
cannam@89 15 os << "hello, hello, hi, ho!" << endl;
cannam@89 16
cannam@89 17 setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
cannam@89 18 << "I'm compressing again" << endl;
cannam@89 19
cannam@89 20 os.close();
cannam@89 21
cannam@89 22 return 0;
cannam@89 23
cannam@89 24 }