1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync// Lzma2Decoder.h
2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef __LZMA2_DECODER_H
4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define __LZMA2_DECODER_H
5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "../../../C/Lzma2Dec.h"
7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "../../Common/MyCom.h"
9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
10baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "../ICoder.h"
11baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
12baa3858d3f5d128a5c8466b700098109edcad5f2repo syncnamespace NCompress {
13baa3858d3f5d128a5c8466b700098109edcad5f2repo syncnamespace NLzma2 {
14baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
15baa3858d3f5d128a5c8466b700098109edcad5f2repo syncclass CDecoder:
16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ICompressCoder,
17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ICompressSetDecoderProperties2,
18baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ICompressGetInStreamProcessedSize,
19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #ifndef NO_READ_FROM_CODER
20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ICompressSetInStream,
21baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ICompressSetOutStreamSize,
22baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public ISequentialInStream,
23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #endif
24baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  public CMyUnknownImp
25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CMyComPtr<ISequentialInStream> _inStream;
27baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  Byte *_inBuf;
28baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  UInt32 _inPos;
29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  UInt32 _inSize;
30baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CLzma2Dec _state;
31baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  bool _outSizeDefined;
32baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  UInt64 _outSize;
33baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  UInt64 _inSizeProcessed;
34baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  UInt64 _outSizeProcessed;
35baa3858d3f5d128a5c8466b700098109edcad5f2repo syncpublic:
36baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
37baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #ifndef NO_READ_FROM_CODER
38baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MY_UNKNOWN_IMP5(
39baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressSetDecoderProperties2,
40baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressGetInStreamProcessedSize,
41baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressSetInStream,
42baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressSetOutStreamSize,
43baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ISequentialInStream)
44baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #else
45baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MY_UNKNOWN_IMP2(
46baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressSetDecoderProperties2,
47baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressGetInStreamProcessedSize)
48baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #endif
49baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
50baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(Code)(ISequentialInStream *inStream,
51baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ISequentialOutStream *outStream, const UInt64 *_inSize, const UInt64 *outSize,
52baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      ICompressProgressInfo *progress);
53baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
54baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
55baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
56baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
57baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
58baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(SetInStream)(ISequentialInStream *inStream);
59baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(ReleaseInStream)();
60baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
61baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
62baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #ifndef NO_READ_FROM_CODER
63baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
64baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #endif
65baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
66baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CDecoder();
67baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  virtual ~CDecoder();
68baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
69baa3858d3f5d128a5c8466b700098109edcad5f2repo sync};
70baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
71baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}}
72baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
73baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
74