Zipios++
test_zipinputstreambuf.cpp
Go to the documentation of this file.
1 
2 #include "zipios++/zipios-config.h"
3 
4 #include "zipios++/meta-iostreams.h"
5 
7 
8 using namespace zipios ;
9 
10 using std::cerr ;
11 using std::cout ;
12 using std::endl ;
13 using std::ifstream ;
14 using std::ios ;
15 
16 int main() {
17  ifstream f( "test.zip", ios::in | ios::binary ) ;
18  ZipInputStreambuf izf( f.rdbuf() ) ;
19  istream is( &izf ) ;
20 
21 // string str ;
22 // while ( is ) {
23 // getline( is, str ) ;
24 // cout << str ;
25 // }
26 
27 
28  cout << is.rdbuf() ;
29 
30  izf.getNextEntry() ;
31  istream is2( &izf ) ;
32 
33  cout << is2.rdbuf() ;
34 
35  cerr << "End of main" << endl ;
36 
37  return 0;
38 }
39 
44 /*
45  Zipios++ - a small C++ library that provides easy access to .zip files.
46  Copyright (C) 2000 Thomas Søndergaard
47 
48  This library is free software; you can redistribute it and/or
49  modify it under the terms of the GNU Lesser General Public
50  License as published by the Free Software Foundation; either
51  version 2 of the License, or (at your option) any later version.
52 
53  This library is distributed in the hope that it will be useful,
54  but WITHOUT ANY WARRANTY; without even the implied warranty of
55  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
56  Lesser General Public License for more details.
57 
58  You should have received a copy of the GNU Lesser General Public
59  License along with this library; if not, write to the Free Software
60  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
61 */
Header file that defines ZipInputStreambuf.
ZipInputStreambuf is a zip input streambuf filter.