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

📄 a00016.html

📁 这是symbian下的实现XML解析的源代码。里面包括解析器和解析例子代码。
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<HTML><HEAD> <link rel="stylesheet" href="doxygen.css"><TITLE>Symbian XML Libarary</TITLE></HEAD><h2>SYXML - XML Parser and Generator Library for Symbian</h2><HR><!-- Generated by Doxygen 1.3.9.1 --><div class="qindex"><a class="qindex" href="../../index.html">Main&nbsp;Page</a> | <a class="qindex" href="../../hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="../../annotated.html">Class&nbsp;List</a> | <a class="qindex" href="../../files.html">File&nbsp;List</a> | <a class="qindex" href="../../functions.html">Class&nbsp;Members</a> | <a class="qindex" href="../../globals.html">File&nbsp;Members</a></div><h1>CSyParser Class Reference</h1><code>#include &lt;<a class="el" href="../../dc/de2/a00024.html">SyExpat.h</a>&gt;</code><p><p>Inheritance diagram for CSyParser:<p><center><img src="../../d7/d7a/a00016.png" usemap="#CSyParser_map" border="0" alt=""></center><map name="CSyParser_map"><area href="../../df/d86/a00012.html" alt="CExpatParserBase" shape="rect" coords="0,0,118,24"></map><a href="../../de/d21/a00006.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>This is a specialization of the parser class to provide generic handling of parsing. <p>This provides a wrapper over the basic parser class that allows specialization of the parser into a concrete form. This is the class that should be used when a parser is required. <p><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual IMPORT_C&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d7a/a00016.html#CSyParsera0">~CSyParser</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage : Standard destructor.  <a href="#CSyParsera0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TBool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera1">Reset</a> (const TDesC &amp;aEncoding)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Prepare a parser object to be re-used.  <a href="#CSyParsera1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a40">TSyExpatStatus</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera2">Parse</a> (const TPtrC8 aBuffer, const TBool aIsFinal)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Parses a block of memory held in the buffer.  <a href="#CSyParsera2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a40">TSyExpatStatus</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera3">ParseBuffer</a> (const TInt aLength, const TBool aIsFinal)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Parses a block of memory held in the internal buffer.  <a href="#CSyParsera3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TAny *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera4">GetBuffer</a> (const TInt aLength)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Reallocates or allocates a new internal buffer of the specified length.  <a href="#CSyParsera4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a40">TSyExpatStatus</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera5">Stop</a> (const TBool aResumable)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Stops parsing, causing <a class="el" href="../../df/d86/a00012.html#CSyParsera2">Parse()</a> or <a class="el" href="../../df/d86/a00012.html#CSyParsera3">ParseBuffer()</a> to return.  <a href="#CSyParsera5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a40">TSyExpatStatus</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera6">Resume</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Resumes parsing after it has been suspended with <a class="el" href="../../df/d86/a00012.html#CSyParsera5">Stop()</a>.  <a href="#CSyParsera6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a41">TSyExpatError</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera7">GetErrorCode</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: If Parse or ParseBuffer have returned TExpatStatusError, then GetErrorCode returns information about the error.  <a href="#CSyParsera7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TInt32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera8">GetCurrentByteIndex</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: These functions return information about the current parse location.  <a href="#CSyParsera8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera9">GetCurrentByteCount</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Gets the current number of bytes that have been parsed so far.  <a href="#CSyParsera9"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera10">GetCurrentLineNumber</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Returns the current line number in the document.  <a href="#CSyParsera10"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TInt&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera11">GetCurrentColumnNumber</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Returns the current column number in the document.  <a href="#CSyParsera11"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/de0/a00022.html#a40">TSyExpatStatus</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera12">GetParsingStatus</a> (TBool *aFinal=NULL) const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Returns the current state of the parser.  <a href="#CSyParsera12"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera13">SetHandler</a> (<a class="el" href="../../d1/d2b/a00018.html">MSyDocHandler</a> *aHandler)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Sets a new document handler for the parser This will replace the existing handler.  <a href="#CSyParsera13"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera14">SetHandler</a> (<a class="el" href="../../d4/d51/a00017.html">MSyDeclHandler</a> *aHandler)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Sets a new declaration handler for the parser This will replace the existing handler.  <a href="#CSyParsera14"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera15">SetBase</a> (const TDesC &amp;aBase)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Sets the base to be used for resolving relative URIs in system identifiers in declarations.  <a href="#CSyParsera15"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TPtrC&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera16">GetBase</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Gets the currently specified base entity URI that was set with the previous SetBase call.  <a href="#CSyParsera16"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C const TVersion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera17">VersionInfo</a> () const </td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Returns the build version of the DLL.  <a href="#CSyParsera17"></a><br></td></tr><tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/d7a/a00016.html">CSyParser</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d7a/a00016.html#CSyParsere0">NewL</a> (const TDesC &amp;aEncoding)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage: Standardized safe construction which leaves nothing on the cleanup stack.  <a href="#CSyParsere0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/d7a/a00016.html">CSyParser</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d7a/a00016.html#CSyParsere1">NewLC</a> (const TDesC &amp;aEncoding)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage : Two phase constructor which leaves a CExpatParserBase* on the cleanup stack Constructs a new parser and namespace processor.  <a href="#CSyParsere1"></a><br></td></tr><tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d7a/a00016.html#CSyParserb0">ConstructL</a> (const TDesC &amp;aEncoding)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage : Second phase constructor for the CSyParser object.  <a href="#CSyParserb0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">EXPORT_C void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParserb1">BaseConstructL</a> (const TDesC &amp;aEncoding)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage : Second phase of safe construction method.  <a href="#CSyParserb1"></a><br></td></tr><tr><td colspan="2"><br><h2>Static Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">EXPORT_C void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParserf0">Panic</a> (const TInt aPanic)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Intended Usage : Helper function to generate a panic.  <a href="#CSyParserf0"></a><br></td></tr></table><hr><h2>Constructor &amp; Destructor Documentation</h2><a class="anchor" name="CSyParsera0" doxytag="CSyParser::~CSyParser"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">CSyParser::~<a class="el" href="../../d7/d7a/a00016.html">CSyParser</a>           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Intended Usage : Standard destructor. <p><dl compact><dt><b>Exceptions:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>none.</em>&nbsp;</td><td></td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>none. </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>First phase of construction is complete. </dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd>none </dd></dl>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="CSyParserb1" doxytag="CSyParser::BaseConstructL"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CExpatParserBase::BaseConstructL           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const TDesC &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>aEncoding</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [protected, inherited]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Intended Usage : Second phase of safe construction method. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>aEncoding</em>&nbsp;</td><td>the default encoding of for the data to be parsed. Will override the encoding in the xml declaration line </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>none. </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>First phase of construction is complete. </dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd>Object if fully constructed. </dd></dl>    </td>  </tr></table><a class="anchor" name="CSyParserb0" doxytag="CSyParser::ConstructL"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CSyParser::ConstructL           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const TDesC &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>aEncoding</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Intended Usage : Second phase constructor for the CSyParser object. <p><dl compact><dt><b>Exceptions:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>anything.</em>&nbsp;</td><td></td></tr>  </table></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>aEncoding</em>&nbsp;</td><td>the encoding of the data to be parsed. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>none. </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>First phase of construction is complete. </dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd>none </dd></dl>    </td>  </tr></table><a class="anchor" name="CSyParsera16" doxytag="CSyParser::GetBase"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">TPtrC CExpatParserBase::GetBase           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap> const<code> [inherited]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Intended Usage: Gets the currently specified base entity URI that was set with the previous SetBase call. <p><dl compact><dt><b>Exceptions:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>none</em>&nbsp;</td><td></td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>pointer to a string holding the base URI. </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>none </dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd>Nothing is left on the CleanupStack. </dd></dl>    </td>  </tr></table><a class="anchor" name="CSyParsera4" doxytag="CSyParser::GetBuffer"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">TAny * CExpatParserBase::GetBuffer           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const TInt&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>aLength</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [inherited]</code></td>        </tr>

⌨️ 快捷键说明

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