~ubuntu-branches/ubuntu/raring/smplayer/raring

« back to all changes in this revision

Viewing changes to zlib/contrib/iostream2/zstream_test.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-02-12 03:00:21 UTC
  • mfrom: (20.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130212030021-q5mg053fru2u6zl8
Tags: 0.8.3-1
* Team upload.
* New upstream release. (Closes: #698300)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "zstream.h"
 
2
#include <math.h>
 
3
#include <stdlib.h>
 
4
#include <iomanip.h>
 
5
 
 
6
void main() {
 
7
    char h[256] = "Hello";
 
8
    char* g = "Goodbye";
 
9
    ozstream out("temp.gz");
 
10
    out < "This works well" < h < g;
 
11
    out.close();
 
12
 
 
13
    izstream in("temp.gz"); // read it back
 
14
    char *x = read_string(in), *y = new char[256], z[256];
 
15
    in > y > z;
 
16
    in.close();
 
17
    cout << x << endl << y << endl << z << endl;
 
18
 
 
19
    out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
 
20
    out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
 
21
    out << z << endl << y << endl << x << endl;
 
22
    out << 1.1234567890123456789 << endl;
 
23
 
 
24
    delete[] x; delete[] y;
 
25
}