zipios 2.3.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. | |
ZipInputStreambuf (ZipInputStreambuf const &src)=delete | |
The copy constructor is deleted. | |
virtual | ~ZipInputStreambuf () override |
Clean up a ZipInputStreambuf object. | |
ZipInputStreambuf & | operator= (ZipInputStreambuf const &rhs)=delete |
bool | reset (offset_t stream_position=-1) |
Initializes the stream buffer. |
Protected Member Functions | |
virtual std::streambuf::int_type | underflow () override |
Called when more data is required. |
Protected Attributes | |
std::streambuf * | m_inbuf = nullptr |
std::vector< char > | m_outvec = std::vector<char>() |
Private Attributes | |
ZipLocalEntry | m_current_entry = ZipLocalEntry() |
std::vector< char > | m_invec = std::vector<char>() |
offset_t | m_remain = 0 |
z_stream | m_zs = z_stream() |
bool | m_zs_initialized = false |
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 57 of file zipinputstreambuf.cpp.
References zipios::InflateInputStreambuf::InflateInputStreambuf(), zipios::DEFLATED, zipios::getBufferSize(), m_current_entry, zipios::FilterInputStreambuf::m_inbuf, zipios::InflateInputStreambuf::m_outvec, m_remain, zipios::InflateInputStreambuf::reset(), and zipios::STORED.
Referenced by ZipInputStreambuf(), and operator=().
|
delete |
ZipInputStreambuf objects cannot be copied so the copy constructor is deleted.
[in] | src | The source to copy. |
References ZipInputStreambuf().
|
overridevirtual |
The destructor ensures that all resources get released.
Definition at line 108 of file zipinputstreambuf.cpp.
|
delete |
References ZipInputStreambuf().
|
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 208 of file inflateinputstreambuf.cpp.
References zipios::getBufferSize(), zipios::FilterInputStreambuf::m_inbuf, m_invec, m_outvec, m_zs, and m_zs_initialized.
Referenced by InflateInputStreambuf(), and zipios::ZipInputStreambuf::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(), 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 ZipInputStreambuf(), and underflow().
|
protectedinherited |
Definition at line 47 of file filterinputstreambuf.hpp.
Referenced by FilterInputStreambuf(), zipios::ZipInputStreambuf::ZipInputStreambuf(), zipios::InflateInputStreambuf::reset(), zipios::InflateInputStreambuf::underflow(), and zipios::ZipInputStreambuf::underflow().
|
privateinherited |
Definition at line 66 of file inflateinputstreambuf.hpp.
Referenced by InflateInputStreambuf(), reset(), and underflow().
|
protectedinherited |
Definition at line 63 of file inflateinputstreambuf.hpp.
Referenced by InflateInputStreambuf(), zipios::ZipInputStreambuf::ZipInputStreambuf(), reset(), underflow(), and zipios::ZipInputStreambuf::underflow().
|
private |
Definition at line 55 of file zipinputstreambuf.hpp.
Referenced by ZipInputStreambuf(), and underflow().
|
privateinherited |
Definition at line 68 of file inflateinputstreambuf.hpp.
Referenced by ~InflateInputStreambuf(), reset(), and underflow().
|
privateinherited |
Definition at line 69 of file inflateinputstreambuf.hpp.
Referenced by reset().