michael@0: // OutStreamWithCRC.h michael@0: michael@0: #ifndef __OUTSTREAMWITHCRC_H michael@0: #define __OUTSTREAMWITHCRC_H michael@0: michael@0: #include "../../../Common/CRC.h" michael@0: #include "../../../Common/MyCom.h" michael@0: #include "../../IStream.h" michael@0: michael@0: class COutStreamWithCRC: michael@0: public ISequentialOutStream, michael@0: public CMyUnknownImp michael@0: { michael@0: public: michael@0: MY_UNKNOWN_IMP michael@0: michael@0: STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); michael@0: private: michael@0: CCRC _crc; michael@0: CMyComPtr _stream; michael@0: public: michael@0: void Init(ISequentialOutStream *stream) michael@0: { michael@0: _stream = stream; michael@0: _crc.Init(); michael@0: } michael@0: void ReleaseStream() { _stream.Release(); } michael@0: UInt32 GetCRC() const { return _crc.GetDigest(); } michael@0: void InitCRC() { _crc.Init(); } michael@0: michael@0: }; michael@0: michael@0: #endif