1 #ifndef ZIPINPUTSTREAMBUF_H
2 #define ZIPINPUTSTREAMBUF_H
4 #include "zipios++/zipios-config.h"
10 #include "zipios++/fcoll.h"
11 #include "zipios++/inflateinputstreambuf.h"
12 #include "zipios++/ziphead.h"
16 /** ZipInputStreambuf is a zip input streambuf filter.
18 class ZipInputStreambuf : public InflateInputStreambuf {
20 /** ZipInputStreambuf constructor.
21 @param inbuf the streambuf to use for input.
22 @param s_pos a position to reset the inbuf to before reading. Specify
23 -1 to read from the current position.
24 @param del_inbuf if true is specified inbuf will be deleted, when
25 the ZipInputStreambuf is destructed.
27 explicit ZipInputStreambuf( streambuf *inbuf, int s_pos = -1, bool del_inbuf = false ) ;
29 /** Closes the current entry, and positions the stream read pointer at
30 the beginning of the next entry (if there is one). */
32 /** Closes the streambuf. */
35 /** Opens the next entry in the zip archive and returns a const pointer to a
36 FileEntry object for the entry.
37 @return a const FileEntry * containing information about the (now) current
40 ConstEntryPointer getNextEntry() ;
43 virtual ~ZipInputStreambuf() ;
45 virtual int underflow() ;
48 ZipLocalEntry _curr_entry ;
49 int _data_start ; // Don't forget entry header has a length too.
50 int _remain ; // For STORED entry only. the number of bytes that
51 // hasn't been put in the _outvec yet.
53 /** Copy-constructor is private to prevent copying. */
54 ZipInputStreambuf( const ZipInputStreambuf &src ) ;
56 /** Copy-assignment operator is private to prevent copying. */
57 const ZipInputStreambuf &operator= ( const ZipInputStreambuf &src ) ;
69 Header file that defines ZipInputStreambuf.
73 Zipios++ - a small C++ library that provides easy access to .zip files.
74 Copyright (C) 2000 Thomas Søndergaard
76 This library is free software; you can redistribute it and/or
77 modify it under the terms of the GNU Lesser General Public
78 License as published by the Free Software Foundation; either
79 version 2 of the License, or (at your option) any later version.
81 This library is distributed in the hope that it will be useful,
82 but WITHOUT ANY WARRANTY; without even the implied warranty of
83 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
84 Lesser General Public License for more details.
86 You should have received a copy of the GNU Lesser General Public
87 License along with this library; if not, write to the Free Software
88 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA