comparison src/win32/7zip/7z/CPP/7zip/Compress/PpmdDecoder.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
comparison
equal deleted inserted replaced
0:8ced16adf2e1 1:f9f4f1b99eed
1 // PpmdDecoder.h
2
3 #ifndef __COMPRESS_PPMD_DECODER_H
4 #define __COMPRESS_PPMD_DECODER_H
5
6 #include "../../Common/MyCom.h"
7
8 #include "../ICoder.h"
9
10 #include "../Common/OutBuffer.h"
11
12 #include "PpmdDecode.h"
13 #include "RangeCoder.h"
14
15 namespace NCompress {
16 namespace NPpmd {
17
18 class CDecoder :
19 public ICompressCoder,
20 public ICompressSetDecoderProperties2,
21 #ifndef NO_READ_FROM_CODER
22 public ICompressSetInStream,
23 public ICompressSetOutStreamSize,
24 public ISequentialInStream,
25 #endif
26 public CMyUnknownImp
27 {
28 CRangeDecoder _rangeDecoder;
29
30 COutBuffer _outStream;
31
32 CDecodeInfo _info;
33
34 Byte _order;
35 UInt32 _usedMemorySize;
36
37 int _remainLen;
38 UInt64 _outSize;
39 bool _outSizeDefined;
40 UInt64 _processedSize;
41
42 HRESULT CodeSpec(UInt32 num, Byte *memStream);
43
44 public:
45
46 #ifndef NO_READ_FROM_CODER
47 MY_UNKNOWN_IMP4(
48 ICompressSetDecoderProperties2,
49 ICompressSetInStream,
50 ICompressSetOutStreamSize,
51 ISequentialInStream)
52 #else
53 MY_UNKNOWN_IMP1(
54 ICompressSetDecoderProperties2)
55 #endif
56
57 void ReleaseStreams()
58 {
59 ReleaseInStream();
60 _outStream.ReleaseStream();
61 }
62
63 HRESULT Flush() { return _outStream.Flush(); }
64
65 STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
66 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
67
68 STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
69 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
70
71 STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
72
73 STDMETHOD(SetInStream)(ISequentialInStream *inStream);
74 STDMETHOD(ReleaseInStream)();
75 STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
76
77 #ifndef NO_READ_FROM_CODER
78 STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
79 #endif
80
81 CDecoder(): _outSizeDefined(false) {}
82 };
83
84 }}
85
86 #endif