Mercurial > hg > sv-dependency-builds
annotate src/zlib-1.2.7/contrib/iostream/test.cpp @ 4:e13257ea84a4
Add bzip2, zlib, liblo, portaudio sources
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 13:59:52 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@4 | 1 |
Chris@4 | 2 #include "zfstream.h" |
Chris@4 | 3 |
Chris@4 | 4 int main() { |
Chris@4 | 5 |
Chris@4 | 6 // Construct a stream object with this filebuffer. Anything sent |
Chris@4 | 7 // to this stream will go to standard out. |
Chris@4 | 8 gzofstream os( 1, ios::out ); |
Chris@4 | 9 |
Chris@4 | 10 // This text is getting compressed and sent to stdout. |
Chris@4 | 11 // To prove this, run 'test | zcat'. |
Chris@4 | 12 os << "Hello, Mommy" << endl; |
Chris@4 | 13 |
Chris@4 | 14 os << setcompressionlevel( Z_NO_COMPRESSION ); |
Chris@4 | 15 os << "hello, hello, hi, ho!" << endl; |
Chris@4 | 16 |
Chris@4 | 17 setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) |
Chris@4 | 18 << "I'm compressing again" << endl; |
Chris@4 | 19 |
Chris@4 | 20 os.close(); |
Chris@4 | 21 |
Chris@4 | 22 return 0; |
Chris@4 | 23 |
Chris@4 | 24 } |