1 #include "zipios++/zipios-config.h"
3 #include "zipios++/meta-iostreams.h"
8 using namespace zipios ;
18 void writeFileToZipOutputStreambuf(
ZipOutputStreambuf &zosb,
const string &filename ) ;
22 ofstream of(
"zosb.zip", ios::out | ios::binary ) ;
26 writeFileToZipOutputStreambuf( ozf,
"test_zip" ) ;
27 writeFileToZipOutputStreambuf( ozf,
"test_dircoll" ) ;
29 cerr <<
"End of main" << endl ;
33 catch( exception &excp ) {
34 cerr <<
"Exception caught in main() :" << endl ;
35 cerr << excp.what() << endl ;
40 void writeFileToZipOutputStreambuf(
ZipOutputStreambuf &zosb,
const string &filename ) {
43 ifstream ifs( filename.c_str(), ios::in | ios::binary ) ;
44 ostream ozs( &zosb ) ;
52 cerr <<
"ostream Stream state: " ;
53 cerr <<
"good() = " << ozs.good() <<
",\t" ;
54 cerr <<
"fail() = " << ozs.fail() <<
",\t" ;
55 cerr <<
"bad() = " << ozs.bad() <<
",\t" ;
56 cerr <<
"eof() = " << ozs.eof() << endl << endl;
58 cerr <<
"istream Stream state: " ;
59 cerr <<
"good() = " << ifs.good() <<
",\t" ;
60 cerr <<
"fail() = " << ifs.fail() <<
",\t" ;
61 cerr <<
"bad() = " << ifs.bad() <<
",\t" ;
62 cerr <<
"eof() = " << ifs.eof() << endl << endl;