annotate src/win32/7zip/7z/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.cpp @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
rev   line source
rlm@1 1 // LzhOutStreamWithCRC.cpp
rlm@1 2
rlm@1 3 #include "StdAfx.h"
rlm@1 4
rlm@1 5 #include "LzhOutStreamWithCRC.h"
rlm@1 6
rlm@1 7 namespace NArchive {
rlm@1 8 namespace NLzh {
rlm@1 9
rlm@1 10 STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
rlm@1 11 {
rlm@1 12 UInt32 realProcessedSize;
rlm@1 13 HRESULT result;
rlm@1 14 if(!_stream)
rlm@1 15 {
rlm@1 16 realProcessedSize = size;
rlm@1 17 result = S_OK;
rlm@1 18 }
rlm@1 19 else
rlm@1 20 result = _stream->Write(data, size, &realProcessedSize);
rlm@1 21 _crc.Update(data, realProcessedSize);
rlm@1 22 if(processedSize != NULL)
rlm@1 23 *processedSize = realProcessedSize;
rlm@1 24 return result;
rlm@1 25 }
rlm@1 26
rlm@1 27 }}