2009-11-15 00:08:33 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2014-02-10 21:21:50 +04:00
|
|
|
#ifndef _PRIVATE__ZLIB_DECOMPRESSOR_H_
|
|
|
|
#define _PRIVATE__ZLIB_DECOMPRESSOR_H_
|
2009-11-15 00:08:33 +03:00
|
|
|
|
|
|
|
|
2009-11-16 00:29:53 +03:00
|
|
|
#include <zlib.h>
|
|
|
|
|
2014-02-10 21:21:50 +04:00
|
|
|
#include <ZlibCompressionBase.h>
|
2011-01-28 02:17:03 +03:00
|
|
|
|
|
|
|
|
2014-02-10 21:21:50 +04:00
|
|
|
class BDataIO;
|
2009-11-15 00:08:33 +03:00
|
|
|
|
|
|
|
|
2011-01-30 18:05:38 +03:00
|
|
|
namespace BPrivate {
|
2009-11-16 00:29:53 +03:00
|
|
|
|
|
|
|
|
2009-11-15 00:08:33 +03:00
|
|
|
class ZlibDecompressor : public ZlibCompressionBase {
|
|
|
|
public:
|
2014-02-10 21:21:50 +04:00
|
|
|
ZlibDecompressor(BDataIO* output);
|
2009-11-15 00:08:33 +03:00
|
|
|
~ZlibDecompressor();
|
|
|
|
|
2009-11-16 00:29:53 +03:00
|
|
|
status_t Init();
|
|
|
|
status_t DecompressNext(const void* input,
|
|
|
|
size_t inputSize);
|
|
|
|
status_t Finish();
|
|
|
|
|
|
|
|
static status_t DecompressSingleBuffer(const void* input,
|
|
|
|
size_t inputSize, void* output,
|
|
|
|
size_t outputSize,
|
2009-11-15 00:08:33 +03:00
|
|
|
size_t& _uncompressedSize);
|
2009-11-16 00:29:53 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
z_stream fStream;
|
2014-02-10 21:21:50 +04:00
|
|
|
BDataIO* fOutput;
|
2009-11-16 00:29:53 +03:00
|
|
|
bool fStreamInitialized;
|
|
|
|
bool fFinished;
|
2009-11-15 00:08:33 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-28 02:17:03 +03:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
2011-01-30 18:05:38 +03:00
|
|
|
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|