+/////////////////////////////////////////////////////////////////////////////
+// constants
+
+// Compression Method, only 0 (store) and 8 (deflate) are supported here
+//
+enum wxZipMethod
+{
+ wxZIP_METHOD_STORE,
+ wxZIP_METHOD_SHRINK,
+ wxZIP_METHOD_REDUCE1,
+ wxZIP_METHOD_REDUCE2,
+ wxZIP_METHOD_REDUCE3,
+ wxZIP_METHOD_REDUCE4,
+ wxZIP_METHOD_IMPLODE,
+ wxZIP_METHOD_TOKENIZE,
+ wxZIP_METHOD_DEFLATE,
+ wxZIP_METHOD_DEFLATE64,
+ wxZIP_METHOD_BZIP2 = 12,
+ wxZIP_METHOD_DEFAULT = 0xffff
+};
+
+// Originating File-System.
+//
+// These are Pkware's values. Note that Info-zip disagree on some of them,
+// most notably NTFS.
+//
+enum wxZipSystem
+{
+ wxZIP_SYSTEM_MSDOS,
+ wxZIP_SYSTEM_AMIGA,
+ wxZIP_SYSTEM_OPENVMS,
+ wxZIP_SYSTEM_UNIX,
+ wxZIP_SYSTEM_VM_CMS,
+ wxZIP_SYSTEM_ATARI_ST,
+ wxZIP_SYSTEM_OS2_HPFS,
+ wxZIP_SYSTEM_MACINTOSH,
+ wxZIP_SYSTEM_Z_SYSTEM,
+ wxZIP_SYSTEM_CPM,
+ wxZIP_SYSTEM_WINDOWS_NTFS,
+ wxZIP_SYSTEM_MVS,
+ wxZIP_SYSTEM_VSE,
+ wxZIP_SYSTEM_ACORN_RISC,
+ wxZIP_SYSTEM_VFAT,
+ wxZIP_SYSTEM_ALTERNATE_MVS,
+ wxZIP_SYSTEM_BEOS,
+ wxZIP_SYSTEM_TANDEM,
+ wxZIP_SYSTEM_OS_400
+};
+
+// Dos/Win file attributes
+//
+enum wxZipAttributes
+{
+ wxZIP_A_RDONLY = 0x01,
+ wxZIP_A_HIDDEN = 0x02,
+ wxZIP_A_SYSTEM = 0x04,
+ wxZIP_A_SUBDIR = 0x10,
+ wxZIP_A_ARCH = 0x20,
+
+ wxZIP_A_MASK = 0x37
+};
+
+// Values for the flags field in the zip headers
+//
+enum wxZipFlags
+{
+ wxZIP_ENCRYPTED = 0x0001,
+ wxZIP_DEFLATE_NORMAL = 0x0000, // normal compression
+ wxZIP_DEFLATE_EXTRA = 0x0002, // extra compression
+ wxZIP_DEFLATE_FAST = 0x0004, // fast compression
+ wxZIP_DEFLATE_SUPERFAST = 0x0006, // superfast compression
+ wxZIP_DEFLATE_MASK = 0x0006,
+ wxZIP_SUMS_FOLLOW = 0x0008, // crc and sizes come after the data
+ wxZIP_ENHANCED = 0x0010,
+ wxZIP_PATCH = 0x0020,
+ wxZIP_STRONG_ENC = 0x0040,
+ wxZIP_UNUSED = 0x0F80,
+ wxZIP_RESERVED = 0xF000
+};
+
+// Forward decls
+//
+class WXDLLIMPEXP_BASE wxZipEntry;
+class WXDLLIMPEXP_BASE wxZipInputStream;
+
+
+/////////////////////////////////////////////////////////////////////////////
+// wxZipNotifier
+
+class WXDLLIMPEXP_BASE wxZipNotifier
+{
+public:
+ virtual ~wxZipNotifier() { }
+
+ virtual void OnEntryUpdated(wxZipEntry& entry) = 0;
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Zip Entry - holds the meta data for a file in the zip
+
+class WXDLLIMPEXP_BASE wxZipEntry : public wxArchiveEntry
+{
+public:
+ wxZipEntry(const wxString& name = wxEmptyString,
+ const wxDateTime& dt = wxDateTime::Now(),
+ wxFileOffset size = wxInvalidOffset);
+ virtual ~wxZipEntry();
+
+ wxZipEntry(const wxZipEntry& entry);
+ wxZipEntry& operator=(const wxZipEntry& entry);
+
+ // Get accessors
+ wxDateTime GetDateTime() const { return m_DateTime; }
+ wxFileOffset GetSize() const { return m_Size; }
+ wxFileOffset GetOffset() const { return m_Offset; }
+ wxString GetInternalName() const { return m_Name; }
+ int GetMethod() const { return m_Method; }
+ int GetFlags() const { return m_Flags; }
+ wxUint32 GetCrc() const { return m_Crc; }
+ wxFileOffset GetCompressedSize() const { return m_CompressedSize; }
+ int GetSystemMadeBy() const { return m_SystemMadeBy; }
+ wxString GetComment() const { return m_Comment; }
+ wxUint32 GetExternalAttributes() const { return m_ExternalAttributes; }
+ wxPathFormat GetInternalFormat() const { return wxPATH_UNIX; }
+ int GetMode() const;
+ const char *GetLocalExtra() const;
+ size_t GetLocalExtraLen() const;
+ const char *GetExtra() const;
+ size_t GetExtraLen() const;
+ wxString GetName(wxPathFormat format = wxPATH_NATIVE) const;
+
+ // is accessors
+ inline bool IsDir() const;
+ inline bool IsText() const;
+ inline bool IsReadOnly() const;
+ inline bool IsMadeByUnix() const;
+
+ // set accessors
+ void SetDateTime(const wxDateTime& dt) { m_DateTime = dt; }
+ void SetSize(wxFileOffset size) { m_Size = size; }
+ void SetMethod(int method) { m_Method = (wxUint16)method; }
+ void SetComment(const wxString& comment) { m_Comment = comment; }
+ void SetExternalAttributes(wxUint32 attr ) { m_ExternalAttributes = attr; }
+ void SetSystemMadeBy(int system);
+ void SetMode(int mode);
+ void SetExtra(const char *extra, size_t len);
+ void SetLocalExtra(const char *extra, size_t len);