From 96ade47c182bf37a2efca2aa62922e54e5ff1660 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Wed, 6 Apr 2022 13:33:38 +0300 Subject: Move LZMA SDK to 3rdparty subdirectory Also add attribution document. Task-number: QTIFW-2336 Change-Id: I91546bc6c3ace244e4b546b945f40b7d204f7463 Reviewed-by: Katja Marttila Reviewed-by: Qt CI Bot --- .../CPP/7zip/Archive/Common/OutStreamWithCRC.h | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithCRC.h (limited to 'src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithCRC.h') diff --git a/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithCRC.h b/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithCRC.h new file mode 100644 index 000000000..09b899bbd --- /dev/null +++ b/src/libs/3rdparty/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithCRC.h @@ -0,0 +1,37 @@ +// OutStreamWithCRC.h + +#ifndef __OUT_STREAM_WITH_CRC_H +#define __OUT_STREAM_WITH_CRC_H + +#include "../../../../C/7zCrc.h" + +#include "../../../Common/MyCom.h" + +#include "../../IStream.h" + +class COutStreamWithCRC: + public ISequentialOutStream, + public CMyUnknownImp +{ + CMyComPtr _stream; + UInt64 _size; + UInt32 _crc; + bool _calculate; +public: + MY_UNKNOWN_IMP + STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); + void SetStream(ISequentialOutStream *stream) { _stream = stream; } + void ReleaseStream() { _stream.Release(); } + void Init(bool calculate = true) + { + _size = 0; + _calculate = calculate; + _crc = CRC_INIT_VAL; + } + void EnableCalc(bool calculate) { _calculate = calculate; } + void InitCRC() { _crc = CRC_INIT_VAL; } + UInt64 GetSize() const { return _size; } + UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); } +}; + +#endif -- cgit v1.2.3