html filters has const methods now
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,10 +35,10 @@ class WXDLLEXPORT wxHtmlFilter : public wxObject
|
||||
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
|
||||
};
|
||||
@@ -58,8 +58,8 @@ class WXDLLEXPORT wxHtmlFilterPlainText : public wxHtmlFilter
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -52,7 +52,7 @@ IMPLEMENT_CLASS(wxHelpControllerHtml, wxHTMLHelpControllerBase)
|
||||
class wxForceHtmlFilter : public wxHtmlFilter
|
||||
{
|
||||
public:
|
||||
virtual wxString ReadFile(const wxFSFile& file)
|
||||
virtual wxString ReadFile(const wxFSFile& file) const
|
||||
{
|
||||
wxInputStream *s = file.GetStream();
|
||||
char *src;
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
return doc;
|
||||
}
|
||||
|
||||
virtual bool CanRead(const wxFSFile& file)
|
||||
virtual bool CanRead(const wxFSFile& file) const
|
||||
{
|
||||
wxString filename = file.GetLocation();
|
||||
if(filename.Length() >= 5 &&
|
||||
|
@@ -43,14 +43,14 @@ IMPLEMENT_ABSTRACT_CLASS(wxHtmlFilter, wxObject)
|
||||
|
||||
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;
|
||||
@@ -83,22 +83,22 @@ class wxHtmlFilterImage : public wxHtmlFilter
|
||||
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>");
|
||||
}
|
||||
@@ -116,21 +116,21 @@ class wxHtmlFilterHTML : public wxHtmlFilter
|
||||
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;
|
||||
|
Reference in New Issue
Block a user