File: xmlsax.h.html

package info (click to toggle)
rudiments 0.31-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,516 kB
  • ctags: 3,248
  • sloc: asm: 23,776; cpp: 22,792; sh: 7,769; ansic: 1,769; makefile: 1,054; xml: 169; perl: 19
file content (75 lines) | stat: -rw-r--r-- 5,263 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/xmlsax.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2002 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef RUDIMENTS_XMLSAX_H</font>
<font color="#a020f0">#define RUDIMENTS_XMLSAX_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;rudiments/private/xmlsaxincludes.h&gt;</font>

<font color="#0000ff">// The xmlsax class is a base class for an XML SAX parser.  To use this</font>
<font color="#0000ff">// class, you should create a class that inherits from it and implements the</font>
<font color="#0000ff">// virtual methods.</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> xmlsaxprivate;

<font color="#2e8b57"><b>class</b></font> xmlsax {
        <font color="#a52a2a"><b>public</b></font>:

                        xmlsax();
                <font color="#2e8b57"><b>virtual</b></font>       ~xmlsax();


                <font color="#0000ff">// When these methods are run, they parse the XML.  As these</font>
                <font color="#0000ff">// methods encounter tags, attributes, text, etc., they call</font>
                <font color="#0000ff">// the callback methods below.</font>
                <font color="#2e8b57"><b>bool</b></font>          parseFile(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *filename);
                                <font color="#0000ff">// parse file &quot;filename&quot;</font>
                <font color="#2e8b57"><b>bool</b></font>          parseString(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                                <font color="#0000ff">// parse string &quot;string&quot;</font>
                <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>    *getError();
                                <font color="#0000ff">// if parseFile() or parseString() fails,</font>
                                <font color="#0000ff">// returns the error that caused the failure</font>

        <font color="#a52a2a"><b>protected</b></font>:
                <font color="#0000ff">// Callback methods.  These methods are called as the XML is</font>
                <font color="#0000ff">// parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  tagStart(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *name);
                                <font color="#0000ff">// Gets called when a start tag is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  attributeName(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *name);
                                <font color="#0000ff">// Gets called when an attribute name</font>
                                <font color="#0000ff">// is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  attributeValue(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *value);
                                <font color="#0000ff">// Gets called when an attribute value</font>
                                <font color="#0000ff">// is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  text(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                                <font color="#0000ff">// Gets called when a block of text is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  tagEnd(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *name);
                                <font color="#0000ff">// Gets called when an end tag is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  comment(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                                <font color="#0000ff">// Gets called when a comment is parsed.</font>
                <font color="#2e8b57"><b>virtual</b></font>       <font color="#2e8b57"><b>bool</b></font>  cdata(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                                <font color="#0000ff">// Gets called when cdata is parsed.</font>

<font color="#a020f0">        #include </font><font color="#ff00ff">&lt;rudiments/private/xmlsax.h&gt;</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>