other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // OutStreamWithCRC.h
     3 #ifndef __OUTSTREAMWITHCRC_H
     4 #define __OUTSTREAMWITHCRC_H
     6 #include "../../../Common/CRC.h"
     7 #include "../../../Common/MyCom.h"
     8 #include "../../IStream.h"
    10 class COutStreamWithCRC: 
    11   public ISequentialOutStream,
    12   public CMyUnknownImp
    13 {
    14 public:
    15   MY_UNKNOWN_IMP
    17   STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
    18 private:
    19   CCRC _crc;
    20   CMyComPtr<ISequentialOutStream> _stream;
    21 public:
    22   void Init(ISequentialOutStream *stream)
    23   {
    24     _stream = stream;
    25     _crc.Init();
    26   }
    27   void ReleaseStream() { _stream.Release(); }
    28   UInt32 GetCRC() const { return _crc.GetDigest(); }
    29   void InitCRC() { _crc.Init(); }
    31 };
    33 #endif

mercurial