diff options
Diffstat (limited to 'CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.h')
-rwxr-xr-x | CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.h b/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.h new file mode 100755 index 00000000..31b536b7 --- /dev/null +++ b/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.h @@ -0,0 +1,38 @@ +// LzhOutStreamWithCRC.h + +#ifndef __LZHOUTSTREAMWITHCRC_H +#define __LZHOUTSTREAMWITHCRC_H + +#include "LzhCRC.h" +#include "../../../Common/MyCom.h" +#include "../../IStream.h" + +namespace NArchive { +namespace NLzh { + +class COutStreamWithCRC: + public ISequentialOutStream, + public CMyUnknownImp +{ +public: + MY_UNKNOWN_IMP + + STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); +private: + CCRC _crc; + CMyComPtr<ISequentialOutStream> _stream; +public: + void Init(ISequentialOutStream *stream) + { + _stream = stream; + _crc.Init(); + } + void ReleaseStream() { _stream.Release(); } + UInt32 GetCRC() const { return _crc.GetDigest(); } + void InitCRC() { _crc.Init(); } + +}; + +}} + +#endif |