2#include "zipios++/zipios-config.h"
5#include "zipios++/meta-iostreams.h"
24 if ( ! entry->isValid() ) {
34 int position = _inbuf->pubseekoff(0, ios::cur,
36 if ( position != _data_start +
static_cast< int >( _curr_entry.
getCompressedSize() ) )
50 istream is( _inbuf ) ;
51 is.exceptions(istream::eofbit | istream::failbit | istream::badbit);
53 if ( _curr_entry.isValid() ) {
54 _data_start = _inbuf->pubseekoff(0, ios::cur,
56 if ( _curr_entry.getMethod() == DEFLATED ) {
60 }
else if ( _curr_entry.getMethod() == STORED ) {
62 _remain = _curr_entry.getSize() ;
64 setg( &( _outvec[ 0 ] ),
65 &( _outvec[ 0 ] ) + _outvecsize,
66 &( _outvec[ 0 ] ) + _outvecsize ) ;
76 if ( _curr_entry.isValid() && _curr_entry.trailingDataDescriptor() )
77 throw FCollException(
"Trailing data descriptor in zip file not supported" ) ;
86int ZipInputStreambuf::underflow() {
89 if ( _curr_entry.
getMethod() == DEFLATED )
90 return InflateInputStreambuf::underflow() ;
93 int num_b = min( _remain, _outvecsize ) ;
94 int g = _inbuf->sgetn( &(_outvec[ 0 ] ) , num_b ) ;
95 setg( &( _outvec[ 0 ] ),
97 &( _outvec[ 0 ] ) + g ) ;
100 return static_cast< unsigned char >( *gptr() ) ;
An FCollException is used to signal a problem with a FileCollection.
SimpleSmartPointer is a simple reference counting smart pointer template.
A concrete implementation of the abstract FileEntry base class for ZipFile entries,...
virtual StorageMethod getMethod() const
Returns the method used to store the entry in the FileCollection.
virtual uint32 getCompressedSize() const
Returns the compressed size of the entry.
Header file containing miscellaneous small functions.