Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/7zip/Archive/Common/OutStreamWithCRC.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // OutStreamWithCRC.h
2
3 #ifndef __OUT_STREAM_WITH_CRC_H
4 #define __OUT_STREAM_WITH_CRC_H
5
6 #include "../../../Common/MyCom.h"
7 #include "../../IStream.h"
8
9 extern "C"
10 {
11 #include "../../../../C/7zCrc.h"
12 }
13
14 class COutStreamWithCRC:
15 public ISequentialOutStream,
16 public CMyUnknownImp
17 {
18 CMyComPtr<ISequentialOutStream> _stream;
19 UInt64 _size;
20 UInt32 _crc;
21 bool _calculate;
22 public:
23 MY_UNKNOWN_IMP
24 STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
25 void SetStream(ISequentialOutStream *stream) { _stream = stream; }
26 void ReleaseStream() { _stream.Release(); }
27 void Init(bool calculate = true)
28 {
29 _size = 0;
30 _calculate = calculate;
31 _crc = CRC_INIT_VAL;
32 }
33 void InitCRC() { _crc = CRC_INIT_VAL; }
34 UInt64 GetSize() const { return _size; }
35 UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
36 };
37
38 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698