Zipios++
test_zipinputstreambuf.cpp
Go to the documentation of this file.
00001 
00002 #include "zipios++/zipios-config.h"
00003 
00004 #include "zipios++/meta-iostreams.h"
00005 
00006 #include "zipios++/zipinputstreambuf.h"
00007 
00008 using namespace zipios ;
00009 
00010 using std::cerr ;
00011 using std::cout ;
00012 using std::endl ;
00013 using std::ifstream ;
00014 using std::ios ;
00015 
00016 int main() {
00017   ifstream f( "test.zip", ios::in | ios::binary ) ;
00018   ZipInputStreambuf izf( f.rdbuf() ) ;
00019   istream is( &izf ) ;
00020 
00021 //    string str ;
00022 //    while ( is ) {
00023 //      getline( is, str ) ; 
00024 //      cout << str ;
00025 //    }
00026   
00027   
00028   cout << is.rdbuf() ;
00029 
00030   izf.getNextEntry() ;
00031   istream is2( &izf ) ;
00032 
00033   cout << is2.rdbuf() ;
00034 
00035   cerr << "End of main" << endl ;
00036 
00037   return 0;
00038 }
00039 
00044 /*
00045   Zipios++ - a small C++ library that provides easy access to .zip files.
00046   Copyright (C) 2000  Thomas Søndergaard
00047   
00048   This library is free software; you can redistribute it and/or
00049   modify it under the terms of the GNU Lesser General Public
00050   License as published by the Free Software Foundation; either
00051   version 2 of the License, or (at your option) any later version.
00052   
00053   This library is distributed in the hope that it will be useful,
00054   but WITHOUT ANY WARRANTY; without even the implied warranty of
00055   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00056   Lesser General Public License for more details.
00057   
00058   You should have received a copy of the GNU Lesser General Public
00059   License along with this library; if not, write to the Free Software
00060   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00061 */