X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00375592f92f68c4ca3f44d8e839bcfd47adc4e1..6a168c177c0572f32f98e8a9d8ba9adcd1c2d968:/include/wx/archive.h diff --git a/include/wx/archive.h b/include/wx/archive.h index fb5a647383..c38ac18ce6 100644 --- a/include/wx/archive.h +++ b/include/wx/archive.h @@ -16,7 +16,7 @@ #include "wx/defs.h" -#if wxUSE_ZLIB && wxUSE_STREAMS && wxUSE_ZIPSTREAM +#if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS #include "wx/stream.h" #include "wx/filename.h" @@ -67,6 +67,7 @@ public: protected: wxArchiveEntry() : m_notifier(NULL) { } + wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { } virtual void SetOffset(wxFileOffset offset) = 0; virtual wxArchiveEntry* DoClone() const = 0; @@ -149,7 +150,6 @@ public: virtual bool CopyArchiveMetaData(wxArchiveInputStream& stream) = 0; virtual bool CloseEntry() = 0; - virtual bool Close() = 0; protected: wxArchiveOutputStream(wxOutputStream& stream, wxMBConv& conv); @@ -161,47 +161,6 @@ private: }; -///////////////////////////////////////////////////////////////////////////// -// wxArchiveClassFactory -// -// A wxArchiveClassFactory instance for a particular archive type allows -// the creation of the other classes that may be needed. - -class WXDLLIMPEXP_BASE wxArchiveClassFactory : public wxObject -{ -public: - virtual ~wxArchiveClassFactory() { } - - wxArchiveEntry *NewEntry() const - { return DoNewEntry(); } - wxArchiveInputStream *NewStream(wxInputStream& stream) const - { return DoNewStream(stream); } - wxArchiveOutputStream *NewStream(wxOutputStream& stream) const - { return DoNewStream(stream); } - - virtual wxString GetInternalName( - const wxString& name, - wxPathFormat format = wxPATH_NATIVE) const = 0; - - void SetConv(wxMBConv& conv) { m_pConv = &conv; } - wxMBConv& GetConv() const { return *m_pConv; } - -protected: - virtual wxArchiveEntry *DoNewEntry() const = 0; - virtual wxArchiveInputStream *DoNewStream(wxInputStream& stream) const = 0; - virtual wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const = 0; - - wxArchiveClassFactory() : m_pConv(&wxConvLocal) { } - wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f)) - { return *this; } - -private: - wxMBConv *m_pConv; - - DECLARE_ABSTRACT_CLASS(wxArchiveClassFactory) -}; - - ///////////////////////////////////////////////////////////////////////////// // wxArchiveIterator // @@ -212,14 +171,14 @@ private: #include #include -template -void WXDLLIMPEXP_BASE _wxSetArchiveIteratorValue( +template inline +void _wxSetArchiveIteratorValue( X& val, Y entry, void *WXUNUSED(d)) { val = X(entry); } -template -void WXDLLIMPEXP_BASE _wxSetArchiveIteratorValue( +template inline +void _wxSetArchiveIteratorValue( std::pair& val, Z entry, Z WXUNUSED(d)) { val = std::make_pair(X(entry->GetInternalName()), Y(entry)); @@ -230,7 +189,7 @@ template #else template #endif -class WXDLLIMPEXP_BASE wxArchiveIterator +class wxArchiveIterator { public: typedef std::input_iterator_tag iterator_category; @@ -284,14 +243,12 @@ public: return it; } - friend bool operator ==(const wxArchiveIterator& i, - const wxArchiveIterator& j) { - return i.m_rep == j.m_rep; + bool operator ==(const wxArchiveIterator& j) const { + return m_rep == j.m_rep; } - friend bool operator !=(const wxArchiveIterator& i, - const wxArchiveIterator& j) { - return !(i == j); + bool operator !=(const wxArchiveIterator& j) const { + return !(*this == j); } private: @@ -348,6 +305,56 @@ typedef wxArchiveIterator