zipios++
2.0.2
Zipios++ – a small C++ library that provides easy access to .zip files.
|
An input stream buffer for Zip data. More...
#include <zipinputstreambuf.hpp>
Public Member Functions | |
ZipInputStreambuf (std::streambuf *inbuf, offset_t start_pos=-1) | |
Initialize a ZipInputStreambuf. More... | |
ZipInputStreambuf (ZipInputStreambuf const &src)=delete | |
The copy contructor is deleted. More... | |
virtual | ~ZipInputStreambuf () override |
Clean up a ZipInputStreambuf object. More... | |
ZipInputStreambuf & | operator= (ZipInputStreambuf const &rhs)=delete |
bool | reset (offset_t stream_position=-1) |
Initializes the stream buffer. More... | |
Protected Member Functions | |
virtual std::streambuf::int_type | underflow () override |
Called when more data is required. More... | |
Protected Attributes | |
std::streambuf * | m_inbuf |
std::vector< char > | m_outvec |
Private Attributes | |
ZipLocalEntry | m_current_entry |
offset_t | m_remain = 0 |
The ZipInputStreambuf class is a Zip input streambuf filter that automatically decompresses input data that was compressed using the zlib library.
Definition at line 42 of file zipinputstreambuf.hpp.
zipios::ZipInputStreambuf::ZipInputStreambuf | ( | std::streambuf * | inbuf, |
offset_t | start_pos = -1 |
||
) |
This ZipInputStreambuf constructor initializes the buffer from the user specified buffer.
[in,out] | inbuf | The streambuf to use for input. |
[in] | start_pos | A position to reset the inbuf to before reading. Specify -1 to read from the current position. |
Definition at line 55 of file zipinputstreambuf.cpp.
References zipios::DEFLATED, zipios::getBufferSize(), zipios::FileEntry::getMethod(), zipios::FileEntry::getSize(), zipios::ZipLocalEntry::hasTrailingDataDescriptor(), zipios::FileEntry::isValid(), m_current_entry, zipios::FilterInputStreambuf::m_inbuf, zipios::InflateInputStreambuf::m_outvec, m_remain, zipios::ZipLocalEntry::read(), zipios::InflateInputStreambuf::reset(), and zipios::STORED.
|
delete |
ZipInputStreambuf objects cannot be copied so the copy constructor is deleted.
[in] | src | The source to copy. |
|
overridevirtual |
The destructor ensures that all resources get released.
Definition at line 108 of file zipinputstreambuf.cpp.
|
delete |
|
inherited |
This function resets the zlib stream and purges input and output buffers. It also repositions the input streambuf at stream_position.
[in] | stream_position | A position to reset the inbuf to before reading. Specify -1 to read from the current position. |
Definition at line 215 of file inflateinputstreambuf.cpp.
References zipios::getBufferSize(), zipios::FilterInputStreambuf::m_inbuf, zipios::InflateInputStreambuf::m_invec, zipios::InflateInputStreambuf::m_outvec, zipios::InflateInputStreambuf::m_zs, and zipios::InflateInputStreambuf::m_zs_initialized.
Referenced by zipios::InflateInputStreambuf::InflateInputStreambuf(), and ZipInputStreambuf().
|
overrideprotectedvirtual |
The function ensures that at least one byte is available in the input area by updating the pointers to the input area and reading more data in from the input sequence if required.
Reimplemented from zipios::InflateInputStreambuf.
Definition at line 122 of file zipinputstreambuf.cpp.
References zipios::DEFLATED, zipios::getBufferSize(), zipios::FileEntry::getMethod(), m_current_entry, zipios::FilterInputStreambuf::m_inbuf, zipios::InflateInputStreambuf::m_outvec, m_remain, zipios::STORED, and zipios::InflateInputStreambuf::underflow().
|
private |
Definition at line 54 of file zipinputstreambuf.hpp.
Referenced by underflow(), and ZipInputStreambuf().
|
protectedinherited |
Definition at line 46 of file filterinputstreambuf.hpp.
Referenced by zipios::FilterInputStreambuf::FilterInputStreambuf(), zipios::InflateInputStreambuf::reset(), underflow(), zipios::InflateInputStreambuf::underflow(), and ZipInputStreambuf().
|
protectedinherited |
Definition at line 62 of file inflateinputstreambuf.hpp.
Referenced by zipios::InflateInputStreambuf::reset(), underflow(), zipios::InflateInputStreambuf::underflow(), and ZipInputStreambuf().
|
private |
Definition at line 55 of file zipinputstreambuf.hpp.
Referenced by underflow(), and ZipInputStreambuf().