diff options
| author | ljfa <ljfa-ag@web.de> | 2015-09-21 13:26:04 +0200 |
|---|---|---|
| committer | ljfa <ljfa-ag@web.de> | 2015-09-21 13:26:04 +0200 |
| commit | 76dcc4a9d1c44f7078780dea2756dff3a75d234f (patch) | |
| tree | 16e6b8fbb630de92f11b3b17d067ceb7ae311837 /src | |
| parent | f76d4d228b32e72c7de250cb37af264d38ee7e79 (diff) | |
| download | Project-Tick-76dcc4a9d1c44f7078780dea2756dff3a75d234f.tar.gz Project-Tick-76dcc4a9d1c44f7078780dea2756dff3a75d234f.zip | |
Create zlib_streambuf base class
Diffstat (limited to 'src')
| -rw-r--r-- | src/io/izlibstream.cpp | 7 | ||||
| -rw-r--r-- | src/io/ozlibstream.cpp | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/io/izlibstream.cpp b/src/io/izlibstream.cpp index 6b7a75189a..85e04a189a 100644 --- a/src/io/izlibstream.cpp +++ b/src/io/izlibstream.cpp @@ -18,17 +18,14 @@ * along with libnbt++. If not, see <http://www.gnu.org/licenses/>. */ #include "io/izlibstream.h" -#include "io/zlib_error.h" +#include "io/zlib_streambuf.h" namespace zlib { inflate_streambuf::inflate_streambuf(std::istream& input, size_t bufsize, int window_bits): - is(input), in(bufsize), out(bufsize), stream_end(false) + zlib_streambuf(bufsize), is(input), stream_end(false) { - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = Z_NULL; zstr.next_in = Z_NULL; zstr.avail_in = 0; int ret = inflateInit2(&zstr, window_bits); diff --git a/src/io/ozlibstream.cpp b/src/io/ozlibstream.cpp index 36c6b42d61..73f1057c67 100644 --- a/src/io/ozlibstream.cpp +++ b/src/io/ozlibstream.cpp @@ -18,17 +18,14 @@ * along with libnbt++. If not, see <http://www.gnu.org/licenses/>. */ #include "io/ozlibstream.h" -#include "io/zlib_error.h" +#include "io/zlib_streambuf.h" namespace zlib { deflate_streambuf::deflate_streambuf(std::ostream& output, size_t bufsize, int level, int window_bits, int mem_level, int strategy): - os(output), in(bufsize), out(bufsize) + zlib_streambuf(bufsize), os(output) { - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = Z_NULL; int ret = deflateInit2(&zstr, level, Z_DEFLATED, window_bits, mem_level, strategy); if(ret != Z_OK) throw zlib_error(zstr.msg, ret); |
