+
+/////////////////////////////////////////////////////////////////////////////
+// wxArchiveClassFactory
+//
+// A wxArchiveClassFactory instance for a particular archive type allows
+// the creation of the other classes that may be needed.
+
+void WXDLLIMPEXP_BASE wxUseArchiveClasses();
+
+class WXDLLIMPEXP_BASE wxArchiveClassFactory : public wxFilterClassFactoryBase
+{
+public:
+ typedef wxArchiveEntry entry_type;
+ typedef wxArchiveInputStream instream_type;
+ typedef wxArchiveOutputStream outstream_type;
+ typedef wxArchiveNotifier notifier_type;
+#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
+ typedef wxArchiveIter iter_type;
+ typedef wxArchivePairIter pairiter_type;
+#endif
+
+ virtual ~wxArchiveClassFactory() { }
+
+ wxArchiveEntry *NewEntry() const
+ { return DoNewEntry(); }
+ wxArchiveInputStream *NewStream(wxInputStream& stream) const
+ { return DoNewStream(stream); }
+ wxArchiveOutputStream *NewStream(wxOutputStream& stream) const
+ { return DoNewStream(stream); }
+ 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;
+
+ // FIXME-UTF8: remove these from this file, they are used for ANSI
+ // build only
+ void SetConv(wxMBConv& conv) { m_pConv = &conv; }
+ wxMBConv& GetConv() const
+ { if (m_pConv) return *m_pConv; else return wxConvLocal; }
+
+ static const wxArchiveClassFactory *Find(const wxString& protocol,
+ wxStreamProtocolType type
+ = wxSTREAM_PROTOCOL);
+
+ static const wxArchiveClassFactory *GetFirst();
+ const wxArchiveClassFactory *GetNext() const { return m_next; }
+
+ void PushFront() { Remove(); m_next = sm_first; sm_first = this; }
+ void Remove();
+
+protected:
+ // old compilers don't support covarient returns, so 'Do' methods are
+ // used to simulate them
+ virtual wxArchiveEntry *DoNewEntry() const = 0;
+ virtual wxArchiveInputStream *DoNewStream(wxInputStream& stream) const = 0;
+ virtual wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const = 0;
+ virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0;
+ virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0;
+
+ wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { }
+ wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f))
+ { return *this; }
+
+private:
+ wxMBConv *m_pConv;
+ static wxArchiveClassFactory *sm_first;
+ wxArchiveClassFactory *m_next;
+
+ DECLARE_ABSTRACT_CLASS(wxArchiveClassFactory)
+};
+
+#endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS