diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7z/CPP/7zip/Compress/PpmdDecoder.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,86 @@
     1.4 +// PpmdDecoder.h
     1.5 +
     1.6 +#ifndef __COMPRESS_PPMD_DECODER_H
     1.7 +#define __COMPRESS_PPMD_DECODER_H
     1.8 +
     1.9 +#include "../../Common/MyCom.h"
    1.10 +
    1.11 +#include "../ICoder.h"
    1.12 +
    1.13 +#include "../Common/OutBuffer.h"
    1.14 +
    1.15 +#include "PpmdDecode.h"
    1.16 +#include "RangeCoder.h"
    1.17 +
    1.18 +namespace NCompress {
    1.19 +namespace NPpmd {
    1.20 +
    1.21 +class CDecoder :
    1.22 +  public ICompressCoder,
    1.23 +  public ICompressSetDecoderProperties2,
    1.24 +  #ifndef NO_READ_FROM_CODER
    1.25 +  public ICompressSetInStream,
    1.26 +  public ICompressSetOutStreamSize,
    1.27 +  public ISequentialInStream,
    1.28 +  #endif
    1.29 +  public CMyUnknownImp
    1.30 +{
    1.31 +  CRangeDecoder _rangeDecoder;
    1.32 +
    1.33 +  COutBuffer _outStream;
    1.34 +
    1.35 +  CDecodeInfo _info;
    1.36 +
    1.37 +  Byte _order;
    1.38 +  UInt32 _usedMemorySize;
    1.39 +
    1.40 +  int _remainLen;
    1.41 +  UInt64 _outSize;
    1.42 +  bool _outSizeDefined;
    1.43 +  UInt64 _processedSize;
    1.44 +
    1.45 +  HRESULT CodeSpec(UInt32 num, Byte *memStream);
    1.46 +
    1.47 +public:
    1.48 +
    1.49 +  #ifndef NO_READ_FROM_CODER
    1.50 +  MY_UNKNOWN_IMP4(
    1.51 +      ICompressSetDecoderProperties2,
    1.52 +      ICompressSetInStream,
    1.53 +      ICompressSetOutStreamSize,
    1.54 +      ISequentialInStream)
    1.55 +  #else
    1.56 +  MY_UNKNOWN_IMP1(
    1.57 +      ICompressSetDecoderProperties2)
    1.58 +  #endif
    1.59 +
    1.60 +  void ReleaseStreams()
    1.61 +  {
    1.62 +    ReleaseInStream();
    1.63 +    _outStream.ReleaseStream();
    1.64 +  }
    1.65 +
    1.66 +  HRESULT Flush() { return _outStream.Flush(); }
    1.67 +
    1.68 +  STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
    1.69 +      const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
    1.70 +
    1.71 +  STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
    1.72 +      const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
    1.73 +
    1.74 +  STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
    1.75 +
    1.76 +  STDMETHOD(SetInStream)(ISequentialInStream *inStream);
    1.77 +  STDMETHOD(ReleaseInStream)();
    1.78 +  STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
    1.79 +
    1.80 +  #ifndef NO_READ_FROM_CODER
    1.81 +  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
    1.82 +  #endif
    1.83 +
    1.84 +  CDecoder(): _outSizeDefined(false) {}
    1.85 +};
    1.86 +
    1.87 +}}
    1.88 +
    1.89 +#endif