Zipios++
|
00001 00002 #include "zipios++/zipios-config.h" 00003 00004 #include "zipios++/meta-iostreams.h" 00005 00006 #include "zipios++/fcollexceptions.h" 00007 #include "zipios++/zipinputstream.h" 00008 00009 using namespace zipios ; 00010 00011 using std::cerr ; 00012 using std::cout ; 00013 using std::endl ; 00014 00015 int main() { 00016 try { 00017 ZipInputStream is( "test.zip" ) ; 00018 00019 // string str ; 00020 // while ( is ) { 00021 // getline( is, str ) ; 00022 // cout << str ; 00023 // } 00024 00025 cout << is.rdbuf() ; 00026 00027 is.getNextEntry() ; 00028 00029 cout << is.rdbuf() ; 00030 00031 is.getNextEntry() ; 00032 00033 cout << is.rdbuf() ; 00034 00035 cerr << "Stream.state:" << endl ; 00036 cerr << "is.good() = " << is.good() << endl ; 00037 cerr << "is.fail() = " << is.fail() << endl ; 00038 cerr << "is.bad() = " << is.bad() << endl ; 00039 cerr << "is.eof() = " << is.eof() << endl << endl; 00040 cerr << "End of main" << endl ; 00041 } 00042 catch( IOException &e ) { 00043 cerr << "IOException caught in main:" << endl ; 00044 cerr << e.what() << endl ; 00045 } 00046 catch( ... ) { 00047 cerr << "Unspecified exception caught in main:" << endl ; 00048 } 00049 00050 return 0; 00051 } 00052 00057 /* 00058 Zipios++ - a small C++ library that provides easy access to .zip files. 00059 Copyright (C) 2000 Thomas Søndergaard 00060 00061 This library is free software; you can redistribute it and/or 00062 modify it under the terms of the GNU Lesser General Public 00063 License as published by the Free Software Foundation; either 00064 version 2 of the License, or (at your option) any later version. 00065 00066 This library is distributed in the hope that it will be useful, 00067 but WITHOUT ANY WARRANTY; without even the implied warranty of 00068 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00069 Lesser General Public License for more details. 00070 00071 You should have received a copy of the GNU Lesser General Public 00072 License along with this library; if not, write to the Free Software 00073 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00074 */