X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f0ff178513f59471bfce85cf6d7a78f4f4818ab..ce4b7808ca940be201422a066de141ca12f13863:/include/wx/archive.h diff --git a/include/wx/archive.h b/include/wx/archive.h index 5bb4880f8f..0858d299f3 100644 --- a/include/wx/archive.h +++ b/include/wx/archive.h @@ -10,13 +10,9 @@ #ifndef _WX_ARCHIVE_H__ #define _WX_ARCHIVE_H__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "archive.h" -#endif - #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 +63,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; @@ -107,6 +104,7 @@ public: protected: wxArchiveInputStream(wxInputStream& stream, wxMBConv& conv); + wxArchiveInputStream(wxInputStream *stream, wxMBConv& conv); virtual wxArchiveEntry *DoGetNextEntry() = 0; @@ -152,6 +150,7 @@ public: protected: wxArchiveOutputStream(wxOutputStream& stream, wxMBConv& conv); + wxArchiveOutputStream(wxOutputStream *stream, wxMBConv& conv); wxMBConv& GetConv() const { return m_conv; } @@ -160,47 +159,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 // @@ -211,14 +169,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)); @@ -229,7 +187,7 @@ template #else template #endif -class WXDLLIMPEXP_BASE wxArchiveIterator +class wxArchiveIterator { public: typedef std::input_iterator_tag iterator_category; @@ -283,11 +241,11 @@ public: return it; } - bool operator ==(const wxArchiveIterator& j) { - return (*this).m_rep == j.m_rep; + bool operator ==(const wxArchiveIterator& j) const { + return m_rep == j.m_rep; } - bool operator !=(const wxArchiveIterator& j) { + bool operator !=(const wxArchiveIterator& j) const { return !(*this == j); } @@ -345,6 +303,78 @@ typedef wxArchiveIterator