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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QXmlReader Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QXmlReader Class Reference<br><small>[ <a href="xml.html">XML module</a> ]</small></h1><br clear="all">
<p>
The QXmlReader class provides an interface for XML readers (i.e. parsers).
<a href="#details">More...</a>
<p>
<code>#include <<a href="qxml-h.html">qxml.h</a>></code>
<p>Inherited by <a href="qxmlsimplereader.html">QXmlSimpleReader</a>.
<p><a href="qxmlreader-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn">virtualbool<a href="#be21af"><b>feature</b></a>(constQString&name, bool*ok=0)const</div>
<li><div class="fn">virtualvoid<a href="#57cdb9"><b>setFeature</b></a>(constQString&name, boolvalue)</div>
<li><div class="fn">virtualbool<a href="#2e0d44"><b>hasFeature</b></a>(constQString&name)const</div>
<li><div class="fn">virtualvoid*<a href="#67bf3a"><b>property</b></a>(constQString&name, bool*ok=0)const</div>
<li><div class="fn">virtualvoid<a href="#6970da"><b>setProperty</b></a>(constQString&name, void*value)</div>
<li><div class="fn">virtualbool<a href="#0dfd4d"><b>hasProperty</b></a>(constQString&name)const</div>
<li><div class="fn">virtualvoid<a href="#4a0cf6"><b>setEntityResolver</b></a>(QXmlEntityResolver*handler)</div>
<li><div class="fn">virtualQXmlEntityResolver*<a href="#38d777"><b>entityResolver</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#174b4a"><b>setDTDHandler</b></a>(QXmlDTDHandler*handler)</div>
<li><div class="fn">virtualQXmlDTDHandler*<a href="#1ec1bf"><b>DTDHandler</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#a86df9"><b>setContentHandler</b></a>(QXmlContentHandler*handler)</div>
<li><div class="fn">virtualQXmlContentHandler*<a href="#7357d5"><b>contentHandler</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#ea1a35"><b>setErrorHandler</b></a>(QXmlErrorHandler*handler)</div>
<li><div class="fn">virtualQXmlErrorHandler*<a href="#6693d3"><b>errorHandler</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#6c0ebe"><b>setLexicalHandler</b></a>(QXmlLexicalHandler*handler)</div>
<li><div class="fn">virtualQXmlLexicalHandler*<a href="#486af9"><b>lexicalHandler</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#1b30d5"><b>setDeclHandler</b></a>(QXmlDeclHandler*handler)</div>
<li><div class="fn">virtualQXmlDeclHandler*<a href="#883489"><b>declHandler</b></a>()const</div>
<li><div class="fn">virtualbool<a href="#f618e6"><b>parse</b></a>(constQXmlInputSource&input)</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QXmlReader class provides an interface for XML readers (i.e. parsers).
<p>
This abstract class describes an interface for all XML readers in Qt. At the
moment there is only one implementation of a reader included in the XML
module of Qt (<a href="qxmlsimplereader.html">QXmlSimpleReader</a>). In future releases there might be more
readers with different properties available (e.g. a validating parser).
<p>The design of the XML classes follow the
<a href="http://www.megginson.com/SAX/">SAX2 java interface</a>.
It was adopted to fit into the Qt naming conventions; so it should be very
easy for anybody who has worked with SAX2 to get started with the Qt XML
classes.
<p>All readers use the class <a href="qxmlinputsource.html">QXmlInputSource</a> to read the input document from.
Since you are normally interested in certain contents of the XML document,
the reader reports those contents through special handler classes
(<a href="qxmldtdhandler.html">QXmlDTDHandler</a>, <a href="qxmldeclhandler.html">QXmlDeclHandler</a>, <a href="qxmlcontenthandler.html">QXmlContentHandler</a>, <a href="qxmlentityresolver.html">QXmlEntityResolver</a>,
<a href="qxmlerrorhandler.html">QXmlErrorHandler</a> and <a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>).
<p>You have to subclass these classes. Since the handler classes describe only
interfaces you must implement all functions; there is a class
(<a href="qxmldefaulthandler.html">QXmlDefaultHandler</a>) to make this easier; it implements a default behaviour
(do nothing) for all functions.
<p>For getting started see also the
<a href="xml-sax.html#quickStart">Quick start</a>.
<p>See also <a href="qxmlsimplereader.html">QXmlSimpleReader</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a href="qxmldtdhandler.html">QXmlDTDHandler</a>*<a name="1ec1bf"></a>QXmlReader::DTDHandler()const <code>[virtual]</code></h3>
<p>Returns the DTD handler or 0 if none was set.
<p>See also <a href="#174b4a">setDTDHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#93c7b5">QXmlSimpleReader</a>.
<h3 class="fn"><a href="qxmlcontenthandler.html">QXmlContentHandler</a>*<a name="7357d5"></a>QXmlReader::contentHandler()const <code>[virtual]</code></h3>
<p>Returns the content handler or 0 if none was set.
<p>See also <a href="#a86df9">setContentHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#26f011">QXmlSimpleReader</a>.
<h3 class="fn"><a href="qxmldeclhandler.html">QXmlDeclHandler</a>*<a name="883489"></a>QXmlReader::declHandler()const <code>[virtual]</code></h3>
<p>Returns the declaration handler or 0 if none was set.
<p>See also <a href="#1b30d5">setDeclHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#c2cdeb">QXmlSimpleReader</a>.
<h3 class="fn"><a href="qxmlentityresolver.html">QXmlEntityResolver</a>*<a name="38d777"></a>QXmlReader::entityResolver()const <code>[virtual]</code></h3>
<p>Returns the entity resolver or 0 if none was set.
<p>See also <a href="#4a0cf6">setEntityResolver</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#69d28c">QXmlSimpleReader</a>.
<h3 class="fn"><a href="qxmlerrorhandler.html">QXmlErrorHandler</a>*<a name="6693d3"></a>QXmlReader::errorHandler()const <code>[virtual]</code></h3>
<p>Returns the error handler or 0 if none was set
<p>See also <a href="#ea1a35">setErrorHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#4b60a5">QXmlSimpleReader</a>.
<h3 class="fn">bool<a name="be21af"></a>QXmlReader::feature(const<a href="qstring.html">QString</a>&name, bool*ok=0)const <code>[virtual]</code></h3>
<p>If the reader has the feature <em>name,</em> this function returns the value of the
feature.
<p>If the reader has not the feature <em>name,</em> the return value may be anything.
<p>If <em>ok</em> is not 0, then <em>ok</em> is set to TRUE if the reader has the feature
<em>name,</em> otherwise <em>ok</em> is set to FALSE.
<p>See also <a href="#57cdb9">setFeature</a>() and <a href="#2e0d44">hasFeature</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#fb4b2e">QXmlSimpleReader</a>.
<h3 class="fn">bool<a name="2e0d44"></a>QXmlReader::hasFeature(const<a href="qstring.html">QString</a>&name)const <code>[virtual]</code></h3>
<p>Returns <code>TRUE</code> if the reader has the feature <em>name,</em> otherwise FALSE.
<p>See also <a href="#be21af">feature</a>() and <a href="#57cdb9">setFeature</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#70fb07">QXmlSimpleReader</a>.
<h3 class="fn">bool<a name="0dfd4d"></a>QXmlReader::hasProperty(const<a href="qstring.html">QString</a>&name)const <code>[virtual]</code></h3>
<p>Returns TRUE if the reader has the property <em>name,</em> otherwise FALSE.
<p>See also <a href="#67bf3a">property</a>() and <a href="#6970da">setProperty</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#9425e3">QXmlSimpleReader</a>.
<h3 class="fn"><a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>*<a name="486af9"></a>QXmlReader::lexicalHandler()const <code>[virtual]</code></h3>
<p>Returns the lexical handler or 0 if none was set.
<p>See also <a href="#6c0ebe">setLexicalHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#bf85a3">QXmlSimpleReader</a>.
<h3 class="fn">bool<a name="f618e6"></a>QXmlReader::parse(const<a href="qxmlinputsource.html">QXmlInputSource</a>&input) <code>[virtual]</code></h3>
<p>Parses the XML document <em>input.</em> Returns TRUE if the parsing was successful,
otherwise FALSE.
<p>Reimplemented in <a href="qxmlsimplereader.html#2d6b2a">QXmlSimpleReader</a>.
<h3 class="fn">void*<a name="67bf3a"></a>QXmlReader::property(const<a href="qstring.html">QString</a>&name, bool*ok=0)const <code>[virtual]</code></h3>
<p>If the reader has the property <em>name,</em> this function returns the value of
the property.
<p>If the reader has not the property <em>name,</em> the return value is 0.
<p>If <em>ok</em> is not 0, then <em>ok</em> is set to TRUE if the reader has the property
<em>name,</em> otherwise <em>ok</em> is set to FALSE.
<p>See also <a href="#6970da">setProperty</a>() and <a href="#0dfd4d">hasProperty</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#282e9b">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="a86df9"></a>QXmlReader::setContentHandler(<a href="qxmlcontenthandler.html">QXmlContentHandler</a>*handler) <code>[virtual]</code></h3>
<p>Sets the content handler to <em>handler.</em>
<p>See also <a href="#7357d5">contentHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#3ce23b">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="174b4a"></a>QXmlReader::setDTDHandler(<a href="qxmldtdhandler.html">QXmlDTDHandler</a>*handler) <code>[virtual]</code></h3>
<p>Sets the DTD handler to <em>handler.</em>
<p>See also <a href="#1ec1bf">DTDHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#1ba005">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="1b30d5"></a>QXmlReader::setDeclHandler(<a href="qxmldeclhandler.html">QXmlDeclHandler</a>*handler) <code>[virtual]</code></h3>
<p>Sets the declaration handler to <em>handler.</em>
<p>See also <a href="#883489">declHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#1bb383">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="4a0cf6"></a>QXmlReader::setEntityResolver(<a href="qxmlentityresolver.html">QXmlEntityResolver</a>*handler) <code>[virtual]</code></h3>
<p>Sets the entity resolver to <em>handler.</em>
<p>See also <a href="#38d777">entityResolver</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#d7f092">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="ea1a35"></a>QXmlReader::setErrorHandler(<a href="qxmlerrorhandler.html">QXmlErrorHandler</a>*handler) <code>[virtual]</code></h3>
<p>Sets the error handler to <em>handler.</em>
<p>See also <a href="#6693d3">errorHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#991a8d">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="57cdb9"></a>QXmlReader::setFeature(const<a href="qstring.html">QString</a>&name, boolvalue) <code>[virtual]</code></h3>
<p>Sets the feature <em>name</em> to <em>value.</em> If the reader has not the feature <em>name,</em> this value is ignored.
<p>See also <a href="#be21af">feature</a>() and <a href="#2e0d44">hasFeature</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#1f7766">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="6c0ebe"></a>QXmlReader::setLexicalHandler(<a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>*handler) <code>[virtual]</code></h3>
<p>Sets the lexical handler to <em>handler.</em>
<p>See also <a href="#486af9">lexicalHandler</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#435e36">QXmlSimpleReader</a>.
<h3 class="fn">void<a name="6970da"></a>QXmlReader::setProperty(const<a href="qstring.html">QString</a>&name, void*value) <code>[virtual]</code></h3>
<p>Sets the property <em>name</em> to <em>value.</em> If the reader has not the property <em>name,</em> this value is ignored.
<p>See also <a href="#67bf3a">property</a>() and <a href="#0dfd4d">hasProperty</a>().
<p>Reimplemented in <a href="qxmlsimplereader.html#99c6cf">QXmlSimpleReader</a>.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|