public:
wxHtmlFilter() : wxObject() {}
- virtual bool CanRead(const wxFSFile& file) = 0;
+ virtual bool CanRead(const wxFSFile& file) const = 0;
// returns TRUE if this filter is able to open&read given file
- virtual wxString ReadFile(const wxFSFile& file) = 0;
+ virtual wxString ReadFile(const wxFSFile& file) const = 0;
// reads given file and returns HTML document.
// Returns empty string if opening failed
};
DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText)
public:
- virtual bool CanRead(const wxFSFile& file);
- virtual wxString ReadFile(const wxFSFile& file);
+ virtual bool CanRead(const wxFSFile& file) const;
+ virtual wxString ReadFile(const wxFSFile& file) const;
};
class wxForceHtmlFilter : public wxHtmlFilter
{
public:
- virtual wxString ReadFile(const wxFSFile& file)
+ virtual wxString ReadFile(const wxFSFile& file) const
{
wxInputStream *s = file.GetStream();
char *src;
return doc;
}
- virtual bool CanRead(const wxFSFile& file)
+ virtual bool CanRead(const wxFSFile& file) const
{
wxString filename = file.GetLocation();
if(filename.Length() >= 5 &&
IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterPlainText, wxHtmlFilter)
-bool wxHtmlFilterPlainText::CanRead(const wxFSFile& file)
+bool wxHtmlFilterPlainText::CanRead(const wxFSFile& file) const
{
return TRUE;
}
-wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file)
+wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file) const
{
wxInputStream *s = file.GetStream();
char *src;
DECLARE_DYNAMIC_CLASS(wxHtmlFilterImage)
public:
- virtual bool CanRead(const wxFSFile& file);
- virtual wxString ReadFile(const wxFSFile& file);
+ virtual bool CanRead(const wxFSFile& file) const;
+ virtual wxString ReadFile(const wxFSFile& file) const;
};
IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterImage, wxHtmlFilter)
-bool wxHtmlFilterImage::CanRead(const wxFSFile& file)
+bool wxHtmlFilterImage::CanRead(const wxFSFile& file) const
{
return (file.GetMimeType().Left(6) == "image/");
}
-wxString wxHtmlFilterImage::ReadFile(const wxFSFile& file)
+wxString wxHtmlFilterImage::ReadFile(const wxFSFile& file) const
{
return ("<HTML><BODY><IMG SRC=\"" + file.GetLocation() + "\"></BODY></HTML>");
}
DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML)
public:
- virtual bool CanRead(const wxFSFile& file);
- virtual wxString ReadFile(const wxFSFile& file);
+ virtual bool CanRead(const wxFSFile& file) const;
+ virtual wxString ReadFile(const wxFSFile& file) const;
};
IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterHTML, wxHtmlFilter)
-bool wxHtmlFilterHTML::CanRead(const wxFSFile& file)
+bool wxHtmlFilterHTML::CanRead(const wxFSFile& file) const
{
return (file.GetMimeType() == "text/html");
}
-wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file)
+wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
{
wxInputStream *s = file.GetStream();
char *src;