view src/win32/7zip/7z/CPP/7zip/Compress/ZlibDecoder.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // ZlibDecoder.h
3 #ifndef __ZLIB_DECODER_H
4 #define __ZLIB_DECODER_H
6 #include "DeflateDecoder.h"
8 namespace NCompress {
9 namespace NZlib {
11 const UInt32 ADLER_INIT_VAL = 1;
13 class COutStreamWithAdler:
14 public ISequentialOutStream,
15 public CMyUnknownImp
16 {
17 CMyComPtr<ISequentialOutStream> _stream;
18 UInt32 _adler;
19 public:
20 MY_UNKNOWN_IMP
21 STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
22 void SetStream(ISequentialOutStream *stream) { _stream = stream; }
23 void ReleaseStream() { _stream.Release(); }
24 void Init() { _adler = ADLER_INIT_VAL; }
25 UInt32 GetAdler() const { return _adler; }
26 };
28 class CDecoder:
29 public ICompressCoder,
30 public CMyUnknownImp
31 {
32 COutStreamWithAdler *AdlerSpec;
33 CMyComPtr<ISequentialOutStream> AdlerStream;
35 NCompress::NDeflate::NDecoder::CCOMCoder *DeflateDecoderSpec;
36 CMyComPtr<ICompressCoder> DeflateDecoder;
37 public:
38 STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
39 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
41 MY_UNKNOWN_IMP
42 };
44 }}
46 #endif