diff options
Diffstat (limited to 'CPP/7zip/Compress/Rar3Decoder.h')
-rw-r--r-- | CPP/7zip/Compress/Rar3Decoder.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/CPP/7zip/Compress/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h index fdecc55..4711052 100644 --- a/CPP/7zip/Compress/Rar3Decoder.h +++ b/CPP/7zip/Compress/Rar3Decoder.h | |||
@@ -4,8 +4,8 @@ | |||
4 | 4 | ||
5 | /* This code uses Carryless rangecoder (1999): Dmitry Subbotin : Public domain */ | 5 | /* This code uses Carryless rangecoder (1999): Dmitry Subbotin : Public domain */ |
6 | 6 | ||
7 | #ifndef __COMPRESS_RAR3_DECODER_H | 7 | #ifndef ZIP7_INC_COMPRESS_RAR3_DECODER_H |
8 | #define __COMPRESS_RAR3_DECODER_H | 8 | #define ZIP7_INC_COMPRESS_RAR3_DECODER_H |
9 | 9 | ||
10 | #include "../../../C/Ppmd7.h" | 10 | #include "../../../C/Ppmd7.h" |
11 | 11 | ||
@@ -156,11 +156,11 @@ struct CTempFilter: public NVm::CProgramInitState | |||
156 | 156 | ||
157 | const unsigned kNumHuffmanBits = 15; | 157 | const unsigned kNumHuffmanBits = 15; |
158 | 158 | ||
159 | class CDecoder: | 159 | Z7_CLASS_IMP_NOQIB_2( |
160 | public ICompressCoder, | 160 | CDecoder |
161 | public ICompressSetDecoderProperties2, | 161 | , ICompressCoder |
162 | public CMyUnknownImp | 162 | , ICompressSetDecoderProperties2 |
163 | { | 163 | ) |
164 | CByteIn m_InBitStream; | 164 | CByteIn m_InBitStream; |
165 | Byte *_window; | 165 | Byte *_window; |
166 | UInt32 _winPos; | 166 | UInt32 _winPos; |
@@ -231,17 +231,6 @@ class CDecoder: | |||
231 | bool InputEofError() const { return m_InBitStream.BitDecoder.ExtraBitsWereRead(); } | 231 | bool InputEofError() const { return m_InBitStream.BitDecoder.ExtraBitsWereRead(); } |
232 | bool InputEofError_Fast() const { return (m_InBitStream.BitDecoder.Stream.NumExtraBytes > 2); } | 232 | bool InputEofError_Fast() const { return (m_InBitStream.BitDecoder.Stream.NumExtraBytes > 2); } |
233 | 233 | ||
234 | public: | ||
235 | CDecoder(); | ||
236 | ~CDecoder(); | ||
237 | |||
238 | MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2) | ||
239 | |||
240 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, | ||
241 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); | ||
242 | |||
243 | STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size); | ||
244 | |||
245 | void CopyBlock(UInt32 dist, UInt32 len) | 234 | void CopyBlock(UInt32 dist, UInt32 len) |
246 | { | 235 | { |
247 | _lzSize += len; | 236 | _lzSize += len; |
@@ -270,11 +259,15 @@ public: | |||
270 | 259 | ||
271 | void PutByte(Byte b) | 260 | void PutByte(Byte b) |
272 | { | 261 | { |
273 | UInt32 wp = _winPos; | 262 | const UInt32 wp = _winPos; |
274 | _window[wp] = b; | 263 | _window[wp] = b; |
275 | _winPos = (wp + 1) & kWindowMask; | 264 | _winPos = (wp + 1) & kWindowMask; |
276 | _lzSize++; | 265 | _lzSize++; |
277 | } | 266 | } |
267 | |||
268 | public: | ||
269 | CDecoder(); | ||
270 | ~CDecoder(); | ||
278 | }; | 271 | }; |
279 | 272 | ||
280 | }} | 273 | }} |