~ubuntu-branches/ubuntu/maverick/notecase/maverick

« back to all changes in this revision

Viewing changes to src/lib/HtmlParser.h

  • Committer: Bazaar Package Importer
  • Author(s): Nicolas Van Wambeke
  • Date: 2008-05-29 20:20:17 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529202017-kp2a07u83prpz0id
Tags: 1.9.1-0ubuntu1
New Upstream Release (LP: #230041)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
// of the character, in order to speed up algorithm by using binary-search on the table.
24
24
// Characters are UTF-8, and they can be multibyte - more than one byte long.
25
25
//
26
 
 
 
26
 
27
27
#include <string>
28
28
 
29
 
class HTMLParser 
 
29
class HTMLParser
30
30
{
31
31
public:
32
32
        HTMLParser();
34
34
 
35
35
        void Clear();
36
36
        bool Parse(const char *szBuffer, int len);
 
37
        void Finalize();
37
38
 
38
39
        static void EscapeChars(std::string &data);
39
40
        static void UnescapeChars(std::string &data);
40
41
        static void EscapeURI(std::string &data);
41
42
        static void UnescapeURI(std::string &data);
 
43
        static bool ExtractParam(const std::string &data, const char *szParam, std::string &resValue);
 
44
 
 
45
        bool m_bAllowUnescapedInPreTag;
42
46
 
43
47
protected:
44
48
        virtual void OnTagBegin(const char *szTag, const char *szParams = NULL) = 0;
45
 
        virtual void OnTagEnd(const char *szTag) = 0;   
 
49
        virtual void OnTagEnd(const char *szTag) = 0;
46
50
        virtual void OnComment(const char *szText) = 0;
47
51
        virtual void OnText(const char *szText) = 0;
48
52
 
49
53
protected:
50
54
        int m_nState;
51
55
        std::string m_strData;
 
56
        bool m_bInsidePreTag;
52
57
};
53
58
 
54
59
#endif
55