📄 a00013.html
字号:
<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 Page</a> | <a class="qindex" href="../../hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="../../annotated.html">Class List</a> | <a class="qindex" href="../../files.html">File List</a> | <a class="qindex" href="../../functions.html">Class Members</a> | <a class="qindex" href="../../globals.html">File Members</a></div><h1>CSyContextualParser Class Reference</h1><code>#include <<a class="el" href="../../dc/de2/a00024.html">SyExpat.h</a>></code><p><p>Inheritance diagram for CSyContextualParser:<p><center><img src="../../d7/dd4/a00013.png" usemap="#CSyContextualParser_map" border="0" alt=""></center><map name="CSyContextualParser_map"><area href="../../df/d86/a00012.html" alt="CExpatParserBase" shape="rect" coords="0,0,133,24"></map><a href="../../de/d5e/a00007.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>This class is used to build a parser stack when parsing. <p>Each time the document handler needs to be changed in the middle of parsing, the current handler can be put onto the stack and a new handler replace the current handler. When the new handler has finished, the handler can be popped off the stack and the old handler will replace the existing handler This makes it easier to map elements to structs via handlers. <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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsera0">~CSyContextualParser</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : This is the standard destructor and it empties the internal context stacks. <a href="#CSyContextualParsera0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsera1">PushDocHandler</a> (<a class="el" href="../../d1/d2b/a00018.html">MSyDocHandler</a> *aHandler)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Pushes the current document handler onto the internal stack so that the existing handler can be replaced with this new handler. <a href="#CSyContextualParsera1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsera2">PushDeclHandler</a> (<a class="el" href="../../d4/d51/a00017.html">MSyDeclHandler</a> *aHandler)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Pushes the current declaration handler onto the internal stack so that the existing handler can be replaced with this new handler. <a href="#CSyContextualParsera2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d1/d2b/a00018.html">MSyDocHandler</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsera3">PopDocHandler</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Replaces the existing handler with the previous handler that was placed on the internal handler stack. <a href="#CSyContextualParsera3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d4/d51/a00017.html">MSyDeclHandler</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsera4">PopDeclHandler</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Replaces the existing handler with the previous handler that was placed on the internal handler stack. <a href="#CSyContextualParsera4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C TBool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera1">Reset</a> (const TDesC &aEncoding)</td></tr><tr><td class="mdescLeft"> </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> </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"> </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> </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"> </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 * </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"> </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> </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"> </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> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera6">Resume</a> ()</td></tr><tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera7">GetErrorCode</a> () const </td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera8">GetCurrentByteIndex</a> () const </td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera9">GetCurrentByteCount</a> () const </td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera10">GetCurrentLineNumber</a> () const </td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera11">GetCurrentColumnNumber</a> () const </td></tr><tr><td class="mdescLeft"> </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> </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"> </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 </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"> </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 </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"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera15">SetBase</a> (const TDesC &aBase)</td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera16">GetBase</a> () const </td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParsera17">VersionInfo</a> () const </td></tr><tr><td class="mdescLeft"> </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/dd4/a00013.html">CSyContextualParser</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsere0">NewL</a> (const TDesC &aEncoding)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage: Standardized safe construction which leaves nothing on the cleanup stack. <a href="#CSyContextualParsere0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">IMPORT_C <a class="el" href="../../d7/dd4/a00013.html">CSyContextualParser</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParsere1">NewLC</a> (const TDesC &aEncoding)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Two phase constructor which leaves a CSyContextualParser* on the cleanup stack Constructs a new parser and namespace processor. <a href="#CSyContextualParsere1"></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 </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dd4/a00013.html#CSyContextualParserb0">ConstructL</a> (const TDesC &aEncoding)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Intended Usage : Second phase constructor for the CSyContextualParser object. <a href="#CSyContextualParserb0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">EXPORT_C void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d86/a00012.html#CSyParserb1">BaseConstructL</a> (const TDesC &aEncoding)</td></tr><tr><td class="mdescLeft"> </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 </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"> </td><td class="mdescRight">Intended Usage : Helper function to generate a panic. <a href="#CSyParserf0"></a><br></td></tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="CSyContextualParsera0" doxytag="CSyContextualParser::~CSyContextualParser"></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">CSyContextualParser::~<a class="el" href="../../d7/dd4/a00013.html">CSyContextualParser</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Intended Usage : This is the standard destructor and it empties the internal context stacks. <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> </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="CSyContextualParser::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">( </td> <td class="md" nowrap valign="top">const TDesC & </td> <td class="mdname1" valign="top" nowrap> <em>aEncoding</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [protected, inherited]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </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> </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="CSyContextualParserb0" doxytag="CSyContextualParser::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 CSyContextualParser::ConstructL </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const TDesC & </td> <td class="mdname1" valign="top" nowrap> <em>aEncoding</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [protected]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Intended Usage : Second phase constructor for the CSyContextualParser 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> </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> </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="CSyContextualParser::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">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inherited]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -