+// This class is used to parse HTML entities in strings. It can handle
+// both named entities and &#xxxx entries where xxxx is Unicode code.
+class WXDLLIMPEXP_HTML wxHtmlEntitiesParser : public wxObject
+{
+ DECLARE_DYNAMIC_CLASS(wxHtmlEntitiesParser)
+
+public:
+ wxHtmlEntitiesParser();
+ virtual ~wxHtmlEntitiesParser();
+
+ // Sets encoding of output string.
+ // Has no effect if wxUSE_WCHAR_T==0 or wxUSE_UNICODE==1
+ void SetEncoding(wxFontEncoding encoding);
+
+ // Parses entities in input and replaces them with respective characters
+ // (with respect to output encoding)
+ wxString Parse(const wxString& input);
+
+ // Returns character for given entity or 0 if the enity is unknown
+ wxChar GetEntityChar(const wxString& entity);
+
+ // Returns character that represents given Unicode code
+#if wxUSE_UNICODE
+ wxChar GetCharForCode(unsigned code) { return (wxChar)code; }
+#else
+ wxChar GetCharForCode(unsigned code);
+#endif
+
+protected:
+#if wxUSE_WCHAR_T && !wxUSE_UNICODE
+ wxMBConv *m_conv;
+ wxFontEncoding m_encoding;
+#endif
+
+ DECLARE_NO_COPY_CLASS(wxHtmlEntitiesParser)
+};