⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qxmlreader.html

📁 QT 下载资料仅供参考
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/xml/qxml.cpp:2136 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>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: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QXmlReader Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1><p>The QXmlReader class provides an interface for XML readers (i.e.parsers).<a href="#details">More...</a><p><tt>#include &lt;<a href="qxml-h.html">qxml.h</a>&gt;</tt><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>virtual bool <a href="#feature"><b>feature</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const = 0</div></li><li><div class=fn>virtual void <a href="#setFeature"><b>setFeature</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name, bool&nbsp;value ) = 0</div></li><li><div class=fn>virtual bool <a href="#hasFeature"><b>hasFeature</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name ) const = 0</div></li><li><div class=fn>virtual void * <a href="#property"><b>property</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const = 0</div></li><li><div class=fn>virtual void <a href="#setProperty"><b>setProperty</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name, void&nbsp;*&nbsp;value ) = 0</div></li><li><div class=fn>virtual bool <a href="#hasProperty"><b>hasProperty</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name ) const = 0</div></li><li><div class=fn>virtual void <a href="#setEntityResolver"><b>setEntityResolver</b></a> ( QXmlEntityResolver&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlEntityResolver * <a href="#entityResolver"><b>entityResolver</b></a> () const = 0</div></li><li><div class=fn>virtual void <a href="#setDTDHandler"><b>setDTDHandler</b></a> ( QXmlDTDHandler&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlDTDHandler * <a href="#DTDHandler"><b>DTDHandler</b></a> () const = 0</div></li><li><div class=fn>virtual void <a href="#setContentHandler"><b>setContentHandler</b></a> ( QXmlContentHandler&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlContentHandler * <a href="#contentHandler"><b>contentHandler</b></a> () const = 0</div></li><li><div class=fn>virtual void <a href="#setErrorHandler"><b>setErrorHandler</b></a> ( QXmlErrorHandler&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlErrorHandler * <a href="#errorHandler"><b>errorHandler</b></a> () const = 0</div></li><li><div class=fn>virtual void <a href="#setLexicalHandler"><b>setLexicalHandler</b></a> ( QXmlLexicalHandler&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlLexicalHandler * <a href="#lexicalHandler"><b>lexicalHandler</b></a> () const = 0</div></li><li><div class=fn>virtual void <a href="#setDeclHandler"><b>setDeclHandler</b></a> ( QXmlDeclHandler&nbsp;*&nbsp;handler ) = 0</div></li><li><div class=fn>virtual QXmlDeclHandler * <a href="#declHandler"><b>declHandler</b></a> () const = 0</div></li><li><div class=fn>virtual bool parse ( const&nbsp;QXmlInputSource&nbsp;&amp;&nbsp;input ) = 0 &nbsp;<em>(obsolete)</em></div></li><li><div class=fn>virtual bool <a href="#parse"><b>parse</b></a> ( const&nbsp;QXmlInputSource&nbsp;*&nbsp;input ) = 0</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QXmlReader class provides an interface for XML readers (i.e.parsers).<p> <p> This abstract class provides an interface for all XML readers in Qt. At themoment there is only one implementation of a reader included in the XMLmodule of Qt (<a href="qxmlsimplereader.html">QXmlSimpleReader</a>). In future releases there might be morereaders with different properties available (e.g. a validating parser).<p> The design of the XML classes follows the<a href="http://www.megginson.com/SAX/">SAX2 java interface</a>.It was adapted to fit the Qt naming conventions; so it should be veryeasy for anybody who has worked with SAX2 to get started with the Qt XMLclasses.<p> All readers use the class <a href="qxmlinputsource.html">QXmlInputSource</a> to read the input document.Since you are normally interested in particular content in the XML document,the reader reports the content 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>), which you must subclass,if you want to process the contents..<p> Since the handler classes describe only interfaces you mustimplement all functions; there is a class (<a href="qxmldefaulthandler.html">QXmlDefaultHandler</a>) tomake this easier; it implements a default behaviour (do nothing) forall functions.<p> Features and properties of the reader can be set with <a href="#setFeature">setFeature</a>()and setProperty respectively. You can set the reader to use your ownsubclasses with <a href="#setEntityResolver">setEntityResolver</a>(), <a href="#setDTDHandler">setDTDHandler</a>(),<a href="#setContentHandler">setContentHandler</a>(), <a href="#setErrorHandler">setErrorHandler</a>(), <a href="#setLexicalHandler">setLexicalHandler</a>() and<a href="#setDeclHandler">setDeclHandler</a>(). The parse itself is started with a call to<a href="#parse">parse</a>().<p> For getting started see also the<a href="xml-sax-walkthrough.html">tiny SAX2 parser walkthrough.</a><p> <p>See also <a href="qxmlsimplereader.html">QXmlSimpleReader</a> and <a href="xml-tools.html">XML</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a href="qxmldtdhandler.html">QXmlDTDHandler</a>&nbsp;* <a name="DTDHandler"></a>QXmlReader::DTDHandler () const<tt> [pure virtual]</tt></h3><p> Returns the DTD handler or 0 if none was set.<p> <p>See also <a href="#setDTDHandler">setDTDHandler</a>().<h3 class=fn><a href="qxmlcontenthandler.html">QXmlContentHandler</a>&nbsp;* <a name="contentHandler"></a>QXmlReader::contentHandler () const<tt> [pure virtual]</tt></h3><p> Returns the content handler or 0 if none was set.<p> <p>See also <a href="#setContentHandler">setContentHandler</a>().<h3 class=fn><a href="qxmldeclhandler.html">QXmlDeclHandler</a>&nbsp;* <a name="declHandler"></a>QXmlReader::declHandler () const<tt> [pure virtual]</tt></h3><p> Returns the declaration handler or 0 if none was set.<p> <p>See also <a href="#setDeclHandler">setDeclHandler</a>().<h3 class=fn><a href="qxmlentityresolver.html">QXmlEntityResolver</a>&nbsp;* <a name="entityResolver"></a>QXmlReader::entityResolver () const<tt> [pure virtual]</tt></h3><p> Returns the entity resolver or 0 if none was set.<p> <p>See also <a href="#setEntityResolver">setEntityResolver</a>().<h3 class=fn><a href="qxmlerrorhandler.html">QXmlErrorHandler</a>&nbsp;* <a name="errorHandler"></a>QXmlReader::errorHandler () const<tt> [pure virtual]</tt></h3><p> Returns the error handler or 0 if none was set.<p> <p>See also <a href="#setErrorHandler">setErrorHandler</a>().<h3 class=fn>bool <a name="feature"></a>QXmlReader::feature ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const<tt> [pure virtual]</tt></h3><p> If the reader has the feature called <em>name</em>, the feature's valueis returned. If no such feature exists the return value isundefined.<p> If <em>ok</em> is not 0, then <em>*ok</em>  is set to TRUE if the reader has the featurecalled <em>name</em>; otherwise <em>*ok</em> is set to FALSE.<p> <p>See also <a href="#setFeature">setFeature</a>() and <a href="#hasFeature">hasFeature</a>().<h3 class=fn>bool <a name="hasFeature"></a>QXmlReader::hasFeature ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name ) const<tt> [pure virtual]</tt></h3><p> Returns <tt>TRUE</tt> if the reader has the feature <em>name</em>; otherwisereturns FALSE.<p> <p>See also <a href="#feature">feature</a>() and <a href="#setFeature">setFeature</a>().<h3 class=fn>bool <a name="hasProperty"></a>QXmlReader::hasProperty ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name ) const<tt> [pure virtual]</tt></h3><p> Returns TRUE if the reader has the property <em>name</em>; otherwise returns FALSE.<p> <p>See also <a href="#property">property</a>() and <a href="#setProperty">setProperty</a>().<h3 class=fn><a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>&nbsp;* <a name="lexicalHandler"></a>QXmlReader::lexicalHandler () const<tt> [pure virtual]</tt></h3><p> Returns the lexical handler or 0 if none was set.<p> <p>See also <a href="#setLexicalHandler">setLexicalHandler</a>().<h3 class=fn>bool <a name="parse"></a>QXmlReader::parse ( const&nbsp;<a href="qxmlinputsource.html">QXmlInputSource</a>&nbsp;*&nbsp;input )<tt> [pure virtual]</tt></h3><p> Reads an XML document from <em>input</em> and parses it. Returns TRUE if theparsing was successful; otherwise returns FALSE.<p>Example: <a href="xml-sax-walkthrough.html#x2139">xml/tagreader/tagreader.cpp</a>.<h3 class=fn>bool <a name="parse-2"></a>QXmlReader::parse ( const&nbsp;<a href="qxmlinputsource.html">QXmlInputSource</a>&nbsp;&amp;&nbsp;input )<tt> [pure virtual]</tt></h3><p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.<p> <h3 class=fn>void * <a name="property"></a>QXmlReader::property ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;*&nbsp;ok = 0 ) const<tt> [pure virtual]</tt></h3><p> If the reader has the property <em>name</em>, this function returns the value ofthe property and sets <em>*ok</em> to TRUE; otherwise <em>*ok</em> is set toFALSE.<p> <p>See also <a href="#setProperty">setProperty</a>() and <a href="#hasProperty">hasProperty</a>().<h3 class=fn>void <a name="setContentHandler"></a>QXmlReader::setContentHandler ( <a href="qxmlcontenthandler.html">QXmlContentHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the content handler to <em>handler</em>.<p> <p>See also <a href="#contentHandler">contentHandler</a>().<p>Example: <a href="xml-sax-walkthrough.html#x2140">xml/tagreader/tagreader.cpp</a>.<h3 class=fn>void <a name="setDTDHandler"></a>QXmlReader::setDTDHandler ( <a href="qxmldtdhandler.html">QXmlDTDHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the DTD handler to <em>handler</em>.<p> <p>See also <a href="#DTDHandler">DTDHandler</a>().<h3 class=fn>void <a name="setDeclHandler"></a>QXmlReader::setDeclHandler ( <a href="qxmldeclhandler.html">QXmlDeclHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the declaration handler to <em>handler</em>.<p> <p>See also <a href="#declHandler">declHandler</a>().<h3 class=fn>void <a name="setEntityResolver"></a>QXmlReader::setEntityResolver ( <a href="qxmlentityresolver.html">QXmlEntityResolver</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the entity resolver to <em>handler</em>.<p> <p>See also <a href="#entityResolver">entityResolver</a>().<h3 class=fn>void <a name="setErrorHandler"></a>QXmlReader::setErrorHandler ( <a href="qxmlerrorhandler.html">QXmlErrorHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the error handler to <em>handler</em>. Clears the error handler if <em>handler</em> is 0.<p> <p>See also <a href="#errorHandler">errorHandler</a>().<h3 class=fn>void <a name="setFeature"></a>QXmlReader::setFeature ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, bool&nbsp;value )<tt> [pure virtual]</tt></h3><p> Sets the feature called <em>name</em> to the given <em>value</em>.If the reader doesn't have the feature nothing happens.<p> <p>See also <a href="#feature">feature</a>() and <a href="#hasFeature">hasFeature</a>().<h3 class=fn>void <a name="setLexicalHandler"></a>QXmlReader::setLexicalHandler ( <a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>&nbsp;*&nbsp;handler )<tt> [pure virtual]</tt></h3><p> Sets the lexical handler to <em>handler</em>.<p> <p>See also <a href="#lexicalHandler">lexicalHandler</a>().<h3 class=fn>void <a name="setProperty"></a>QXmlReader::setProperty ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, void&nbsp;*&nbsp;value )<tt> [pure virtual]</tt></h3><p> Sets the property <em>name</em> to <em>value</em>. If the reader doesn't havethe property nothing happens.<p> <p>See also <a href="#property">property</a>() and <a href="#hasProperty">hasProperty</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<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 &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -