zipinputstreambuf.h
Go to the documentation of this file.
#ifndef ZIPINPUTSTREAMBUF_H
#define ZIPINPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <zlib.h>
#include "zipios++/fcoll.h"
#include "zipios++/inflateinputstreambuf.h"
#include "zipios++/ziphead.h"
namespace zipios {
class ZipInputStreambuf : public InflateInputStreambuf {
public:
explicit ZipInputStreambuf( streambuf *inbuf, int s_pos = -1, bool del_inbuf = false ) ;
void closeEntry() ;
void close() ;
ConstEntryPointer getNextEntry() ;
virtual ~ZipInputStreambuf() ;
protected:
virtual int underflow() ;
private:
bool _open_entry ;
ZipLocalEntry _curr_entry ;
int _data_start ; // Don't forget entry header has a length too.
int _remain ; // For STORED entry only. the number of bytes that
// hasn't been put in the _outvec yet.
ZipInputStreambuf( const ZipInputStreambuf &src ) ;
const ZipInputStreambuf &operator= ( const ZipInputStreambuf &src ) ;
};
} // namespace
#endif
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
zipios::InflateInputStreambuf::InflateInputStreambuf
InflateInputStreambuf(streambuf *inbuf, int s_pos=-1, bool del_inbuf=false)
InflateInputStreambuf constructor.
Definition inflateinputstreambuf.cpp:18
zipios::ZipInputStreambuf::closeEntry
void closeEntry()
Closes the current entry, and positions the stream read pointer at the beginning of the next entry (i...
Definition zipinputstreambuf.cpp:29
zipios::ZipInputStreambuf::~ZipInputStreambuf
virtual ~ZipInputStreambuf()
Destructor.
Definition zipinputstreambuf.cpp:82
zipios::ZipInputStreambuf::getNextEntry
ConstEntryPointer getNextEntry()
Opens the next entry in the zip archive and returns a const pointer to a FileEntry object for the ent...
Definition zipinputstreambuf.cpp:45
zipios::ZipInputStreambuf::ZipInputStreambuf
ZipInputStreambuf(streambuf *inbuf, int s_pos=-1, bool del_inbuf=false)
ZipInputStreambuf constructor.
Definition zipinputstreambuf.cpp:18
zipios::ZipInputStreambuf::close
void close()
Closes the streambuf.
Definition zipinputstreambuf.cpp:42
zipios::ZipLocalEntry
A concrete implementation of the abstract FileEntry base class for ZipFile entries,...
Definition ziphead.h:22
fcoll.h
Header file that defines FileCollection.
zipios::ConstEntryPointer
SimpleSmartPointer< const FileEntry > ConstEntryPointer
ConstEntryPointer is a SimpleSmartPointer for const FileEntry's.
Definition fileentry.h:37
inflateinputstreambuf.h
Header file that defines InflateInputStreambuf.
ziphead.h
Header file containing classes and functions for reading the central directory and local header field...