Merge branch 'zip64-fix'
Notably fix ZIP64 creation with individual files larger than 4GB. See https://github.com/wxWidgets/wxWidgets/pull/730
This commit is contained in:
@@ -110,6 +110,14 @@ enum wxZipFlags
|
||||
wxZIP_RESERVED = 0xF000
|
||||
};
|
||||
|
||||
enum wxZipArchiveFormat
|
||||
{
|
||||
/// Default zip format
|
||||
wxZIP_FORMAT_DEFAULT,
|
||||
/// ZIP64 format
|
||||
wxZIP_FORMAT_ZIP64
|
||||
};
|
||||
|
||||
// Forward decls
|
||||
//
|
||||
class WXDLLIMPEXP_FWD_BASE wxZipEntry;
|
||||
@@ -131,6 +139,8 @@ public:
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Zip Entry - holds the meta data for a file in the zip
|
||||
|
||||
class wxDataOutputStream;
|
||||
|
||||
class WXDLLIMPEXP_BASE wxZipEntry : public wxArchiveEntry
|
||||
{
|
||||
public:
|
||||
@@ -225,7 +235,7 @@ private:
|
||||
wxArchiveEntry* DoClone() const wxOVERRIDE { return ZipClone(); }
|
||||
|
||||
size_t ReadLocal(wxInputStream& stream, wxMBConv& conv);
|
||||
size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv) const;
|
||||
size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv, wxZipArchiveFormat zipFormat);
|
||||
|
||||
size_t ReadCentral(wxInputStream& stream, wxMBConv& conv);
|
||||
size_t WriteCentral(wxOutputStream& stream, wxMBConv& conv) const;
|
||||
@@ -234,6 +244,9 @@ private:
|
||||
size_t WriteDescriptor(wxOutputStream& stream, wxUint32 crc,
|
||||
wxFileOffset compressedSize, wxFileOffset size);
|
||||
|
||||
void WriteLocalFileSizes(wxDataOutputStream& ds) const;
|
||||
void WriteLocalZip64ExtraInfo(wxOutputStream& stream) const;
|
||||
|
||||
bool LoadExtraInfo(const char* extraData, wxUint16 extraLen, bool localInfo);
|
||||
|
||||
wxUint16 GetInternalFlags(bool checkForUTF8) const;
|
||||
@@ -256,6 +269,7 @@ private:
|
||||
wxUint16 m_DiskStart; // for multidisk archives, not unsupported
|
||||
wxUint16 m_InternalAttributes; // bit 0 set for text files
|
||||
wxUint32 m_ExternalAttributes; // system specific depends on SystemMadeBy
|
||||
wxUint16 m_z64infoOffset; // Offset of ZIP64 local extra data for file sizes
|
||||
|
||||
class wxZipMemory *m_Extra;
|
||||
class wxZipMemory *m_LocalExtra;
|
||||
@@ -307,6 +321,9 @@ public:
|
||||
int GetLevel() const { return m_level; }
|
||||
void WXZIPFIX SetLevel(int level);
|
||||
|
||||
void SetFormat(wxZipArchiveFormat format) { m_format = format; };
|
||||
wxZipArchiveFormat GetFormat() const { return m_format; };
|
||||
|
||||
protected:
|
||||
virtual size_t WXZIPFIX OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
|
||||
virtual wxFileOffset OnSysTell() const wxOVERRIDE { return m_entrySize; }
|
||||
@@ -351,6 +368,7 @@ private:
|
||||
wxFileOffset m_offsetAdjustment;
|
||||
wxString m_Comment;
|
||||
bool m_endrecWritten;
|
||||
wxZipArchiveFormat m_format;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxZipOutputStream);
|
||||
};
|
||||
|
Reference in New Issue
Block a user