diff 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
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.cpp	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,27 @@
     1.4 +// LzhOutStreamWithCRC.cpp
     1.5 +
     1.6 +#include "StdAfx.h"
     1.7 +
     1.8 +#include "LzhOutStreamWithCRC.h"
     1.9 +
    1.10 +namespace NArchive {
    1.11 +namespace NLzh {
    1.12 +
    1.13 +STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
    1.14 +{
    1.15 +  UInt32 realProcessedSize;
    1.16 +  HRESULT result;
    1.17 +  if(!_stream)
    1.18 +  {
    1.19 +    realProcessedSize = size;
    1.20 +    result = S_OK;
    1.21 +  }
    1.22 +  else
    1.23 +    result = _stream->Write(data, size, &realProcessedSize);
    1.24 +  _crc.Update(data, realProcessedSize);
    1.25 +  if(processedSize != NULL)
    1.26 +    *processedSize = realProcessedSize;
    1.27 +  return result;
    1.28 +}
    1.29 +
    1.30 +}}