Mercurial > vba-linux
diff src/win32/7zip/7z/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.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/Archive/Lzh/LzhOutStreamWithCRC.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,38 @@ 1.4 +// LzhOutStreamWithCRC.h 1.5 + 1.6 +#ifndef __LZHOUTSTREAMWITHCRC_H 1.7 +#define __LZHOUTSTREAMWITHCRC_H 1.8 + 1.9 +#include "LzhCRC.h" 1.10 +#include "../../../Common/MyCom.h" 1.11 +#include "../../IStream.h" 1.12 + 1.13 +namespace NArchive { 1.14 +namespace NLzh { 1.15 + 1.16 +class COutStreamWithCRC: 1.17 + public ISequentialOutStream, 1.18 + public CMyUnknownImp 1.19 +{ 1.20 +public: 1.21 + MY_UNKNOWN_IMP 1.22 + 1.23 + STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); 1.24 +private: 1.25 + CCRC _crc; 1.26 + CMyComPtr<ISequentialOutStream> _stream; 1.27 +public: 1.28 + void Init(ISequentialOutStream *stream) 1.29 + { 1.30 + _stream = stream; 1.31 + _crc.Init(); 1.32 + } 1.33 + void ReleaseStream() { _stream.Release(); } 1.34 + UInt32 GetCRC() const { return _crc.GetDigest(); } 1.35 + void InitCRC() { _crc.Init(); } 1.36 + 1.37 +}; 1.38 + 1.39 +}} 1.40 + 1.41 +#endif