00001
00002 #include "zipios++/zipios-config.h"
00003
00004 #include "zipios++/meta-iostreams.h"
00005
00006 #include "zipios++/zipinputstreambuf.h"
00007 #include "zipios++/zipinputstream.h"
00008
00009 using std::istream;
00010
00011 namespace zipios {
00012
00013 ZipInputStream::ZipInputStream( std::istream &is, std::streampos pos )
00014 : istream( 0 ),
00015
00016 ifs( 0 )
00017 {
00018 izf = new ZipInputStreambuf( is.rdbuf(), pos ) ;
00019
00020 this->init( izf ) ;
00021 }
00022
00023 ZipInputStream::ZipInputStream( const std::string &filename, std::streampos pos )
00024 : istream( 0 ),
00025 ifs( 0 )
00026 {
00027 ifs = new std::ifstream( filename.c_str(), std::ios::in |std:: ios::binary ) ;
00028 izf = new ZipInputStreambuf( ifs->rdbuf(), pos ) ;
00029
00030 this->init( izf ) ;
00031 }
00032
00033 int ZipInputStream::available() {
00034 return 1 ;
00035 }
00036
00037 void ZipInputStream::closeEntry() {
00038 izf->closeEntry() ;
00039 }
00040
00041 void ZipInputStream::close() {
00042 izf->close() ;
00043 }
00044
00045
00046
00047
00048 ConstEntryPointer ZipInputStream::getNextEntry() {
00049 clear() ;
00050 return izf->getNextEntry() ;
00051 }
00052
00053 ZipInputStream::~ZipInputStream() {
00054
00055 delete izf ;
00056 delete ifs ;
00057 }
00058
00059 }
00060
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082