1 | <HTML><HEAD><SCRIPT language="JavaScript" src="../resources/script.js" type="text/javascript"></SCRIPT><TITLE>XMLStringTokenizer.hpp Source File</TITLE><link href="XercesApi.css" rel="stylesheet" type="text/css"></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="../resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="../resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="../resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="../graphics/api-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="../resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','../resources/button-xml-hi.gif','../resources/button-xml-lo.gif');" src="../resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','../resources/button-asf-hi.gif','../resources/button-asf-lo.gif');" src="../resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','../resources/button-w3c-hi.gif','../resources/button-w3c-lo.gif');" src="../resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="../resources/join.gif" vspace="0" width="120"><BR>
|
---|
2 | <A href="../../index.html" onMouseOut="rolloverOff('side-ext-2');" onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-2" onLoad="rolloverLoad('side-ext-2','../graphics/ext-2-label-2.jpg','../graphics/ext-2-label-3.jpg');" src="../graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
3 |
|
---|
4 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
5 |
|
---|
6 | <A href="../index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','../graphics/index-label-2.jpg','../graphics/index-label-3.jpg');" src="../graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
7 | <A href="../releases.html" onMouseOut="rolloverOff('side-releases');" onMouseOver="rolloverOn('side-releases');"><IMG alt="Release Info" border="0" height="12" hspace="0" name="side-releases" onLoad="rolloverLoad('side-releases','../graphics/releases-label-2.jpg','../graphics/releases-label-3.jpg');" src="../graphics/releases-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
8 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
9 | <A href="../install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','../graphics/install-label-2.jpg','../graphics/install-label-3.jpg');" src="../graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
10 | <A href="http://xml.apache.org/dist/xerces-c/" onMouseOut="rolloverOff('side-ext-18');" onMouseOver="rolloverOn('side-ext-18');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-18" onLoad="rolloverLoad('side-ext-18','../graphics/ext-18-label-2.jpg','../graphics/ext-18-label-3.jpg');" src="../graphics/ext-18-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
11 | <A href="../build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build" border="0" height="12" hspace="0" name="side-build" onLoad="rolloverLoad('side-build','../graphics/build-label-2.jpg','../graphics/build-label-3.jpg');" src="../graphics/build-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
12 |
|
---|
13 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
14 | <A href="../faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQs" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','../graphics/faqs-label-2.jpg','../graphics/faqs-label-3.jpg');" src="../graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
15 | <A href="../samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','../graphics/samples-label-2.jpg','../graphics/samples-label-3.jpg');" src="../graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
16 | <A href="../api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="API Docs" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','../graphics/api-label-2.jpg','../graphics/api-label-3.jpg');" src="../graphics/api-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
17 |
|
---|
18 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
19 | <A href="../ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','../graphics/ext-68-label-2.jpg','../graphics/ext-68-label-3.jpg');" src="../graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
20 |
|
---|
21 | <A href="../program.html" onMouseOut="rolloverOff('side-program');" onMouseOver="rolloverOn('side-program');"><IMG alt="Programming" border="0" height="12" hspace="0" name="side-program" onLoad="rolloverLoad('side-program','../graphics/program-label-2.jpg','../graphics/program-label-3.jpg');" src="../graphics/program-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
22 | <A href="../migrate.html" onMouseOut="rolloverOff('side-migrate');" onMouseOver="rolloverOn('side-migrate');"><IMG alt="Migration Guide" border="0" height="12" hspace="0" name="side-migrate" onLoad="rolloverLoad('side-migrate','../graphics/migrate-label-2.jpg','../graphics/migrate-label-3.jpg');" src="../graphics/migrate-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
23 |
|
---|
24 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
25 |
|
---|
26 | <A href="../feedback.html" onMouseOut="rolloverOff('side-feedback');" onMouseOver="rolloverOn('side-feedback');"><IMG alt="Feedback" border="0" height="12" hspace="0" name="side-feedback" onLoad="rolloverLoad('side-feedback','../graphics/feedback-label-2.jpg','../graphics/feedback-label-3.jpg');" src="../graphics/feedback-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
27 | <A href="../bug-report.html" onMouseOut="rolloverOff('side-bug-report');" onMouseOver="rolloverOn('side-bug-report');"><IMG alt="Bug-Reporting" border="0" height="12" hspace="0" name="side-bug-report" onLoad="rolloverLoad('side-bug-report','../graphics/bug-report-label-2.jpg','../graphics/bug-report-label-3.jpg');" src="../graphics/bug-report-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
28 | <A href="../pdf.html" onMouseOut="rolloverOff('side-pdf');" onMouseOver="rolloverOn('side-pdf');"><IMG alt="PDF Document" border="0" height="12" hspace="0" name="side-pdf" onLoad="rolloverLoad('side-pdf','../graphics/pdf-label-2.jpg','../graphics/pdf-label-3.jpg');" src="../graphics/pdf-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
29 |
|
---|
30 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
31 |
|
---|
32 | <A href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/c/" onMouseOut="rolloverOff('side-ext-100');" onMouseOver="rolloverOn('side-ext-100');"><IMG alt="CVS Repository" border="0" height="12" hspace="0" name="side-ext-100" onLoad="rolloverLoad('side-ext-100','../graphics/ext-100-label-2.jpg','../graphics/ext-100-label-3.jpg');" src="../graphics/ext-100-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
33 |
|
---|
34 | <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Mail Archive" border="0" height="12" hspace="0" name="side-ext-102" onLoad="rolloverLoad('side-ext-102','../graphics/ext-102-label-2.jpg','../graphics/ext-102-label-3.jpg');" src="../graphics/ext-102-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
35 |
|
---|
36 |
|
---|
37 | <IMG border="0" height="14" hspace="0" src="../resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD>
|
---|
38 | <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#FFFFFF" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="../resources/void.gif" vspace="0" width="2"><B>API Docs for SAX and DOM</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
|
---|
39 |
|
---|
40 | <P>
|
---|
41 | <!-- Generated by Doxygen 1.2.14 -->
|
---|
42 | <center>
|
---|
43 | <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
|
---|
44 | <hr><h1>XMLStringTokenizer.hpp</h1><a href="XMLStringTokenizer_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>
|
---|
45 | 00002 <font class="comment"> * Copyright 2001,2004 The Apache Software Foundation.</font>
|
---|
46 | 00003 <font class="comment"> * </font>
|
---|
47 | 00004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font>
|
---|
48 | 00005 <font class="comment"> * you may not use this file except in compliance with the License.</font>
|
---|
49 | 00006 <font class="comment"> * You may obtain a copy of the License at</font>
|
---|
50 | 00007 <font class="comment"> * </font>
|
---|
51 | 00008 <font class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</font>
|
---|
52 | 00009 <font class="comment"> * </font>
|
---|
53 | 00010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font>
|
---|
54 | 00011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font>
|
---|
55 | 00012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font>
|
---|
56 | 00013 <font class="comment"> * See the License for the specific language governing permissions and</font>
|
---|
57 | 00014 <font class="comment"> * limitations under the License.</font>
|
---|
58 | 00015 <font class="comment"> */</font>
|
---|
59 | 00016
|
---|
60 | 00017 <font class="comment">/*</font>
|
---|
61 | 00018 <font class="comment"> * $Id: XMLStringTokenizer.hpp,v 1.7 2004/09/08 13:56:24 peiyongz Exp $</font>
|
---|
62 | 00019 <font class="comment"> */</font>
|
---|
63 | 00020
|
---|
64 | 00021 <font class="preprocessor">#if !defined(XMLSTRINGTOKENIZER_HPP)</font>
|
---|
65 | <a name="l00022"></a><a class="code" href="XMLStringTokenizer_8hpp.html#a0">00022</a> <font class="preprocessor"></font><font class="preprocessor">#define XMLSTRINGTOKENIZER_HPP</font>
|
---|
66 | 00023 <font class="preprocessor"></font>
|
---|
67 | 00024 <font class="preprocessor">#include <xercesc/util/RefArrayVectorOf.hpp></font>
|
---|
68 | 00025 <font class="preprocessor">#include <<a class="code" href="XMLString_8hpp.html">xercesc/util/XMLString.hpp</a>></font>
|
---|
69 | 00026
|
---|
70 | 00027 <a class="code" href="XercesDefs_8hpp.html#a2">XERCES_CPP_NAMESPACE_BEGIN</a>
|
---|
71 | 00028
|
---|
72 | <a name="l00041"></a><a class="code" href="classXMLStringTokenizer.html">00041</a> <font class="keyword">class </font><a class="code" href="XercesDefs_8hpp.html#a8"></a> <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a> :<font class="keyword">public</font> <a class="code" href="classXMemory.html">XMemory</a>
|
---|
73 | 00042 {
|
---|
74 | 00043 <font class="keyword">public</font>:
|
---|
75 | 00044 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
76 | 00045 <font class="comment">// Public Constructors</font>
|
---|
77 | 00046 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
78 | 00049 <font class="comment"></font>
|
---|
79 | 00062 <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>(<font class="keyword">const</font> XMLCh* <font class="keyword">const</font> srcStr,
|
---|
80 | 00063 <a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> manager = <a class="code" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>);
|
---|
81 | 00064
|
---|
82 | 00075 <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>(<font class="keyword">const</font> XMLCh* <font class="keyword">const</font> srcStr
|
---|
83 | 00076 , <font class="keyword">const</font> XMLCh* <font class="keyword">const</font> delim
|
---|
84 | 00077 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> manager = <a class="code" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>);
|
---|
85 | 00078
|
---|
86 | 00080
|
---|
87 | 00081 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
88 | 00082 <font class="comment">// Public Destructor</font>
|
---|
89 | 00083 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
90 | 00086 <font class="comment"></font>
|
---|
91 | 00087 ~<a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>();
|
---|
92 | 00088
|
---|
93 | 00090
|
---|
94 | 00091 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
95 | 00092 <font class="comment">// Management methods</font>
|
---|
96 | 00093 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
97 | 00096 <font class="comment"></font>
|
---|
98 | 00103 <font class="keywordtype">bool</font> hasMoreTokens();
|
---|
99 | 00104
|
---|
100 | 00113 <font class="keywordtype">int</font> countTokens();
|
---|
101 | 00114
|
---|
102 | 00121 XMLCh* nextToken();
|
---|
103 | 00122
|
---|
104 | 00124
|
---|
105 | 00125 <font class="keyword">private</font>:
|
---|
106 | 00126 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
107 | 00127 <font class="comment">// Unimplemented constructors and operators</font>
|
---|
108 | 00128 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
109 | 00129 <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>(<font class="keyword">const</font> <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>&);
|
---|
110 | 00130 <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>& operator=(<font class="keyword">const</font> <a class="code" href="classXMLStringTokenizer.html">XMLStringTokenizer</a>&);
|
---|
111 | 00131
|
---|
112 | 00132 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
113 | 00133 <font class="comment">// CleanUp methods</font>
|
---|
114 | 00134 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
115 | 00135 <font class="keywordtype">void</font> cleanUp();
|
---|
116 | 00136
|
---|
117 | 00137 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
118 | 00138 <font class="comment">// Helper methods</font>
|
---|
119 | 00139 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
120 | 00140 <font class="keywordtype">bool</font> isDelimeter(<font class="keyword">const</font> XMLCh ch);
|
---|
121 | 00141
|
---|
122 | 00142 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
123 | 00143 <font class="comment">// Private data members</font>
|
---|
124 | 00144 <font class="comment">//</font>
|
---|
125 | 00145 <font class="comment">// fOffset</font>
|
---|
126 | 00146 <font class="comment">// The current position in the parsed string.</font>
|
---|
127 | 00147 <font class="comment">//</font>
|
---|
128 | 00148 <font class="comment">// fStringLen</font>
|
---|
129 | 00149 <font class="comment">// The length of the string parsed (for convenience).</font>
|
---|
130 | 00150 <font class="comment">//</font>
|
---|
131 | 00151 <font class="comment">// fString</font>
|
---|
132 | 00152 <font class="comment">// The string to be parsed</font>
|
---|
133 | 00153 <font class="comment">//</font>
|
---|
134 | 00154 <font class="comment">// fDelimeters</font>
|
---|
135 | 00155 <font class="comment">// A set of delimeter characters</font>
|
---|
136 | 00156 <font class="comment">//</font>
|
---|
137 | 00157 <font class="comment">// fTokens</font>
|
---|
138 | 00158 <font class="comment">// A vector of the token strings</font>
|
---|
139 | 00159 <font class="comment">// -----------------------------------------------------------------------</font>
|
---|
140 | 00160 <font class="keywordtype">int</font> fOffset;
|
---|
141 | 00161 <font class="keywordtype">int</font> fStringLen;
|
---|
142 | 00162 XMLCh* fString;
|
---|
143 | 00163 XMLCh* fDelimeters;
|
---|
144 | 00164 RefArrayVectorOf<XMLCh>* fTokens;
|
---|
145 | 00165 <a class="code" href="classMemoryManager.html">MemoryManager</a>* fMemoryManager;
|
---|
146 | 00166 };
|
---|
147 | 00167
|
---|
148 | 00168
|
---|
149 | 00169 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
150 | 00170 <font class="comment">// XMLStringTokenizer: CleanUp methods</font>
|
---|
151 | 00171 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
152 | 00172 <font class="keyword">inline</font> <font class="keywordtype">void</font> XMLStringTokenizer::cleanUp() {
|
---|
153 | 00173
|
---|
154 | 00174 fMemoryManager-><a class="code" href="classMemoryManager.html#z221_1">deallocate</a>(fString);<font class="comment">//delete [] fString;</font>
|
---|
155 | 00175 fMemoryManager-><a class="code" href="classMemoryManager.html#z221_1">deallocate</a>(fDelimeters);<font class="comment">//delete [] fDelimeters;</font>
|
---|
156 | 00176 <font class="keyword">delete</font> fTokens;
|
---|
157 | 00177 }
|
---|
158 | 00178
|
---|
159 | 00179 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
160 | 00180 <font class="comment">// XMLStringTokenizer: Helper methods</font>
|
---|
161 | 00181 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
162 | 00182 <font class="keyword">inline</font> <font class="keywordtype">bool</font> XMLStringTokenizer::isDelimeter(<font class="keyword">const</font> XMLCh ch) {
|
---|
163 | 00183
|
---|
164 | 00184 <font class="keywordflow">return</font> <a class="code" href="classXMLString.html#z515_0">XMLString::indexOf</a>(fDelimeters, ch) == -1 ? <font class="keyword">false</font> : <font class="keyword">true</font>;
|
---|
165 | 00185 }
|
---|
166 | 00186
|
---|
167 | 00187
|
---|
168 | 00188 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
169 | 00189 <font class="comment">// XMLStringTokenizer: Management methods</font>
|
---|
170 | 00190 <font class="comment">// ---------------------------------------------------------------------------</font>
|
---|
171 | <a name="l00191"></a><a class="code" href="classXMLStringTokenizer.html#z527_1">00191</a> <font class="keyword">inline</font> <font class="keywordtype">int</font> <a class="code" href="classXMLStringTokenizer.html#z527_1">XMLStringTokenizer::countTokens</a>() {
|
---|
172 | 00192
|
---|
173 | 00193 <font class="keywordflow">if</font> (fStringLen == 0)
|
---|
174 | 00194 <font class="keywordflow">return</font> 0;
|
---|
175 | 00195
|
---|
176 | 00196 <font class="keywordtype">int</font> tokCount = 0;
|
---|
177 | 00197 <font class="keywordtype">bool</font> inToken = <font class="keyword">false</font>;
|
---|
178 | 00198
|
---|
179 | 00199 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i= fOffset; i< fStringLen; i++) {
|
---|
180 | 00200
|
---|
181 | 00201 <font class="keywordflow">if</font> (isDelimeter(fString[i])) {
|
---|
182 | 00202
|
---|
183 | 00203 <font class="keywordflow">if</font> (inToken) {
|
---|
184 | 00204 inToken = <font class="keyword">false</font>;
|
---|
185 | 00205 }
|
---|
186 | 00206
|
---|
187 | 00207 <font class="keywordflow">continue</font>;
|
---|
188 | 00208 }
|
---|
189 | 00209
|
---|
190 | 00210 <font class="keywordflow">if</font> (!inToken) {
|
---|
191 | 00211
|
---|
192 | 00212 tokCount++;
|
---|
193 | 00213 inToken = <font class="keyword">true</font>;
|
---|
194 | 00214 }
|
---|
195 | 00215
|
---|
196 | 00216 } <font class="comment">// end for</font>
|
---|
197 | 00217
|
---|
198 | 00218 <font class="keywordflow">return</font> tokCount;
|
---|
199 | 00219 }
|
---|
200 | 00220
|
---|
201 | 00221 <a class="code" href="XercesDefs_8hpp.html#a3">XERCES_CPP_NAMESPACE_END</a>
|
---|
202 | 00222
|
---|
203 | 00223 <font class="preprocessor">#endif</font>
|
---|
204 | 00224 <font class="preprocessor"></font>
|
---|
205 | </pre></div> </FONT></TD></TR></TABLE><BR>
|
---|
206 | </TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1" alt=""></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
|
---|
207 | Copyright © 1994-2004 The Apache Software Foundation.
|
---|
208 | All Rights Reserved.
|
---|
209 | </I></FONT></TD></TR></TABLE></BODY></HTML>
|
---|