Mercurial > vba-linux
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // LzhOutStreamWithCRC.cpp | |
2 | |
3 #include "StdAfx.h" | |
4 | |
5 #include "LzhOutStreamWithCRC.h" | |
6 | |
7 namespace NArchive { | |
8 namespace NLzh { | |
9 | |
10 STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize) | |
11 { | |
12 UInt32 realProcessedSize; | |
13 HRESULT result; | |
14 if(!_stream) | |
15 { | |
16 realProcessedSize = size; | |
17 result = S_OK; | |
18 } | |
19 else | |
20 result = _stream->Write(data, size, &realProcessedSize); | |
21 _crc.Update(data, realProcessedSize); | |
22 if(processedSize != NULL) | |
23 *processedSize = realProcessedSize; | |
24 return result; | |
25 } | |
26 | |
27 }} |