+enum wxStreamProtocolType
+{
+ wxSTREAM_PROTOCOL, // wxFileSystem protocol (should be only one)
+ wxSTREAM_MIMETYPE, // MIME types the stream handles
+ wxSTREAM_ENCODING, // The HTTP Content-Encodings the stream handles
+ wxSTREAM_FILEEXT // File extensions the stream handles
+};
+
+void WXDLLIMPEXP_BASE wxUseFilterClasses();
+
+class WXDLLIMPEXP_BASE wxFilterClassFactoryBase : public wxObject
+{
+public:
+ virtual ~wxFilterClassFactoryBase() { }
+
+ wxString GetProtocol() const { return wxString(*GetProtocols()); }
+ wxString PopExtension(const wxString& location) const;
+
+ virtual const wxChar * const *GetProtocols(wxStreamProtocolType type
+ = wxSTREAM_PROTOCOL) const = 0;
+
+ bool CanHandle(const wxString& protocol,
+ wxStreamProtocolType type
+ = wxSTREAM_PROTOCOL) const;
+
+protected:
+ wxString::size_type FindExtension(const wxString& location) const;
+
+ DECLARE_ABSTRACT_CLASS(wxFilterClassFactoryBase)
+};
+
+class WXDLLIMPEXP_BASE wxFilterClassFactory : public wxFilterClassFactoryBase
+{
+public:
+ virtual ~wxFilterClassFactory() { }
+
+ virtual wxFilterInputStream *NewStream(wxInputStream& stream) const = 0;
+ virtual wxFilterOutputStream *NewStream(wxOutputStream& stream) const = 0;
+ virtual wxFilterInputStream *NewStream(wxInputStream *stream) const = 0;
+ virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0;
+
+ static const wxFilterClassFactory *Find(const wxString& protocol,
+ wxStreamProtocolType type
+ = wxSTREAM_PROTOCOL);
+
+ static const wxFilterClassFactory *GetFirst();
+ const wxFilterClassFactory *GetNext() const { return m_next; }
+
+ void PushFront() { Remove(); m_next = sm_first; sm_first = this; }
+ void Remove();
+
+protected:
+ wxFilterClassFactory() : m_next(this) { }
+
+ wxFilterClassFactory& operator=(const wxFilterClassFactory&)
+ { return *this; }
+
+private:
+ static wxFilterClassFactory *sm_first;
+ wxFilterClassFactory *m_next;
+
+ DECLARE_ABSTRACT_CLASS(wxFilterClassFactory)
+};
+