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