v2.2.2
This commit is contained in:
parent
4bc0157dcd
commit
1613a190f0
2427 changed files with 125503 additions and 133080 deletions
|
@ -5,391 +5,383 @@
|
|||
<link href="tabs.css" rel="stylesheet" type="text/css">
|
||||
</head><body>
|
||||
<a style="float:right;" href="http://sourceforge.net/projects/xqilla"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=152021&type=2" border="0" alt="SourceForge.net Logo" /></a>
|
||||
<!-- Generated by Doxygen 1.5.5 -->
|
||||
<div class="navigation" id="top">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
||||
<li><a href="classes.html"><span>Classes</span></a></li>
|
||||
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1>XMLFormatter.hpp</h1><a href="XMLFormatter_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
||||
<a name="l00002"></a>00002 <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span>
|
||||
<a name="l00003"></a>00003 <span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span>
|
||||
<a name="l00004"></a>00004 <span class="comment"> * this work for additional information regarding copyright ownership.</span>
|
||||
<a name="l00005"></a>00005 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span>
|
||||
<a name="l00006"></a>00006 <span class="comment"> * (the "License"); you may not use this file except in compliance with</span>
|
||||
<a name="l00007"></a>00007 <span class="comment"> * the License. You may obtain a copy of the License at</span>
|
||||
<a name="l00008"></a>00008 <span class="comment"> *</span>
|
||||
<a name="l00009"></a>00009 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
|
||||
<a name="l00010"></a>00010 <span class="comment"> *</span>
|
||||
<a name="l00011"></a>00011 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
|
||||
<a name="l00012"></a>00012 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
|
||||
<a name="l00013"></a>00013 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
|
||||
<a name="l00014"></a>00014 <span class="comment"> * See the License for the specific language governing permissions and</span>
|
||||
<a name="l00015"></a>00015 <span class="comment"> * limitations under the License.</span>
|
||||
<a name="l00016"></a>00016 <span class="comment"> */</span>
|
||||
<a name="l00017"></a>00017
|
||||
<a name="l00018"></a>00018 <span class="comment">/*</span>
|
||||
<a name="l00019"></a>00019 <span class="comment"> * $Id: XMLFormatter.hpp 698579 2008-09-24 14:13:08Z borisk $</span>
|
||||
<a name="l00020"></a>00020 <span class="comment"> */</span>
|
||||
<a name="l00021"></a>00021
|
||||
<a name="l00022"></a>00022 <span class="preprocessor">#if !defined(XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP)</span>
|
||||
<a name="l00023"></a><a class="code" href="XMLFormatter_8hpp.html#95c0967b2db9a75e0b3cd6208b28b479">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP</span>
|
||||
<a name="l00024"></a>00024 <span class="preprocessor"></span>
|
||||
<a name="l00025"></a>00025 <span class="preprocessor">#include <<a class="code" href="PlatformUtils_8hpp.html">xercesc/util/PlatformUtils.hpp</a>></span>
|
||||
<a name="l00026"></a>00026
|
||||
<a name="l00027"></a>00027 XERCES_CPP_NAMESPACE_BEGIN
|
||||
<a name="l00028"></a>00028
|
||||
<a name="l00029"></a>00029 <span class="keyword">class </span>XMLFormatTarget;
|
||||
<a name="l00030"></a>00030 <span class="keyword">class </span>XMLTranscoder;
|
||||
<a name="l00031"></a>00031
|
||||
<a name="l00041"></a><a class="code" href="classxercesc_1_1XMLFormatter.html">00041</a> <span class="keyword">class </span>XMLPARSER_EXPORT <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a> : <span class="keyword">public</span> <a class="code" href="classxercesc_1_1XMemory.html" title="This class makes it possible to override the C++ memory management by adding new/delete...">XMemory</a>
|
||||
<a name="l00042"></a>00042 {
|
||||
<a name="l00043"></a>00043 <span class="keyword">public</span>:
|
||||
<a name="l00044"></a>00044 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00045"></a>00045 <span class="comment">// Class types</span>
|
||||
<a name="l00046"></a>00046 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00124"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95">00124</a> <span class="comment"></span> <span class="keyword">enum</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95" title="EscapeFlags - Different styles of escape flags to control various formatting.">EscapeFlags</a>
|
||||
<a name="l00125"></a>00125 {
|
||||
<a name="l00126"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95f1a0a45dd87c64f35ed446f15c08f50e">00126</a> NoEscapes
|
||||
<a name="l00127"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95dd13237c9b75bd010a3888da7658d715">00127</a> , StdEscapes
|
||||
<a name="l00128"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b9513db941ceeeab6da0cfab212765ac0f5">00128</a> , AttrEscapes
|
||||
<a name="l00129"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95a4ab66035e3e3ec7f1181a0ae02b29f8">00129</a> , CharEscapes
|
||||
<a name="l00130"></a>00130
|
||||
<a name="l00131"></a>00131 <span class="comment">// Special values, don't use directly</span>
|
||||
<a name="l00132"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95a40f95ca4645f9121d01b881e268f371">00132</a> , EscapeFlags_Count
|
||||
<a name="l00133"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b954cda7860dd5e6cbfb600e94b2abd8ca3">00133</a> , DefaultEscape = 999
|
||||
<a name="l00134"></a>00134 };
|
||||
<a name="l00135"></a>00135
|
||||
<a name="l00152"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c">00152</a> <span class="keyword">enum</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c" title="UnRepFlags.">UnRepFlags</a>
|
||||
<a name="l00153"></a>00153 {
|
||||
<a name="l00154"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c695bee848024ce4e790bad3e68896eee">00154</a> UnRep_Fail
|
||||
<a name="l00155"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c603ee35ca43c94a0236bbeb8ae13549f">00155</a> , UnRep_CharRef
|
||||
<a name="l00156"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715ccc0ff5dd21e03ce3ef414882f757d366">00156</a> , UnRep_Replace
|
||||
<a name="l00157"></a>00157
|
||||
<a name="l00158"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715cf5fa79bda55e5fee2c709bc31d4b6890">00158</a> , DefaultUnRep = 999
|
||||
<a name="l00159"></a>00159 };
|
||||
<a name="l00161"></a>00161
|
||||
<a name="l00162"></a>00162
|
||||
<a name="l00163"></a>00163 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00164"></a>00164 <span class="comment">// Constructors and Destructor</span>
|
||||
<a name="l00165"></a>00165 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00177"></a>00177 <span class="comment"></span> <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>
|
||||
<a name="l00178"></a>00178 (
|
||||
<a name="l00179"></a>00179 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> outEncoding
|
||||
<a name="l00180"></a>00180 , <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> docVersion
|
||||
<a name="l00181"></a>00181 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
<a name="l00182"></a>00182 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
<a name="l00183"></a>00183 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
<a name="l00184"></a>00184 , <a class="code" href="classxercesc_1_1MemoryManager.html" title="Configurable memory manager.">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
<a name="l00185"></a>00185 );
|
||||
<a name="l00186"></a>00186
|
||||
<a name="l00187"></a>00187 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>
|
||||
<a name="l00188"></a>00188 (
|
||||
<a name="l00189"></a>00189 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> outEncoding
|
||||
<a name="l00190"></a>00190 , <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> docVersion
|
||||
<a name="l00191"></a>00191 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
<a name="l00192"></a>00192 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
<a name="l00193"></a>00193 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
<a name="l00194"></a>00194 , <a class="code" href="classxercesc_1_1MemoryManager.html" title="Configurable memory manager.">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
<a name="l00195"></a>00195 );
|
||||
<a name="l00196"></a>00196
|
||||
<a name="l00197"></a>00197 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>
|
||||
<a name="l00198"></a>00198 (
|
||||
<a name="l00199"></a>00199 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> outEncoding
|
||||
<a name="l00200"></a>00200 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
<a name="l00201"></a>00201 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
<a name="l00202"></a>00202 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
<a name="l00203"></a>00203 , <a class="code" href="classxercesc_1_1MemoryManager.html" title="Configurable memory manager.">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
<a name="l00204"></a>00204 );
|
||||
<a name="l00205"></a>00205
|
||||
<a name="l00206"></a>00206 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>
|
||||
<a name="l00207"></a>00207 (
|
||||
<a name="l00208"></a>00208 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> outEncoding
|
||||
<a name="l00209"></a>00209 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
<a name="l00210"></a>00210 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
<a name="l00211"></a>00211 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
<a name="l00212"></a>00212 , <a class="code" href="classxercesc_1_1MemoryManager.html" title="Configurable memory manager.">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
<a name="l00213"></a>00213 );
|
||||
<a name="l00214"></a>00214
|
||||
<a name="l00215"></a>00215 ~<a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>();
|
||||
<a name="l00217"></a>00217
|
||||
<a name="l00218"></a>00218
|
||||
<a name="l00219"></a>00219 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00220"></a>00220 <span class="comment">// Formatting methods</span>
|
||||
<a name="l00221"></a>00221 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00231"></a>00231 <span class="comment"></span> <span class="keywordtype">void</span> formatBuf
|
||||
<a name="l00232"></a>00232 (
|
||||
<a name="l00233"></a>00233 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
<a name="l00234"></a>00234 , <span class="keyword">const</span> XMLSize_t count
|
||||
<a name="l00235"></a>00235 , <span class="keyword">const</span> EscapeFlags escapeFlags = DefaultEscape
|
||||
<a name="l00236"></a>00236 , <span class="keyword">const</span> UnRepFlags unrepFlags = DefaultUnRep
|
||||
<a name="l00237"></a>00237 );
|
||||
<a name="l00238"></a>00238
|
||||
<a name="l00242"></a>00242 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <span class="keyword">operator</span><<
|
||||
<a name="l00243"></a>00243 (
|
||||
<a name="l00244"></a>00244 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
<a name="l00245"></a>00245 );
|
||||
<a name="l00246"></a>00246
|
||||
<a name="l00247"></a>00247 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <span class="keyword">operator</span><<
|
||||
<a name="l00248"></a>00248 (
|
||||
<a name="l00249"></a>00249 <span class="keyword">const</span> XMLCh toFormat
|
||||
<a name="l00250"></a>00250 );
|
||||
<a name="l00251"></a>00251
|
||||
<a name="l00252"></a>00252 <span class="keywordtype">void</span> writeBOM(<span class="keyword">const</span> XMLByte* <span class="keyword">const</span> toFormat
|
||||
<a name="l00253"></a>00253 , <span class="keyword">const</span> XMLSize_t count);
|
||||
<a name="l00254"></a>00254
|
||||
<a name="l00256"></a>00256
|
||||
<a name="l00257"></a>00257 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00258"></a>00258 <span class="comment">// Getter methods</span>
|
||||
<a name="l00259"></a>00259 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00266"></a>00266 <span class="comment"></span> <span class="keyword">const</span> XMLCh* getEncodingName() <span class="keyword">const</span>;
|
||||
<a name="l00267"></a>00267
|
||||
<a name="l00271"></a>00271 <span class="keyword">inline</span> <span class="keyword">const</span> XMLTranscoder* getTranscoder() <span class="keyword">const</span>;
|
||||
<a name="l00272"></a>00272
|
||||
<a name="l00276"></a>00276 <span class="keyword">inline</span> XMLTranscoder* getTranscoder();
|
||||
<a name="l00277"></a>00277
|
||||
<a name="l00279"></a>00279
|
||||
<a name="l00280"></a>00280 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00281"></a>00281 <span class="comment">// Setter methods</span>
|
||||
<a name="l00282"></a>00282 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00288"></a>00288 <span class="comment"></span> <span class="keywordtype">void</span> setEscapeFlags
|
||||
<a name="l00289"></a>00289 (
|
||||
<a name="l00290"></a>00290 <span class="keyword">const</span> EscapeFlags newFlags
|
||||
<a name="l00291"></a>00291 );
|
||||
<a name="l00292"></a>00292
|
||||
<a name="l00296"></a>00296 <span class="keywordtype">void</span> setUnRepFlags
|
||||
<a name="l00297"></a>00297 (
|
||||
<a name="l00298"></a>00298 <span class="keyword">const</span> UnRepFlags newFlags
|
||||
<a name="l00299"></a>00299 );
|
||||
<a name="l00300"></a>00300
|
||||
<a name="l00305"></a>00305 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <span class="keyword">operator</span><<
|
||||
<a name="l00306"></a>00306 (
|
||||
<a name="l00307"></a>00307 <span class="keyword">const</span> EscapeFlags newFlags
|
||||
<a name="l00308"></a>00308 );
|
||||
<a name="l00309"></a>00309
|
||||
<a name="l00314"></a>00314 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <span class="keyword">operator</span><<
|
||||
<a name="l00315"></a>00315 (
|
||||
<a name="l00316"></a>00316 <span class="keyword">const</span> UnRepFlags newFlags
|
||||
<a name="l00317"></a>00317 );
|
||||
<a name="l00319"></a>00319
|
||||
<a name="l00320"></a>00320 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00321"></a>00321 <span class="comment">// Getter methods</span>
|
||||
<a name="l00322"></a>00322 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00328"></a>00328 <span class="comment"></span> EscapeFlags getEscapeFlags() <span class="keyword">const</span>;
|
||||
<a name="l00329"></a>00329
|
||||
<a name="l00333"></a>00333 UnRepFlags getUnRepFlags() <span class="keyword">const</span>;
|
||||
<a name="l00335"></a>00335
|
||||
<a name="l00336"></a>00336 <span class="keyword">private</span> :
|
||||
<a name="l00337"></a>00337 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00338"></a>00338 <span class="comment">// Unimplemented constructors and operators</span>
|
||||
<a name="l00339"></a>00339 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00340"></a>00340 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>();
|
||||
<a name="l00341"></a>00341 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>&);
|
||||
<a name="l00342"></a>00342 <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& operator=(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>&);
|
||||
<a name="l00343"></a>00343
|
||||
<a name="l00344"></a>00344
|
||||
<a name="l00345"></a>00345 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00346"></a>00346 <span class="comment">// Private class constants</span>
|
||||
<a name="l00347"></a>00347 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00348"></a>00348 <span class="keyword">enum</span> Constants
|
||||
<a name="l00349"></a>00349 {
|
||||
<a name="l00350"></a>00350 kTmpBufSize = 16 * 1024
|
||||
<a name="l00351"></a>00351 };
|
||||
<a name="l00352"></a>00352
|
||||
<a name="l00353"></a>00353
|
||||
<a name="l00354"></a>00354 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00355"></a>00355 <span class="comment">// Private helper methods</span>
|
||||
<a name="l00356"></a>00356 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00357"></a>00357 <span class="keyword">const</span> XMLByte* getCharRef(XMLSize_t &count,
|
||||
<a name="l00358"></a>00358 XMLByte* &ref,
|
||||
<a name="l00359"></a>00359 <span class="keyword">const</span> XMLCh * stdRef);
|
||||
<a name="l00360"></a>00360
|
||||
<a name="l00361"></a>00361 <span class="keywordtype">void</span> writeCharRef(<span class="keyword">const</span> XMLCh &toWrite);
|
||||
<a name="l00362"></a>00362 <span class="keywordtype">void</span> writeCharRef(XMLSize_t toWrite);
|
||||
<a name="l00363"></a>00363
|
||||
<a name="l00364"></a>00364 <span class="keywordtype">bool</span> inEscapeList(<span class="keyword">const</span> XMLFormatter::EscapeFlags escStyle
|
||||
<a name="l00365"></a>00365 , <span class="keyword">const</span> XMLCh toCheck);
|
||||
<a name="l00366"></a>00366
|
||||
<a name="l00367"></a>00367
|
||||
<a name="l00368"></a>00368 XMLSize_t handleUnEscapedChars(<span class="keyword">const</span> XMLCh * srcPtr,
|
||||
<a name="l00369"></a>00369 <span class="keyword">const</span> XMLSize_t count,
|
||||
<a name="l00370"></a>00370 <span class="keyword">const</span> UnRepFlags unrepFlags);
|
||||
<a name="l00371"></a>00371
|
||||
<a name="l00372"></a>00372 <span class="keywordtype">void</span> specialFormat
|
||||
<a name="l00373"></a>00373 (
|
||||
<a name="l00374"></a>00374 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
<a name="l00375"></a>00375 , <span class="keyword">const</span> XMLSize_t count
|
||||
<a name="l00376"></a>00376 , <span class="keyword">const</span> EscapeFlags escapeFlags
|
||||
<a name="l00377"></a>00377 );
|
||||
<a name="l00378"></a>00378
|
||||
<a name="l00379"></a>00379
|
||||
<a name="l00380"></a>00380 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00381"></a>00381 <span class="comment">// Private, non-virtual methods</span>
|
||||
<a name="l00382"></a>00382 <span class="comment">//</span>
|
||||
<a name="l00383"></a>00383 <span class="comment">// fEscapeFlags</span>
|
||||
<a name="l00384"></a>00384 <span class="comment">// The escape flags we were told to use in formatting. These are</span>
|
||||
<a name="l00385"></a>00385 <span class="comment">// defaults set in the ctor, which can be overridden on a particular</span>
|
||||
<a name="l00386"></a>00386 <span class="comment">// call.</span>
|
||||
<a name="l00387"></a>00387 <span class="comment">//</span>
|
||||
<a name="l00388"></a>00388 <span class="comment">// fOutEncoding</span>
|
||||
<a name="l00389"></a>00389 <span class="comment">// This the name of the output encoding. Saved mainly for meaningful</span>
|
||||
<a name="l00390"></a>00390 <span class="comment">// error messages.</span>
|
||||
<a name="l00391"></a>00391 <span class="comment">//</span>
|
||||
<a name="l00392"></a>00392 <span class="comment">// fTarget</span>
|
||||
<a name="l00393"></a>00393 <span class="comment">// This is the target object for the formatting operation.</span>
|
||||
<a name="l00394"></a>00394 <span class="comment">//</span>
|
||||
<a name="l00395"></a>00395 <span class="comment">// fUnRepFlags</span>
|
||||
<a name="l00396"></a>00396 <span class="comment">// The unrepresentable flags that indicate how to react when a</span>
|
||||
<a name="l00397"></a>00397 <span class="comment">// character cannot be represented in the target encoding.</span>
|
||||
<a name="l00398"></a>00398 <span class="comment">//</span>
|
||||
<a name="l00399"></a>00399 <span class="comment">// fXCoder</span>
|
||||
<a name="l00400"></a>00400 <span class="comment">// This the transcoder that we will use. It is created using the</span>
|
||||
<a name="l00401"></a>00401 <span class="comment">// encoding name we were told to use.</span>
|
||||
<a name="l00402"></a>00402 <span class="comment">//</span>
|
||||
<a name="l00403"></a>00403 <span class="comment">// fTmpBuf</span>
|
||||
<a name="l00404"></a>00404 <span class="comment">// An output buffer that we use to transcode chars into before we</span>
|
||||
<a name="l00405"></a>00405 <span class="comment">// send them off to be output.</span>
|
||||
<a name="l00406"></a>00406 <span class="comment">//</span>
|
||||
<a name="l00407"></a>00407 <span class="comment">// fAposRef</span>
|
||||
<a name="l00408"></a>00408 <span class="comment">// fAmpRef</span>
|
||||
<a name="l00409"></a>00409 <span class="comment">// fGTRef</span>
|
||||
<a name="l00410"></a>00410 <span class="comment">// fLTRef</span>
|
||||
<a name="l00411"></a>00411 <span class="comment">// fQuoteRef</span>
|
||||
<a name="l00412"></a>00412 <span class="comment">// These are character refs for the standard char refs, in the</span>
|
||||
<a name="l00413"></a>00413 <span class="comment">// output encoding. They are faulted in as required, by transcoding</span>
|
||||
<a name="l00414"></a>00414 <span class="comment">// them from fixed Unicode versions.</span>
|
||||
<a name="l00415"></a>00415 <span class="comment">//</span>
|
||||
<a name="l00416"></a>00416 <span class="comment">// fIsXML11</span>
|
||||
<a name="l00417"></a>00417 <span class="comment">// for performance reason, we do not store the actual version string</span>
|
||||
<a name="l00418"></a>00418 <span class="comment">// and do the string comparison again and again.</span>
|
||||
<a name="l00419"></a>00419 <span class="comment">//</span>
|
||||
<a name="l00420"></a>00420 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00421"></a>00421 EscapeFlags fEscapeFlags;
|
||||
<a name="l00422"></a>00422 XMLCh* fOutEncoding;
|
||||
<a name="l00423"></a>00423 XMLFormatTarget* fTarget;
|
||||
<a name="l00424"></a>00424 UnRepFlags fUnRepFlags;
|
||||
<a name="l00425"></a>00425 XMLTranscoder* fXCoder;
|
||||
<a name="l00426"></a>00426 XMLByte fTmpBuf[kTmpBufSize + 4];
|
||||
<a name="l00427"></a>00427 XMLByte* fAposRef;
|
||||
<a name="l00428"></a>00428 XMLSize_t fAposLen;
|
||||
<a name="l00429"></a>00429 XMLByte* fAmpRef;
|
||||
<a name="l00430"></a>00430 XMLSize_t fAmpLen;
|
||||
<a name="l00431"></a>00431 XMLByte* fGTRef;
|
||||
<a name="l00432"></a>00432 XMLSize_t fGTLen;
|
||||
<a name="l00433"></a>00433 XMLByte* fLTRef;
|
||||
<a name="l00434"></a>00434 XMLSize_t fLTLen;
|
||||
<a name="l00435"></a>00435 XMLByte* fQuoteRef;
|
||||
<a name="l00436"></a>00436 XMLSize_t fQuoteLen;
|
||||
<a name="l00437"></a>00437 <span class="keywordtype">bool</span> fIsXML11;
|
||||
<a name="l00438"></a>00438 MemoryManager* fMemoryManager;
|
||||
<a name="l00439"></a>00439 };
|
||||
<a name="l00440"></a>00440
|
||||
<a name="l00441"></a>00441
|
||||
<a name="l00442"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html">00442</a> <span class="keyword">class </span>XMLPARSER_EXPORT <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a> : <span class="keyword">public</span> <a class="code" href="classxercesc_1_1XMemory.html" title="This class makes it possible to override the C++ memory management by adding new/delete...">XMemory</a>
|
||||
<a name="l00443"></a>00443 {
|
||||
<a name="l00444"></a>00444 <span class="keyword">public</span>:
|
||||
<a name="l00445"></a>00445 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00446"></a>00446 <span class="comment">// Constructors and Destructor</span>
|
||||
<a name="l00447"></a>00447 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00448"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#777b806b7d24d23c04132897314fc9b8">00448</a> <span class="keyword">virtual</span> ~<a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>() {}
|
||||
<a name="l00449"></a>00449
|
||||
<a name="l00450"></a>00450
|
||||
<a name="l00451"></a>00451 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00452"></a>00452 <span class="comment">// Virtual interface</span>
|
||||
<a name="l00453"></a>00453 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00454"></a>00454 <span class="keyword">virtual</span> <span class="keywordtype">void</span> writeChars
|
||||
<a name="l00455"></a>00455 (
|
||||
<a name="l00456"></a>00456 <span class="keyword">const</span> XMLByte* <span class="keyword">const</span> toWrite
|
||||
<a name="l00457"></a>00457 , <span class="keyword">const</span> XMLSize_t count
|
||||
<a name="l00458"></a>00458 , <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>* <span class="keyword">const</span> formatter
|
||||
<a name="l00459"></a>00459 ) = 0;
|
||||
<a name="l00460"></a>00460
|
||||
<a name="l00461"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#956216cafd06b60bf7c437f4d1693722">00461</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> flush() {};
|
||||
<a name="l00462"></a>00462
|
||||
<a name="l00463"></a>00463
|
||||
<a name="l00464"></a>00464 <span class="keyword">protected</span> :
|
||||
<a name="l00465"></a>00465 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00466"></a>00466 <span class="comment">// Hidden constructors and operators</span>
|
||||
<a name="l00467"></a>00467 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00468"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#0223561322c7660d60be8ca7180916e0">00468</a> <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>() {};
|
||||
<a name="l00469"></a>00469
|
||||
<a name="l00470"></a>00470 <span class="keyword">private</span>:
|
||||
<a name="l00471"></a>00471 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00472"></a>00472 <span class="comment">// Unimplemented constructors and operators</span>
|
||||
<a name="l00473"></a>00473 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00474"></a>00474 <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>&);
|
||||
<a name="l00475"></a>00475 <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>& operator=(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>&);
|
||||
<a name="l00476"></a>00476 };
|
||||
<a name="l00477"></a>00477
|
||||
<a name="l00478"></a>00478
|
||||
<a name="l00479"></a>00479 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00480"></a>00480 <span class="comment">// XMLFormatter: Getter methods</span>
|
||||
<a name="l00481"></a>00481 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00482"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#d5c0f9e924d7d379cb58a07fe7795f0d">00482</a> <span class="keyword">inline</span> <span class="keyword">const</span> XMLCh* XMLFormatter::getEncodingName()<span class="keyword"> const</span>
|
||||
<a name="l00483"></a>00483 <span class="keyword"></span>{
|
||||
<a name="l00484"></a>00484 <span class="keywordflow">return</span> fOutEncoding;
|
||||
<a name="l00485"></a>00485 }
|
||||
<a name="l00486"></a>00486
|
||||
<a name="l00487"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#53d57a0ea755dcb96954e35ba78c11d0">00487</a> <span class="keyword">inline</span> <span class="keyword">const</span> XMLTranscoder* <a class="code" href="classxercesc_1_1XMLFormatter.html#53d57a0ea755dcb96954e35ba78c11d0">XMLFormatter::getTranscoder</a>()<span class="keyword"> const</span>
|
||||
<a name="l00488"></a>00488 <span class="keyword"></span>{
|
||||
<a name="l00489"></a>00489 <span class="keywordflow">return</span> fXCoder;
|
||||
<a name="l00490"></a>00490 }
|
||||
<a name="l00491"></a>00491
|
||||
<a name="l00492"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#dd18f9d8222e8474d946943de9a25946">00492</a> <span class="keyword">inline</span> XMLTranscoder* <a class="code" href="classxercesc_1_1XMLFormatter.html#53d57a0ea755dcb96954e35ba78c11d0">XMLFormatter::getTranscoder</a>()
|
||||
<a name="l00493"></a>00493 {
|
||||
<a name="l00494"></a>00494 <span class="keywordflow">return</span> fXCoder;
|
||||
<a name="l00495"></a>00495 }
|
||||
<a name="l00496"></a>00496
|
||||
<a name="l00497"></a>00497 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00498"></a>00498 <span class="comment">// XMLFormatter: Setter methods</span>
|
||||
<a name="l00499"></a>00499 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00500"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#f019c1de994c34187271365c0e75bb9a">00500</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#f019c1de994c34187271365c0e75bb9a">XMLFormatter::setEscapeFlags</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95" title="EscapeFlags - Different styles of escape flags to control various formatting.">EscapeFlags</a> newFlags)
|
||||
<a name="l00501"></a>00501 {
|
||||
<a name="l00502"></a>00502 fEscapeFlags = newFlags;
|
||||
<a name="l00503"></a>00503 }
|
||||
<a name="l00504"></a>00504
|
||||
<a name="l00505"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#8883cfb0ace1a00353b79a1d6cf2464d">00505</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#8883cfb0ace1a00353b79a1d6cf2464d">XMLFormatter::setUnRepFlags</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c" title="UnRepFlags.">UnRepFlags</a> newFlags)
|
||||
<a name="l00506"></a>00506 {
|
||||
<a name="l00507"></a>00507 fUnRepFlags = newFlags;
|
||||
<a name="l00508"></a>00508 }
|
||||
<a name="l00509"></a>00509
|
||||
<a name="l00510"></a>00510
|
||||
<a name="l00511"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#9255643504940df558e6b978ac1596f4">00511</a> <span class="keyword">inline</span> <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <a class="code" href="classxercesc_1_1XMLFormatter.html#ae530c9afc0e1ebf6a018647d7b4d518">XMLFormatter::operator<<</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95" title="EscapeFlags - Different styles of escape flags to control various formatting.">EscapeFlags</a> newFlags)
|
||||
<a name="l00512"></a>00512 {
|
||||
<a name="l00513"></a>00513 fEscapeFlags = newFlags;
|
||||
<a name="l00514"></a>00514 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||||
<a name="l00515"></a>00515 }
|
||||
<a name="l00516"></a>00516
|
||||
<a name="l00517"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#5401b57187d6c16327cf8230cf795914">00517</a> <span class="keyword">inline</span> <a class="code" href="classxercesc_1_1XMLFormatter.html" title="This class provides the basic formatting capabilities that are required to turn the...">XMLFormatter</a>& <a class="code" href="classxercesc_1_1XMLFormatter.html#ae530c9afc0e1ebf6a018647d7b4d518">XMLFormatter::operator<<</a>(<span class="keyword">const</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c" title="UnRepFlags.">UnRepFlags</a> newFlags)
|
||||
<a name="l00518"></a>00518 {
|
||||
<a name="l00519"></a>00519 fUnRepFlags = newFlags;
|
||||
<a name="l00520"></a>00520 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||||
<a name="l00521"></a>00521 }
|
||||
<a name="l00522"></a>00522
|
||||
<a name="l00523"></a>00523 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00524"></a>00524 <span class="comment">// XMLFormatter: Getter methods</span>
|
||||
<a name="l00525"></a>00525 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00526"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#59a078ded9e759c81808d5fc7f2e8d75">00526</a> <span class="keyword">inline</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#dcf156fb89497dcc1406227d0c7d4b95" title="EscapeFlags - Different styles of escape flags to control various formatting.">XMLFormatter::EscapeFlags</a> <a class="code" href="classxercesc_1_1XMLFormatter.html#59a078ded9e759c81808d5fc7f2e8d75">XMLFormatter::getEscapeFlags</a>()<span class="keyword"> const</span>
|
||||
<a name="l00527"></a>00527 <span class="keyword"></span>{
|
||||
<a name="l00528"></a>00528 <span class="keywordflow">return</span> fEscapeFlags;
|
||||
<a name="l00529"></a>00529 }
|
||||
<a name="l00530"></a>00530
|
||||
<a name="l00531"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#83e0bcc47dfac3f7761fe68a0497316e">00531</a> <span class="keyword">inline</span> <a class="code" href="classxercesc_1_1XMLFormatter.html#08104c01dcd00f1a414582c77375715c" title="UnRepFlags.">XMLFormatter::UnRepFlags</a> <a class="code" href="classxercesc_1_1XMLFormatter.html#83e0bcc47dfac3f7761fe68a0497316e">XMLFormatter::getUnRepFlags</a>()<span class="keyword"> const</span>
|
||||
<a name="l00532"></a>00532 <span class="keyword"></span>{
|
||||
<a name="l00533"></a>00533 <span class="keywordflow">return</span> fUnRepFlags;
|
||||
<a name="l00534"></a>00534 }
|
||||
<a name="l00535"></a>00535
|
||||
<a name="l00536"></a>00536 XERCES_CPP_NAMESPACE_END
|
||||
<a name="l00537"></a>00537
|
||||
<a name="l00538"></a>00538 <span class="preprocessor">#endif</span>
|
||||
</pre></div></div>
|
||||
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 5 19:53:55 2009 for XQilla Simple API by
|
||||
<!-- Generated by Doxygen 1.3.9.1 -->
|
||||
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</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">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="examples.html">Examples</a></div>
|
||||
<div class="nav">
|
||||
<a class="el" href="dir_000007.html">xerces-c-3.0.1</a> / <a class="el" href="dir_000008.html">src</a> / <a class="el" href="dir_000009.html">xercesc</a> / <a class="el" href="dir_000014.html">framework</a></div>
|
||||
<h1>XMLFormatter.hpp</h1><a href="XMLFormatter_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
|
||||
00002 <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span>
|
||||
00003 <span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span>
|
||||
00004 <span class="comment"> * this work for additional information regarding copyright ownership.</span>
|
||||
00005 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span>
|
||||
00006 <span class="comment"> * (the "License"); you may not use this file except in compliance with</span>
|
||||
00007 <span class="comment"> * the License. You may obtain a copy of the License at</span>
|
||||
00008 <span class="comment"> *</span>
|
||||
00009 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
|
||||
00010 <span class="comment"> *</span>
|
||||
00011 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
|
||||
00012 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
|
||||
00013 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
|
||||
00014 <span class="comment"> * See the License for the specific language governing permissions and</span>
|
||||
00015 <span class="comment"> * limitations under the License.</span>
|
||||
00016 <span class="comment"> */</span>
|
||||
00017
|
||||
00018 <span class="comment">/*</span>
|
||||
00019 <span class="comment"> * $Id: XMLFormatter.hpp 698579 2008-09-24 14:13:08Z borisk $</span>
|
||||
00020 <span class="comment"> */</span>
|
||||
00021
|
||||
00022 <span class="preprocessor">#if !defined(XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP)</span>
|
||||
<a name="l00023"></a><a class="code" href="XMLFormatter_8hpp.html#a0">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP</span>
|
||||
00024 <span class="preprocessor"></span>
|
||||
00025 <span class="preprocessor">#include <<a class="code" href="PlatformUtils_8hpp.html">xercesc/util/PlatformUtils.hpp</a>></span>
|
||||
00026
|
||||
00027 XERCES_CPP_NAMESPACE_BEGIN
|
||||
00028
|
||||
00029 <span class="keyword">class </span>XMLFormatTarget;
|
||||
00030 <span class="keyword">class </span>XMLTranscoder;
|
||||
00031
|
||||
<a name="l00041"></a><a class="code" href="classxercesc_1_1XMLFormatter.html">00041</a> <span class="keyword">class </span>XMLPARSER_EXPORT XMLFormatter : <span class="keyword">public</span> <a class="code" href="classxercesc_1_1XMemory.html">XMemory</a>
|
||||
00042 {
|
||||
00043 <span class="keyword">public</span>:
|
||||
00044 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00045 <span class="comment">// Class types</span>
|
||||
00046 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00124"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z145_0">00124</a> <span class="comment"></span> <span class="keyword">enum</span> EscapeFlags
|
||||
00125 {
|
||||
00126 NoEscapes
|
||||
00127 , StdEscapes
|
||||
00128 , AttrEscapes
|
||||
00129 , CharEscapes
|
||||
00130
|
||||
00131 <span class="comment">// Special values, don't use directly</span>
|
||||
00132 , EscapeFlags_Count
|
||||
00133 , DefaultEscape = 999
|
||||
00134 };
|
||||
00135
|
||||
<a name="l00152"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z145_1">00152</a> <span class="keyword">enum</span> UnRepFlags
|
||||
00153 {
|
||||
00154 UnRep_Fail
|
||||
00155 , UnRep_CharRef
|
||||
00156 , UnRep_Replace
|
||||
00157
|
||||
00158 , DefaultUnRep = 999
|
||||
00159 };
|
||||
00161
|
||||
00162
|
||||
00163 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00164 <span class="comment">// Constructors and Destructor</span>
|
||||
00165 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00177 <span class="comment"></span> XMLFormatter
|
||||
00178 (
|
||||
00179 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> outEncoding
|
||||
00180 , <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> docVersion
|
||||
00181 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
00182 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
00183 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
00184 , <a class="code" href="classxercesc_1_1MemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
00185 );
|
||||
00186
|
||||
00187 XMLFormatter
|
||||
00188 (
|
||||
00189 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> outEncoding
|
||||
00190 , <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> docVersion
|
||||
00191 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
00192 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
00193 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
00194 , <a class="code" href="classxercesc_1_1MemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
00195 );
|
||||
00196
|
||||
00197 XMLFormatter
|
||||
00198 (
|
||||
00199 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> outEncoding
|
||||
00200 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
00201 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
00202 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
00203 , <a class="code" href="classxercesc_1_1MemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
00204 );
|
||||
00205
|
||||
00206 XMLFormatter
|
||||
00207 (
|
||||
00208 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> outEncoding
|
||||
00209 , <a class="code" href="classxercesc_1_1XMLFormatTarget.html">XMLFormatTarget</a>* <span class="keyword">const</span> target
|
||||
00210 , <span class="keyword">const</span> EscapeFlags escapeFlags = NoEscapes
|
||||
00211 , <span class="keyword">const</span> UnRepFlags unrepFlags = UnRep_Fail
|
||||
00212 , <a class="code" href="classxercesc_1_1MemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager
|
||||
00213 );
|
||||
00214
|
||||
00215 ~XMLFormatter();
|
||||
00217
|
||||
00218
|
||||
00219 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00220 <span class="comment">// Formatting methods</span>
|
||||
00221 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00231 <span class="comment"></span> <span class="keywordtype">void</span> formatBuf
|
||||
00232 (
|
||||
00233 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
00234 , <span class="keyword">const</span> XMLSize_t count
|
||||
00235 , <span class="keyword">const</span> EscapeFlags escapeFlags = DefaultEscape
|
||||
00236 , <span class="keyword">const</span> UnRepFlags unrepFlags = DefaultUnRep
|
||||
00237 );
|
||||
00238
|
||||
00242 XMLFormatter& <span class="keyword">operator</span><<
|
||||
00243 (
|
||||
00244 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
00245 );
|
||||
00246
|
||||
00247 XMLFormatter& <span class="keyword">operator</span><<
|
||||
00248 (
|
||||
00249 <span class="keyword">const</span> XMLCh toFormat
|
||||
00250 );
|
||||
00251
|
||||
00252 <span class="keywordtype">void</span> writeBOM(<span class="keyword">const</span> XMLByte* <span class="keyword">const</span> toFormat
|
||||
00253 , <span class="keyword">const</span> XMLSize_t count);
|
||||
00254
|
||||
00256
|
||||
00257 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00258 <span class="comment">// Getter methods</span>
|
||||
00259 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00266 <span class="comment"></span> <span class="keyword">const</span> XMLCh* getEncodingName() <span class="keyword">const</span>;
|
||||
00267
|
||||
00271 <span class="keyword">inline</span> <span class="keyword">const</span> XMLTranscoder* getTranscoder() <span class="keyword">const</span>;
|
||||
00272
|
||||
00276 <span class="keyword">inline</span> XMLTranscoder* getTranscoder();
|
||||
00277
|
||||
00279
|
||||
00280 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00281 <span class="comment">// Setter methods</span>
|
||||
00282 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00288 <span class="comment"></span> <span class="keywordtype">void</span> setEscapeFlags
|
||||
00289 (
|
||||
00290 <span class="keyword">const</span> EscapeFlags newFlags
|
||||
00291 );
|
||||
00292
|
||||
00296 <span class="keywordtype">void</span> setUnRepFlags
|
||||
00297 (
|
||||
00298 <span class="keyword">const</span> UnRepFlags newFlags
|
||||
00299 );
|
||||
00300
|
||||
00305 XMLFormatter& <span class="keyword">operator</span><<
|
||||
00306 (
|
||||
00307 <span class="keyword">const</span> EscapeFlags newFlags
|
||||
00308 );
|
||||
00309
|
||||
00314 XMLFormatter& <span class="keyword">operator</span><<
|
||||
00315 (
|
||||
00316 <span class="keyword">const</span> UnRepFlags newFlags
|
||||
00317 );
|
||||
00319
|
||||
00320 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00321 <span class="comment">// Getter methods</span>
|
||||
00322 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00328 <span class="comment"></span> EscapeFlags getEscapeFlags() <span class="keyword">const</span>;
|
||||
00329
|
||||
00333 UnRepFlags getUnRepFlags() <span class="keyword">const</span>;
|
||||
00335
|
||||
00336 <span class="keyword">private</span> :
|
||||
00337 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00338 <span class="comment">// Unimplemented constructors and operators</span>
|
||||
00339 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00340 XMLFormatter();
|
||||
00341 XMLFormatter(<span class="keyword">const</span> XMLFormatter&);
|
||||
00342 XMLFormatter& operator=(<span class="keyword">const</span> XMLFormatter&);
|
||||
00343
|
||||
00344
|
||||
00345 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00346 <span class="comment">// Private class constants</span>
|
||||
00347 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00348 <span class="keyword">enum</span> Constants
|
||||
00349 {
|
||||
00350 kTmpBufSize = 16 * 1024
|
||||
00351 };
|
||||
00352
|
||||
00353
|
||||
00354 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00355 <span class="comment">// Private helper methods</span>
|
||||
00356 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00357 <span class="keyword">const</span> XMLByte* getCharRef(XMLSize_t &count,
|
||||
00358 XMLByte* &ref,
|
||||
00359 <span class="keyword">const</span> XMLCh * stdRef);
|
||||
00360
|
||||
00361 <span class="keywordtype">void</span> writeCharRef(<span class="keyword">const</span> XMLCh &toWrite);
|
||||
00362 <span class="keywordtype">void</span> writeCharRef(XMLSize_t toWrite);
|
||||
00363
|
||||
00364 <span class="keywordtype">bool</span> inEscapeList(<span class="keyword">const</span> XMLFormatter::EscapeFlags escStyle
|
||||
00365 , <span class="keyword">const</span> XMLCh toCheck);
|
||||
00366
|
||||
00367
|
||||
00368 XMLSize_t handleUnEscapedChars(<span class="keyword">const</span> XMLCh * srcPtr,
|
||||
00369 <span class="keyword">const</span> XMLSize_t count,
|
||||
00370 <span class="keyword">const</span> UnRepFlags unrepFlags);
|
||||
00371
|
||||
00372 <span class="keywordtype">void</span> specialFormat
|
||||
00373 (
|
||||
00374 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toFormat
|
||||
00375 , <span class="keyword">const</span> XMLSize_t count
|
||||
00376 , <span class="keyword">const</span> EscapeFlags escapeFlags
|
||||
00377 );
|
||||
00378
|
||||
00379
|
||||
00380 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00381 <span class="comment">// Private, non-virtual methods</span>
|
||||
00382 <span class="comment">//</span>
|
||||
00383 <span class="comment">// fEscapeFlags</span>
|
||||
00384 <span class="comment">// The escape flags we were told to use in formatting. These are</span>
|
||||
00385 <span class="comment">// defaults set in the ctor, which can be overridden on a particular</span>
|
||||
00386 <span class="comment">// call.</span>
|
||||
00387 <span class="comment">//</span>
|
||||
00388 <span class="comment">// fOutEncoding</span>
|
||||
00389 <span class="comment">// This the name of the output encoding. Saved mainly for meaningful</span>
|
||||
00390 <span class="comment">// error messages.</span>
|
||||
00391 <span class="comment">//</span>
|
||||
00392 <span class="comment">// fTarget</span>
|
||||
00393 <span class="comment">// This is the target object for the formatting operation.</span>
|
||||
00394 <span class="comment">//</span>
|
||||
00395 <span class="comment">// fUnRepFlags</span>
|
||||
00396 <span class="comment">// The unrepresentable flags that indicate how to react when a</span>
|
||||
00397 <span class="comment">// character cannot be represented in the target encoding.</span>
|
||||
00398 <span class="comment">//</span>
|
||||
00399 <span class="comment">// fXCoder</span>
|
||||
00400 <span class="comment">// This the transcoder that we will use. It is created using the</span>
|
||||
00401 <span class="comment">// encoding name we were told to use.</span>
|
||||
00402 <span class="comment">//</span>
|
||||
00403 <span class="comment">// fTmpBuf</span>
|
||||
00404 <span class="comment">// An output buffer that we use to transcode chars into before we</span>
|
||||
00405 <span class="comment">// send them off to be output.</span>
|
||||
00406 <span class="comment">//</span>
|
||||
00407 <span class="comment">// fAposRef</span>
|
||||
00408 <span class="comment">// fAmpRef</span>
|
||||
00409 <span class="comment">// fGTRef</span>
|
||||
00410 <span class="comment">// fLTRef</span>
|
||||
00411 <span class="comment">// fQuoteRef</span>
|
||||
00412 <span class="comment">// These are character refs for the standard char refs, in the</span>
|
||||
00413 <span class="comment">// output encoding. They are faulted in as required, by transcoding</span>
|
||||
00414 <span class="comment">// them from fixed Unicode versions.</span>
|
||||
00415 <span class="comment">//</span>
|
||||
00416 <span class="comment">// fIsXML11</span>
|
||||
00417 <span class="comment">// for performance reason, we do not store the actual version string</span>
|
||||
00418 <span class="comment">// and do the string comparison again and again.</span>
|
||||
00419 <span class="comment">//</span>
|
||||
00420 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00421 EscapeFlags fEscapeFlags;
|
||||
00422 XMLCh* fOutEncoding;
|
||||
00423 XMLFormatTarget* fTarget;
|
||||
00424 UnRepFlags fUnRepFlags;
|
||||
00425 XMLTranscoder* fXCoder;
|
||||
00426 XMLByte fTmpBuf[kTmpBufSize + 4];
|
||||
00427 XMLByte* fAposRef;
|
||||
00428 XMLSize_t fAposLen;
|
||||
00429 XMLByte* fAmpRef;
|
||||
00430 XMLSize_t fAmpLen;
|
||||
00431 XMLByte* fGTRef;
|
||||
00432 XMLSize_t fGTLen;
|
||||
00433 XMLByte* fLTRef;
|
||||
00434 XMLSize_t fLTLen;
|
||||
00435 XMLByte* fQuoteRef;
|
||||
00436 XMLSize_t fQuoteLen;
|
||||
00437 <span class="keywordtype">bool</span> fIsXML11;
|
||||
00438 MemoryManager* fMemoryManager;
|
||||
00439 };
|
||||
00440
|
||||
00441
|
||||
<a name="l00442"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html">00442</a> <span class="keyword">class </span>XMLPARSER_EXPORT XMLFormatTarget : <span class="keyword">public</span> <a class="code" href="classxercesc_1_1XMemory.html">XMemory</a>
|
||||
00443 {
|
||||
00444 <span class="keyword">public</span>:
|
||||
00445 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00446 <span class="comment">// Constructors and Destructor</span>
|
||||
00447 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00448"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#a0">00448</a> <span class="keyword">virtual</span> ~XMLFormatTarget() {}
|
||||
00449
|
||||
00450
|
||||
00451 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00452 <span class="comment">// Virtual interface</span>
|
||||
00453 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00454 <span class="keyword">virtual</span> <span class="keywordtype">void</span> writeChars
|
||||
00455 (
|
||||
00456 <span class="keyword">const</span> XMLByte* <span class="keyword">const</span> toWrite
|
||||
00457 , <span class="keyword">const</span> XMLSize_t count
|
||||
00458 , XMLFormatter* <span class="keyword">const</span> formatter
|
||||
00459 ) = 0;
|
||||
00460
|
||||
<a name="l00461"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#a2">00461</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> flush() {};
|
||||
00462
|
||||
00463
|
||||
00464 <span class="keyword">protected</span> :
|
||||
00465 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00466 <span class="comment">// Hidden constructors and operators</span>
|
||||
00467 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
<a name="l00468"></a><a class="code" href="classxercesc_1_1XMLFormatTarget.html#b0">00468</a> XMLFormatTarget() {};
|
||||
00469
|
||||
00470 <span class="keyword">private</span>:
|
||||
00471 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00472 <span class="comment">// Unimplemented constructors and operators</span>
|
||||
00473 <span class="comment">// -----------------------------------------------------------------------</span>
|
||||
00474 XMLFormatTarget(<span class="keyword">const</span> XMLFormatTarget&);
|
||||
00475 XMLFormatTarget& operator=(<span class="keyword">const</span> XMLFormatTarget&);
|
||||
00476 };
|
||||
00477
|
||||
00478
|
||||
00479 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
00480 <span class="comment">// XMLFormatter: Getter methods</span>
|
||||
00481 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00482"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z151_0">00482</a> <span class="keyword">inline</span> <span class="keyword">const</span> XMLCh* XMLFormatter::getEncodingName()<span class="keyword"> const</span>
|
||||
00483 <span class="keyword"></span>{
|
||||
00484 <span class="keywordflow">return</span> fOutEncoding;
|
||||
00485 }
|
||||
00486
|
||||
<a name="l00487"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z151_1">00487</a> <span class="keyword">inline</span> <span class="keyword">const</span> XMLTranscoder* XMLFormatter::getTranscoder()<span class="keyword"> const</span>
|
||||
00488 <span class="keyword"></span>{
|
||||
00489 <span class="keywordflow">return</span> fXCoder;
|
||||
00490 }
|
||||
00491
|
||||
<a name="l00492"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z151_2">00492</a> <span class="keyword">inline</span> XMLTranscoder* XMLFormatter::getTranscoder()
|
||||
00493 {
|
||||
00494 <span class="keywordflow">return</span> fXCoder;
|
||||
00495 }
|
||||
00496
|
||||
00497 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
00498 <span class="comment">// XMLFormatter: Setter methods</span>
|
||||
00499 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00500"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z153_0">00500</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> XMLFormatter::setEscapeFlags(<span class="keyword">const</span> EscapeFlags newFlags)
|
||||
00501 {
|
||||
00502 fEscapeFlags = newFlags;
|
||||
00503 }
|
||||
00504
|
||||
<a name="l00505"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z153_1">00505</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> XMLFormatter::setUnRepFlags(<span class="keyword">const</span> UnRepFlags newFlags)
|
||||
00506 {
|
||||
00507 fUnRepFlags = newFlags;
|
||||
00508 }
|
||||
00509
|
||||
00510
|
||||
<a name="l00511"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z153_2">00511</a> <span class="keyword">inline</span> XMLFormatter& XMLFormatter::operator<<(<span class="keyword">const</span> EscapeFlags newFlags)
|
||||
00512 {
|
||||
00513 fEscapeFlags = newFlags;
|
||||
00514 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||||
00515 }
|
||||
00516
|
||||
<a name="l00517"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z153_3">00517</a> <span class="keyword">inline</span> XMLFormatter& XMLFormatter::operator<<(<span class="keyword">const</span> UnRepFlags newFlags)
|
||||
00518 {
|
||||
00519 fUnRepFlags = newFlags;
|
||||
00520 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||||
00521 }
|
||||
00522
|
||||
00523 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
00524 <span class="comment">// XMLFormatter: Getter methods</span>
|
||||
00525 <span class="comment">// ---------------------------------------------------------------------------</span>
|
||||
<a name="l00526"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z155_0">00526</a> <span class="keyword">inline</span> XMLFormatter::EscapeFlags XMLFormatter::getEscapeFlags()<span class="keyword"> const</span>
|
||||
00527 <span class="keyword"></span>{
|
||||
00528 <span class="keywordflow">return</span> fEscapeFlags;
|
||||
00529 }
|
||||
00530
|
||||
<a name="l00531"></a><a class="code" href="classxercesc_1_1XMLFormatter.html#z155_1">00531</a> <span class="keyword">inline</span> XMLFormatter::UnRepFlags XMLFormatter::getUnRepFlags()<span class="keyword"> const</span>
|
||||
00532 <span class="keyword"></span>{
|
||||
00533 <span class="keywordflow">return</span> fUnRepFlags;
|
||||
00534 }
|
||||
00535
|
||||
00536 XERCES_CPP_NAMESPACE_END
|
||||
00537
|
||||
00538 <span class="preprocessor">#endif</span>
|
||||
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Sep 25 06:55:26 2009 for XQilla Simple API by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
||||
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue