Mercurial > vba-linux
view src/win32/7zip/7z/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp @ 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 source
1 // OutStreamWithCRC.cpp3 #include "StdAfx.h"5 #include "OutStreamWithCRC.h"7 STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)8 {9 UInt32 realProcessedSize;10 HRESULT result;11 if(!_stream)12 {13 realProcessedSize = size;14 result = S_OK;15 }16 else17 result = _stream->Write(data, size, &realProcessedSize);18 if (_calculate)19 _crc = CrcUpdate(_crc, data, realProcessedSize);20 _size += realProcessedSize;21 if(processedSize != NULL)22 *processedSize = realProcessedSize;23 return result;24 }