4.26 beta

This commit is contained in:
Igor Pavlov
2005-08-05 00:00:00 +00:00
committed by Kornel Lesiński
parent af1fe52701
commit 31e7b924e8
56 changed files with 2185 additions and 188 deletions

View File

@@ -0,0 +1,46 @@
// LzhOutStreamWithCRC.cpp
#include "StdAfx.h"
#include "LzhOutStreamWithCRC.h"
namespace NArchive {
namespace NLzh {
STDMETHODIMP COutStreamWithCRC::Write(const void *data,
UInt32 size, UInt32 *processedSize)
{
HRESULT result;
UInt32 realProcessedSize;
if(!_stream)
{
realProcessedSize = size;
result = S_OK;
}
else
result = _stream->Write(data, size, &realProcessedSize);
_crc.Update(data, realProcessedSize);
if(processedSize != NULL)
*processedSize = realProcessedSize;
return result;
}
STDMETHODIMP COutStreamWithCRC::WritePart(const void *data,
UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize;
HRESULT result;
if(!_stream)
{
realProcessedSize = size;
result = S_OK;
}
else
result = _stream->WritePart(data, size, &realProcessedSize);
_crc.Update(data, realProcessedSize);
if(processedSize != NULL)
*processedSize = realProcessedSize;
return result;
}
}}