OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [zlib/] [contrib/] [iostream/] [test.cpp] - Blame information for rev 745

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 jeremybenn
 
2
#include "zfstream.h"
3
 
4
int main() {
5
 
6
  // Construct a stream object with this filebuffer.  Anything sent
7
  // to this stream will go to standard out.
8
  gzofstream os( 1, ios::out );
9
 
10
  // This text is getting compressed and sent to stdout.
11
  // To prove this, run 'test | zcat'.
12
  os << "Hello, Mommy" << endl;
13
 
14
  os << setcompressionlevel( Z_NO_COMPRESSION );
15
  os << "hello, hello, hi, ho!" << endl;
16
 
17
  setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
18
    << "I'm compressing again" << endl;
19
 
20
  os.close();
21
 
22
  return 0;
23
 
24
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.