From 420ec58abbf042de49ccde2253abd96dbc85c8ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 25 Jul 1999 12:20:58 +0000 Subject: [PATCH] html filters has const methods now git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/html/htmlfilter.h | 8 ++++---- src/generic/helpwxht.cpp | 4 ++-- src/html/htmlfilter.cpp | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/wx/html/htmlfilter.h b/include/wx/html/htmlfilter.h index 99b00d8de6..19c31b9209 100644 --- a/include/wx/html/htmlfilter.h +++ b/include/wx/html/htmlfilter.h @@ -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; }; diff --git a/src/generic/helpwxht.cpp b/src/generic/helpwxht.cpp index 8f41a07d93..1c25e77bc3 100644 --- a/src/generic/helpwxht.cpp +++ b/src/generic/helpwxht.cpp @@ -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 && diff --git a/src/html/htmlfilter.cpp b/src/html/htmlfilter.cpp index e56f3203a1..ba3f0a84e4 100644 --- a/src/html/htmlfilter.cpp +++ b/src/html/htmlfilter.cpp @@ -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 (""); } @@ -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; -- 2.45.2