void WXDLLIMPEXP_BASE wxUseFilterClasses();
-class WXDLLIMPEXP_BASE wxFilterClassFactory : public wxObject
+class WXDLLIMPEXP_BASE wxFilterClassFactoryBase : public wxObject
{
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;
+ virtual ~wxFilterClassFactoryBase() { }
wxString GetProtocol() const { return wxString(*GetProtocols()); }
wxString PopExtension(const wxString& location) const;
wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const;
+protected:
+ wxString::size_type FindExtension(const wxChar *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 wxChar *protocol,
wxStreamProtocolType type
= wxSTREAM_PROTOCOL);
wxFilterClassFactory& operator=(const wxFilterClassFactory&)
{ return *this; }
- wxString::size_type FindExtension(const wxChar *location) const;
-
private:
static wxFilterClassFactory *sm_first;
wxFilterClassFactory *m_next;
}
// ----------------------------------------------------------------------------
-// wxFilterClassFactory
+// wxFilterClassFactoryBase
// ----------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactory, wxObject)
-
-wxFilterClassFactory *wxFilterClassFactory::sm_first = NULL;
+IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactoryBase, wxObject)
-wxString wxFilterClassFactory::PopExtension(const wxString& location) const
+wxString wxFilterClassFactoryBase::PopExtension(const wxString& location) const
{
return location.substr(0, FindExtension(location));
}
-wxString::size_type wxFilterClassFactory::FindExtension(const wxChar *location) const
+wxString::size_type wxFilterClassFactoryBase::FindExtension(
+ const wxChar *location) const
{
size_t len = wxStrlen(location);
return wxString::npos;
}
-bool wxFilterClassFactory::CanHandle(const wxChar *protocol,
- wxStreamProtocolType type) const
+bool wxFilterClassFactoryBase::CanHandle(const wxChar *protocol,
+ wxStreamProtocolType type) const
{
if (type == wxSTREAM_FILEEXTENSION)
return FindExtension(protocol) != wxString::npos;
return false;
}
+// ----------------------------------------------------------------------------
+// wxFilterClassFactory
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactory, wxFilterClassFactoryBase)
+
+wxFilterClassFactory *wxFilterClassFactory::sm_first = NULL;
+
void wxFilterClassFactory::Remove()
{
if (m_next != this)