zipios  2.2.0
Zipios – a small C++ library that provides easy access to .zip files.
inflateinputstreambuf.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef INFLATEINPUTSTREAMBUF_HPP
3 #define INFLATEINPUTSTREAMBUF_HPP
4 
5 /*
6  Zipios -- a small C++ library that provides easy access to .zip files.
7 
8  Copyright (C) 2000-2007 Thomas Sondergaard
9  Copyright (C) 2015-2019 Made to Order Software Corporation
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 2.1 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25 
34 #include "filterinputstreambuf.hpp"
35 
36 #include "zipios/zipios-config.hpp"
37 
38 #include <vector>
39 
40 #include <zlib.h>
41 
42 
43 namespace zipios
44 {
45 
46 
48 {
49 public:
50  InflateInputStreambuf(std::streambuf *inbuf, offset_t s_pos = -1);
51  InflateInputStreambuf(InflateInputStreambuf const& src) = delete;
53  virtual ~InflateInputStreambuf();
54 
55  bool reset(offset_t stream_position = -1);
56 
57 protected:
58  virtual std::streambuf::int_type underflow() override;
59 
62  std::vector<char> m_outvec;
63 
64 private:
65  std::vector<char> m_invec;
66 
67  z_stream m_zs;
68  bool m_zs_initialized = false;
69 };
70 
71 
72 } // namespace
73 
74 // Local Variables:
75 // mode: cpp
76 // indent-tabs-mode: nil
77 // c-basic-offset: 4
78 // tab-width: 4
79 // End:
80 
81 // vim: ts=4 sw=4 et
82 #endif
The zipios namespace includes the Zipios library definitions.
Definition: backbuffer.cpp:35
Header file that defines zipios::FilterInputStreambuf.
InflateInputStreambuf & operator=(InflateInputStreambuf const &src)=delete
bool reset(offset_t stream_position=-1)
Initializes the stream buffer.
A stream buffer to inflate data previous compressed with zlib.
InflateInputStreambuf(std::streambuf *inbuf, offset_t s_pos=-1)
Initialize a InflateInputStreambuf.
zipios configuration header.
virtual ~InflateInputStreambuf()
Clean up the InflateInputStreambuf object.
std::streamoff offset_t
virtual std::streambuf::int_type underflow() override
Called when more data is required.
A base class to develop input stream filters.