From 02d6107c97b48888362e7c6a70dcac323c89d741 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 17 Dec 2023 21:23:58 +0100 Subject: ZipArchive: Update to the 4.6.9 release --- zip/ZipArchive/ZipMemFile.h | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'zip/ZipArchive/ZipMemFile.h') diff --git a/zip/ZipArchive/ZipMemFile.h b/zip/ZipArchive/ZipMemFile.h index 948e73e..d80c123 100644 --- a/zip/ZipArchive/ZipMemFile.h +++ b/zip/ZipArchive/ZipMemFile.h @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// -// This source file is part of the ZipArchive library source distribution and -// is Copyrighted 2000 - 2007 by Artpol Software - Tadeusz Dracz +// This source file is part of the ZipArchive Library Open Source distribution +// and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -9,7 +9,7 @@ // // For the licensing details refer to the License.txt file. // -// Web Site: http://www.artpol-software.com +// Web Site: https://www.artpol-software.com //////////////////////////////////////////////////////////////////////////////// /** @@ -33,6 +33,10 @@ Automatically grows when necessary. */ class ZIP_API CZipMemFile : public CZipAbstractFile +// when ZIP_ZFI_WIN is defined under VS 6.0, do not derive from CFile, as sizes are limited to DWORD +#if defined _ZIP_IMPL_MFC && (_MSC_VER >= 1300 || _ZIP_FILE_IMPLEMENTATION != ZIP_ZFI_WIN) + , public CFile +#endif { protected: size_t m_nGrowBy, m_nPos; @@ -56,15 +60,24 @@ protected: } void Grow(size_t nBytes); public: +#if defined _ZIP_IMPL_MFC && (_MSC_VER >= 1300 || _ZIP_FILE_IMPLEMENTATION != ZIP_ZFI_WIN) + DECLARE_DYNAMIC(CZipMemFile) +#endif bool IsClosed() const { return m_lpBuf == NULL;} void Flush(){} ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff, int nFrom); ZIP_FILE_USIZE GetLength() const {return m_nDataSize;} - void Write(const void* lpBuf, UINT nCount); - UINT Read(void* lpBuf, UINT nCount); + void Write(const void* lpBuf, size_t nCount); + size_t Read(void* lpBuf, size_t nCount); void SetLength(ZIP_FILE_USIZE nNewLen); CZipString GetFilePath() const {return _T("");} + bool HasFilePath() const + { + return false; + } + +#pragma warning(suppress: 26495) CZipMemFile(long nGrowBy = 1024) { Init(); @@ -72,14 +85,14 @@ public: m_bAutoDelete = true; } - - - CZipMemFile(BYTE* lpBuf, UINT nBufSize, long nGrowBy = 0) +#pragma warning(suppress: 26495) + CZipMemFile(BYTE* lpBuf, size_t nBufSize, long nGrowBy = 0) { Init(); Attach(lpBuf, nBufSize, nGrowBy); } +#pragma warning(suppress: 26495) CZipMemFile(CZipMemFile& from) { Copy(from); @@ -88,11 +101,11 @@ public: void Copy(CZipMemFile& from) { SetLength(from.m_nDataSize); - from.Read(m_lpBuf, (UINT)from.m_nDataSize); + from.Read(m_lpBuf, from.m_nDataSize); } ZIP_FILE_USIZE GetPosition() const { return m_nPos;} - void Attach(BYTE* lpBuf, UINT nBufSize, long nGrowBy = 0) + void Attach(BYTE* lpBuf, size_t nBufSize, long nGrowBy = 0) { Close(); m_lpBuf = lpBuf; @@ -100,6 +113,7 @@ public: m_nBufSize = nBufSize; m_nDataSize = nGrowBy == 0 ? nBufSize : 0; m_bAutoDelete = false; + m_nPos = 0; } void ReInit(long nGrowBy = 1024) -- cgit v1.2.3