Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Archive/Common/OutStreamWithCRC.h')
-rwxr-xr-x7zip/Archive/Common/OutStreamWithCRC.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/7zip/Archive/Common/OutStreamWithCRC.h b/7zip/Archive/Common/OutStreamWithCRC.h
index 23c69e04..0feb542b 100755
--- a/7zip/Archive/Common/OutStreamWithCRC.h
+++ b/7zip/Archive/Common/OutStreamWithCRC.h
@@ -16,18 +16,22 @@ public:
STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
private:
- CCRC _crc;
CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+ CCRC _crc;
+ bool _calculateCrc;
public:
- void Init(ISequentialOutStream *stream)
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void Init(bool calculateCrc = true)
{
- _stream = stream;
+ _size = 0;
+ _calculateCrc = calculateCrc;
_crc.Init();
}
void ReleaseStream() { _stream.Release(); }
+ UInt64 GetSize() const { return _size; }
UInt32 GetCRC() const { return _crc.GetDigest(); }
void InitCRC() { _crc.Init(); }
-
};
#endif