X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fexternal%2Fzlib-1.2.8%2Fcontrib%2Fiostream2%2Fzstream_test.cpp;fp=src%2Fexternal%2Fzlib-1.2.8%2Fcontrib%2Fiostream2%2Fzstream_test.cpp;h=6273f62d62a8fa280edcfb798a013e0a0ae84534;hp=0000000000000000000000000000000000000000;hb=789cbc8e52da68eba3517b920ef22e000cf3c9fd;hpb=ef70704f0b31b59bb719b884d6a99cb9e3e2044a diff --git a/src/external/zlib-1.2.8/contrib/iostream2/zstream_test.cpp b/src/external/zlib-1.2.8/contrib/iostream2/zstream_test.cpp new file mode 100644 index 0000000..6273f62 --- /dev/null +++ b/src/external/zlib-1.2.8/contrib/iostream2/zstream_test.cpp @@ -0,0 +1,25 @@ +#include "zstream.h" +#include +#include +#include + +void main() { + char h[256] = "Hello"; + char* g = "Goodbye"; + ozstream out("temp.gz"); + out < "This works well" < h < g; + out.close(); + + izstream in("temp.gz"); // read it back + char *x = read_string(in), *y = new char[256], z[256]; + in > y > z; + in.close(); + cout << x << endl << y << endl << z << endl; + + out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results + out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; + out << z << endl << y << endl << x << endl; + out << 1.1234567890123456789 << endl; + + delete[] x; delete[] y; +}