+ wxArchiveEntry* DoClone() const { return ZipClone(); }
+
+ size_t ReadLocal(wxInputStream& stream, wxMBConv& conv);
+ size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv) const;
+
+ size_t ReadCentral(wxInputStream& stream, wxMBConv& conv);
+ size_t WriteCentral(wxOutputStream& stream, wxMBConv& conv) const;
+
+ size_t ReadDescriptor(wxInputStream& stream);
+ size_t WriteDescriptor(wxOutputStream& stream, wxUint32 crc,
+ wxFileOffset compressedSize, wxFileOffset size);
+
+ wxUint8 m_SystemMadeBy; // one of enum wxZipSystem
+ wxUint8 m_VersionMadeBy; // major * 10 + minor
+
+ wxUint16 m_VersionNeeded; // ver needed to extract (20 i.e. v2.0)
+ wxUint16 m_Flags;
+ wxUint16 m_Method; // compression method (one of wxZipMethod)
+ wxDateTime m_DateTime;
+ wxUint32 m_Crc;
+ wxFileOffset m_CompressedSize;
+ wxFileOffset m_Size;
+ wxString m_Name; // in internal format
+ wxFileOffset m_Key; // the original offset for copied entries
+ wxFileOffset m_Offset; // file offset of the entry
+
+ wxString m_Comment;
+ 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
+
+ class wxZipMemory *m_Extra;
+ class wxZipMemory *m_LocalExtra;
+
+ wxZipNotifier *m_zipnotifier;
+ class wxZipWeakLinks *m_backlink;
+
+ friend class wxZipInputStream;
+ friend class wxZipOutputStream;
+
+ DECLARE_DYNAMIC_CLASS(wxZipEntry)
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// wxZipOutputStream
+
+WX_DECLARE_LIST_WITH_DECL(wxZipEntry, wx__ZipEntryList, class WXDLLIMPEXP_BASE);
+
+class WXDLLIMPEXP_BASE wxZipOutputStream : public wxArchiveOutputStream
+{
+public:
+ wxZipOutputStream(wxOutputStream& stream,
+ int level = -1,
+ wxMBConv& conv = wxConvLocal);
+ virtual WXZIPFIX ~wxZipOutputStream();
+
+ bool PutNextEntry(wxZipEntry *entry) { return DoCreate(entry); }
+
+ bool WXZIPFIX PutNextEntry(const wxString& name,
+ const wxDateTime& dt = wxDateTime::Now(),
+ wxFileOffset size = wxInvalidOffset);
+
+ bool WXZIPFIX PutNextDirEntry(const wxString& name,
+ const wxDateTime& dt = wxDateTime::Now());
+
+ bool WXZIPFIX CopyEntry(wxZipEntry *entry, wxZipInputStream& inputStream);
+ bool WXZIPFIX CopyArchiveMetaData(wxZipInputStream& inputStream);
+
+ void WXZIPFIX Sync();
+ bool WXZIPFIX CloseEntry();
+ bool WXZIPFIX Close();
+
+ void SetComment(const wxString& comment) { m_Comment = comment; }
+
+ int GetLevel() const { return m_level; }
+ void WXZIPFIX SetLevel(int level);
+
+protected:
+ virtual size_t WXZIPFIX OnSysWrite(const void *buffer, size_t size);
+ virtual wxFileOffset OnSysTell() const { return m_entrySize; }
+
+ // this protected interface isn't yet finalised
+ struct Buffer { const char *m_data; size_t m_size; };
+ virtual wxOutputStream* WXZIPFIX OpenCompressor(wxOutputStream& stream,
+ wxZipEntry& entry,
+ const Buffer bufs[]);
+ virtual bool WXZIPFIX CloseCompressor(wxOutputStream *comp);
+
+ bool IsParentSeekable() const
+ { return m_offsetAdjustment != wxInvalidOffset; }
+
+private:
+ bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry);
+ bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream);
+ bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream);
+
+ bool IsOpened() const { return m_comp || m_pending; }
+
+ bool DoCreate(wxZipEntry *entry, bool raw = false);
+ void CreatePendingEntry(const void *buffer, size_t size);
+ void CreatePendingEntry();