This commit is contained in:
Igor Pavlov
2014-11-23 00:00:00 +00:00
committed by Kornel Lesiński
parent 83f8ddcc5b
commit f08f4dcc3c
1158 changed files with 76451 additions and 35082 deletions

26
CPP/7zip/Compress/ZDecoder.h Executable file → Normal file
View File

@@ -10,33 +10,45 @@
namespace NCompress {
namespace NZ {
// Z decoder decodes Z data stream, including 3 bytes of header.
class CDecoder:
public ICompressCoder,
public ICompressSetDecoderProperties2,
public CMyUnknownImp
{
UInt16 *_parents;
Byte *_suffixes;
Byte *_stack;
Byte _properties;
int _numMaxBits;
unsigned _numMaxBits;
public:
CDecoder(): _parents(0), _suffixes(0), _stack(0), _properties(0), _numMaxBits(0) {};
CDecoder(): _parents(0), _suffixes(0), _stack(0), /* _prop(0), */ _numMaxBits(0) {};
~CDecoder();
void Free();
UInt64 PackSize;
MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2)
MY_UNKNOWN_IMP1(ICompressCoder)
HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
};
/*
There is no end_of_payload_marker in Z stream.
Z decoder stops decoding, if it reaches end of input stream.
CheckStream function:
(size) must be at least 3 bytes (size of Z header).
if (size) is larger than size of real Z stream in (data), CheckStream can return false.
*/
const unsigned kRecommendedCheckSize = 64;
bool CheckStream(const Byte *data, size_t size);
}}
#endif