| <HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD>
|
| <BODY>
|
| <h2 align="center">Xalan-C++ API Documentation</h2>
|
| <h3 align="center">The Xalan C++ XSLT Processor Version 1.10</h3>
|
| </BODY> |
| <!-- Generated by Doxygen 1.2.8.1 --> |
| <center> |
| <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> |
| <hr><h1>XalanOtherEncodingWriter.hpp</h1><a href="XalanOtherEncodingWriter_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font> |
| 00002 <font class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</font> |
| 00003 <font class="comment"> *</font> |
| 00004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font> |
| 00005 <font class="comment"> * you may not use this file except in compliance with the License.</font> |
| 00006 <font class="comment"> * You may obtain a copy of the License at</font> |
| 00007 <font class="comment"> *</font> |
| 00008 <font class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</font> |
| 00009 <font class="comment"> *</font> |
| 00010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font> |
| 00011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font> |
| 00012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font> |
| 00013 <font class="comment"> * See the License for the specific language governing permissions and</font> |
| 00014 <font class="comment"> * limitations under the License.</font> |
| 00015 <font class="comment"> */</font> |
| 00016 <font class="preprocessor">#if !defined(XALANUNICODESUBSETWRITER_HEADER_GUARD_1357924680)</font> |
| <a name="l00017"></a><a class="code" href="XalanOtherEncodingWriter_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XALANUNICODESUBSETWRITER_HEADER_GUARD_1357924680</font> |
| 00018 <font class="preprocessor"></font> |
| 00019 |
| 00020 <font class="preprocessor">#include <<a class="code" href="XalanFormatterWriter_8hpp.html">xalanc/XMLSupport/XalanFormatterWriter.hpp</a>></font> |
| 00021 |
| 00022 |
| 00023 |
| 00024 XALAN_CPP_NAMESPACE_BEGIN |
| 00025 |
| 00026 |
| 00027 |
| 00028 |
| 00029 <font class="keyword">template</font> <<font class="keyword">class </font>Predicate, |
| 00030 <font class="keyword">class </font>ConstantsType> |
| <a name="l00031"></a><a class="code" href="classXalanOtherEncodingWriter.html">00031</a> <font class="keyword">class </font><a class="code" href="classXalanOtherEncodingWriter.html">XalanOtherEncodingWriter</a> : <font class="keyword">public</font> <a class="code" href="classXalanFormatterWriter.html">XalanFormatterWriter</a> |
| 00032 { |
| 00033 <font class="keyword">public</font>: |
| 00034 |
| <a name="l00035"></a><a class="code" href="classXalanOtherEncodingWriter.html#s0">00035</a> <font class="keyword">typedef</font> <a class="code" href="classXalanOtherEncodingWriter.html">XalanOtherEncodingWriter<Predicate, ConstantsType></a> <a class="code" href="classXalanDeque.html">ThisType</a>; |
| 00036 |
| <a name="l00037"></a><a class="code" href="classXalanOtherEncodingWriter_1_1WriteCharRef.html">00037</a> <font class="keyword">class </font>WriteCharRef |
| 00038 { |
| 00039 <font class="keyword">public</font>: |
| 00040 |
| <a name="l00041"></a><a class="code" href="classXalanOtherEncodingWriter_1_1WriteCharRef.html#a0">00041</a> <a class="code" href="classXalanOtherEncodingWriter_1_1WriteCharRef.html#a0">WriteCharRef</a>(<a class="code" href="classXalanDeque.html">ThisType</a>& writer) : |
| 00042 m_writer(writer) |
| 00043 { |
| 00044 } |
| 00045 |
| 00046 <font class="keywordtype">void</font> |
| <a name="l00047"></a><a class="code" href="classXalanOtherEncodingWriter_1_1WriteCharRef.html#a1">00047</a> <a class="code" href="classXalanOtherEncodingWriter_1_1WriteCharRef.html#a1">operator()</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> value)<font class="keyword"> const</font> |
| 00048 <font class="keyword"> </font>{ |
| 00049 m_writer.writeNumericCharacterReference(value); |
| 00050 } |
| 00051 |
| 00052 <font class="keyword">private</font>: |
| 00053 |
| 00054 <a class="code" href="classXalanDeque.html">ThisType</a>& m_writer; |
| 00055 }; |
| 00056 |
| <a name="l00057"></a><a class="code" href="classXalanOtherEncodingWriter_1_1ThrowTranscodingException.html">00057</a> <font class="keyword">class </font>ThrowTranscodingException |
| 00058 { |
| 00059 <font class="keyword">public</font>: |
| 00060 |
| <a name="l00061"></a><a class="code" href="classXalanOtherEncodingWriter_1_1ThrowTranscodingException.html#a0">00061</a> <a class="code" href="classXalanOtherEncodingWriter_1_1ThrowTranscodingException.html#a0">ThrowTranscodingException</a>(<a class="code" href="classXalanDeque.html">ThisType</a>& writer) : |
| 00062 m_writer(writer) |
| 00063 { |
| 00064 } |
| 00065 |
| 00066 <font class="keywordtype">void</font> |
| <a name="l00067"></a><a class="code" href="classXalanOtherEncodingWriter_1_1ThrowTranscodingException.html#a1">00067</a> <a class="code" href="classXalanOtherEncodingWriter_1_1ThrowTranscodingException.html#a1">operator()</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> value)<font class="keyword"> const</font> |
| 00068 <font class="keyword"> </font>{ |
| 00069 m_writer.throwInvalidCharacterException(value, m_writer.<a class="code" href="classXalanDeque.html#a20">getMemoryManager</a>()); |
| 00070 } |
| 00071 |
| 00072 <font class="keyword">private</font>: |
| 00073 |
| 00074 <a class="code" href="classXalanDeque.html">ThisType</a>& m_writer; |
| 00075 }; |
| 00076 |
| <a name="l00077"></a><a class="code" href="classXalanOtherEncodingWriter.html#l0">00077</a> <font class="keyword">friend</font> <font class="keyword">class </font>WriteCharRef; |
| <a name="l00078"></a><a class="code" href="classXalanOtherEncodingWriter.html#l1">00078</a> <font class="keyword">friend</font> <font class="keyword">class </font>ThrowTranscodingException; |
| 00079 |
| <a name="l00080"></a><a class="code" href="classXalanOtherEncodingWriter.html#s1">00080</a> <font class="keyword">typedef</font> XalanDOMChar value_type; |
| 00081 |
| <a name="l00082"></a><a class="code" href="classXalanOtherEncodingWriter.html#a0">00082</a> <a class="code" href="classXalanOtherEncodingWriter.html#a0">XalanOtherEncodingWriter</a>( |
| 00083 <a class="code" href="classWriter.html">Writer</a>& writer, |
| 00084 MemoryManager& theMemoryManager) : |
| 00085 <a class="code" href="classXalanFormatterWriter.html">XalanFormatterWriter</a>( |
| 00086 writer, |
| 00087 theMemoryManager), |
| 00088 m_buffer(), |
| 00089 m_bufferPosition(m_buffer), |
| 00090 m_bufferRemaining(kBufferSize), |
| 00091 m_predicate(writer.getStream()), |
| 00092 m_constants(), |
| 00093 m_charRefFunctor(*this), |
| 00094 m_exceptionFunctor(*this) |
| 00095 { |
| 00096 } |
| 00097 |
| 00098 <font class="keyword">virtual</font> |
| <a name="l00099"></a><a class="code" href="classXalanOtherEncodingWriter.html#a1">00099</a> <a class="code" href="classXalanOtherEncodingWriter.html#a1">~XalanOtherEncodingWriter</a>()<font class="keyword"></font> |
| 00100 <font class="keyword"> </font>{ |
| 00101 } |
| 00102 |
| 00106 <font class="keywordtype">void</font> |
| <a name="l00107"></a><a class="code" href="classXalanOtherEncodingWriter.html#a2">00107</a> <a class="code" href="classXalanOtherEncodingWriter.html#a2">outputNewline</a>()<font class="keyword"></font> |
| 00108 <font class="keyword"> </font>{ |
| 00109 assert(m_newlineString != 0); |
| 00110 assert(<a class="code" href="DOMStringHelper_8hpp.html#a14">length</a>(m_newlineString) == m_newlineStringLength); |
| 00111 |
| 00112 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00113 m_newlineString, |
| 00114 m_newlineStringLength); |
| 00115 } |
| 00116 |
| 00121 size_type |
| <a name="l00122"></a><a class="code" href="classXalanOtherEncodingWriter.html#a3">00122</a> <a class="code" href="classXalanOtherEncodingWriter.html#a3">writeCDATAChar</a>( |
| 00123 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00124 size_type start, |
| 00125 size_type length, |
| 00126 <font class="keywordtype">bool</font>& outsideCDATA)<font class="keyword"></font> |
| 00127 <font class="keyword"> </font>{ |
| 00128 assert(chars != 0 && length > 0 && start < length); |
| 00129 |
| 00130 <font class="keyword">const</font> XalanDOMChar theChar = chars[start]; |
| 00131 |
| 00132 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> value = theChar; |
| 00133 |
| 00134 size_type result = start; |
| 00135 |
| 00136 <font class="keywordflow">if</font> (isUTF16HighSurrogate(theChar) == <font class="keyword">true</font>) |
| 00137 { |
| 00138 <font class="keywordflow">if</font> (start + 1 >= length) |
| 00139 { |
| 00140 throwInvalidUTF16SurrogateException( |
| 00141 theChar, |
| 00142 0, |
| 00143 getMemoryManager()); |
| 00144 } |
| 00145 <font class="keywordflow">else</font> |
| 00146 { |
| 00147 value = decodeUTF16SurrogatePair(theChar, chars[start+1], getMemoryManager()); |
| 00148 |
| 00149 ++result; |
| 00150 } |
| 00151 } |
| 00152 |
| 00153 <font class="keywordflow">if</font>(m_predicate(value)) |
| 00154 { |
| 00155 <font class="keywordflow">if</font> (outsideCDATA == <font class="keyword">false</font>) |
| 00156 { |
| 00157 <font class="comment">// We have a representable char in the normal state,</font> |
| 00158 <font class="comment">// so just print it.</font> |
| 00159 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(value); |
| 00160 } |
| 00161 <font class="keywordflow">else</font> |
| 00162 { |
| 00163 <font class="comment">// The previous character was a not representable.</font> |
| 00164 <font class="comment">// Open the CDATA section again, print the character,</font> |
| 00165 <font class="comment">// then change the flag.</font> |
| 00166 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00167 m_constants.s_cdataOpenString, |
| 00168 m_constants.s_cdataOpenStringLength); |
| 00169 |
| 00170 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(value); |
| 00171 |
| 00172 outsideCDATA = <font class="keyword">false</font>; |
| 00173 } |
| 00174 } |
| 00175 <font class="keywordflow">else</font> |
| 00176 { |
| 00177 <font class="keywordflow">if</font>(outsideCDATA == <font class="keyword">false</font>) |
| 00178 { |
| 00179 <font class="comment">// we have a non-representable char in the normal state - </font> |
| 00180 <font class="comment">// close the CDATA section and print the value</font> |
| 00181 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00182 m_constants.s_cdataCloseString, |
| 00183 m_constants.s_cdataCloseStringLength); |
| 00184 |
| 00185 writeNumericCharacterReference(value); |
| 00186 |
| 00187 outsideCDATA = <font class="keyword">true</font>; |
| 00188 } |
| 00189 <font class="keywordflow">else</font> |
| 00190 { |
| 00191 writeNumericCharacterReference(value); |
| 00192 } |
| 00193 } |
| 00194 |
| 00195 <font class="keywordflow">return</font> result; |
| 00196 } |
| 00197 |
| 00202 <font class="keywordtype">void</font> |
| <a name="l00203"></a><a class="code" href="classXalanOtherEncodingWriter.html#a4">00203</a> <a class="code" href="classXalanOtherEncodingWriter.html#a4">writeNameChar</a>( |
| 00204 <font class="keyword">const</font> XalanDOMChar* data, |
| 00205 size_type theLength)<font class="keyword"></font> |
| 00206 <font class="keyword"> </font>{ |
| 00207 <font class="keywordflow">for</font>( size_type i = 0; i < theLength; ++i) |
| 00208 { |
| 00209 i = <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(data, i , theLength, m_exceptionFunctor); |
| 00210 } |
| 00211 } |
| 00212 |
| 00217 <font class="keywordtype">void</font> |
| <a name="l00218"></a><a class="code" href="classXalanOtherEncodingWriter.html#a5">00218</a> <a class="code" href="classXalanOtherEncodingWriter.html#a5">writePIChars</a>( |
| 00219 <font class="keyword">const</font> XalanDOMChar* data, |
| 00220 size_type theLength)<font class="keyword"></font> |
| 00221 <font class="keyword"> </font>{ |
| 00222 <font class="keywordflow">for</font>( size_type i = 0; i < theLength; ) |
| 00223 { |
| 00224 i = <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(data, i , theLength, m_exceptionFunctor); |
| 00225 } |
| 00226 } |
| 00227 |
| 00233 <font class="keywordtype">void</font> |
| <a name="l00234"></a><a class="code" href="classXalanOtherEncodingWriter.html#a6">00234</a> <a class="code" href="classXalanOtherEncodingWriter.html#a6">writeCommentChars</a>( |
| 00235 <font class="keyword">const</font> XalanDOMChar* data, |
| 00236 size_type theLength)<font class="keyword"></font> |
| 00237 <font class="keyword"> </font>{ |
| 00238 <font class="keywordflow">for</font>( size_type i = 0; i < theLength; ) |
| 00239 { |
| 00240 i = <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(data, i , theLength, m_exceptionFunctor); |
| 00241 } |
| 00242 } |
| 00243 |
| 00244 <font class="keywordtype">void</font> |
| <a name="l00245"></a><a class="code" href="classXalanOtherEncodingWriter.html#a7">00245</a> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00246 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00247 size_type theLength)<font class="keyword"></font> |
| 00248 <font class="keyword"> </font>{ |
| 00249 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00250 { |
| 00251 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(theChars[i]); |
| 00252 } |
| 00253 } |
| 00254 |
| 00255 <font class="keywordtype">void</font> |
| <a name="l00256"></a><a class="code" href="classXalanOtherEncodingWriter.html#a8">00256</a> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>& theChars)<font class="keyword"></font> |
| 00257 <font class="keyword"> </font>{ |
| 00258 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(theChars.<a class="code" href="classXalanDOMString.html#a33">c_str</a>(), theChars.<a class="code" href="classXalanDOMString.html#a20">length</a>()); |
| 00259 } |
| 00260 |
| 00265 <font class="keywordtype">void</font> |
| <a name="l00266"></a><a class="code" href="classXalanOtherEncodingWriter.html#a9">00266</a> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(XalanDOMChar theChar)<font class="keyword"></font> |
| 00267 <font class="keyword"> </font>{ |
| 00268 assert( |
| 00269 isUTF16HighSurrogate(theChar) == <font class="keyword">false</font> && |
| 00270 isUTF16LowSurrogate(theChar) == <font class="keyword">false</font>); |
| 00271 |
| 00272 <font class="keywordflow">if</font> (m_bufferRemaining == 0) |
| 00273 { |
| 00274 <a class="code" href="classXalanOtherEncodingWriter.html#a14">flushBuffer</a>(); |
| 00275 } |
| 00276 |
| 00277 <font class="keywordflow">if</font>(m_predicate(theChar)) |
| 00278 { |
| 00279 *m_bufferPosition = theChar; |
| 00280 |
| 00281 ++m_bufferPosition; |
| 00282 --m_bufferRemaining; |
| 00283 } |
| 00284 <font class="keywordflow">else</font> |
| 00285 { |
| 00286 writeNumericCharacterReference(theChar); |
| 00287 } |
| 00288 } |
| 00289 |
| 00290 size_type |
| <a name="l00291"></a><a class="code" href="classXalanOtherEncodingWriter.html#a10">00291</a> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00292 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00293 size_type start, |
| 00294 size_type length)<font class="keyword"></font> |
| 00295 <font class="keyword"> </font>{ |
| 00296 |
| 00297 <font class="keywordflow">return</font> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(chars, start, length, m_charRefFunctor); |
| 00298 } |
| 00299 |
| 00300 <font class="keywordtype">void</font> |
| <a name="l00301"></a><a class="code" href="classXalanOtherEncodingWriter.html#a11">00301</a> <a class="code" href="classXalanOtherEncodingWriter.html#a11">writeSafe</a>( |
| 00302 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00303 size_type theLength)<font class="keyword"></font> |
| 00304 <font class="keyword"> </font>{ |
| 00305 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00306 { |
| 00307 <font class="keyword">const</font> XalanDOMChar ch = theChars[i]; |
| 00308 |
| 00309 <font class="keywordflow">if</font> (isUTF16HighSurrogate(ch) == <font class="keyword">true</font>) |
| 00310 { |
| 00311 <font class="keywordflow">if</font> (i + 1 >= theLength) |
| 00312 { |
| 00313 throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager()); |
| 00314 } |
| 00315 <font class="keywordflow">else</font> |
| 00316 { |
| 00317 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> value = decodeUTF16SurrogatePair(ch, theChars[i+1], getMemoryManager()); |
| 00318 |
| 00319 <font class="keywordflow">if</font>(this->m_isPresentable(value)) |
| 00320 { |
| 00321 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(value); |
| 00322 } |
| 00323 <font class="keywordflow">else</font> |
| 00324 { |
| 00325 this->writeNumberedEntityReference(value); |
| 00326 } |
| 00327 |
| 00328 ++i; |
| 00329 } |
| 00330 } |
| 00331 <font class="keywordflow">else</font> |
| 00332 { |
| 00333 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>((<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>)ch); |
| 00334 } |
| 00335 } |
| 00336 } |
| 00337 |
| 00338 <font class="keywordtype">void</font> |
| <a name="l00339"></a><a class="code" href="classXalanOtherEncodingWriter.html#a12">00339</a> <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(<font class="keyword">const</font> XalanDOMChar* theChars)<font class="keyword"></font> |
| 00340 <font class="keyword"> </font>{ |
| 00341 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(theChars, XalanDOMString::length(theChars)); |
| 00342 } |
| 00343 |
| 00344 <font class="keywordtype">void</font> |
| <a name="l00345"></a><a class="code" href="classXalanOtherEncodingWriter.html#a13">00345</a> <a class="code" href="classXalanOtherEncodingWriter.html#a13">flushWriter</a>()<font class="keyword"></font> |
| 00346 <font class="keyword"> </font>{ |
| 00347 m_writer.flush(); |
| 00348 } |
| 00349 |
| 00350 <font class="keywordtype">void</font> |
| <a name="l00351"></a><a class="code" href="classXalanOtherEncodingWriter.html#a14">00351</a> <a class="code" href="classXalanOtherEncodingWriter.html#a14">flushBuffer</a>()<font class="keyword"></font> |
| 00352 <font class="keyword"> </font>{ |
| 00353 m_writer.write(m_buffer, 0, m_bufferPosition - m_buffer); |
| 00354 |
| 00355 m_bufferPosition = m_buffer; |
| 00356 m_bufferRemaining = kBufferSize; |
| 00357 } |
| 00358 |
| 00359 <font class="keyword">private</font>: |
| 00360 |
| 00374 |
| 00375 template <class TranscodingFailureFunctor> |
| 00376 size_type |
| 00377 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>( |
| 00378 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00379 size_type start, |
| 00380 size_type length, |
| 00381 TranscodingFailureFunctor& failureHandler)<font class="keyword"></font> |
| 00382 <font class="keyword"> </font>{ |
| 00383 assert(chars != 0 && length > 0); |
| 00384 assert(start <= length); |
| 00385 |
| 00386 size_type result = start; |
| 00387 |
| 00388 <font class="keyword">const</font> XalanDOMChar ch = chars[start]; |
| 00389 |
| 00390 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> value = ch; |
| 00391 |
| 00392 <font class="keywordflow">if</font> (XalanFormatterWriter::isUTF16HighSurrogate(ch) == <font class="keyword">true</font>) |
| 00393 { |
| 00394 <font class="keywordflow">if</font> (start + 1 >= length) |
| 00395 { |
| 00396 throwInvalidUTF16SurrogateException( |
| 00397 ch, |
| 00398 0, |
| 00399 getMemoryManager()); |
| 00400 } |
| 00401 <font class="keywordflow">else</font> |
| 00402 { |
| 00403 value = decodeUTF16SurrogatePair(ch, chars[start+1], getMemoryManager()); |
| 00404 |
| 00405 ++result; |
| 00406 } |
| 00407 } |
| 00408 |
| 00409 <font class="keywordflow">if</font>(m_predicate(value)) |
| 00410 { |
| 00411 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(value); |
| 00412 } |
| 00413 <font class="keywordflow">else</font> |
| 00414 { |
| 00415 failureHandler(value); |
| 00416 } |
| 00417 |
| 00418 <font class="keywordflow">return</font> result; |
| 00419 } |
| 00420 |
| 00427 <font class="keywordtype">void</font> |
| 00428 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00429 <font class="keyword"> </font>{ |
| 00430 <font class="comment">// encode back UTF-32 into UTF-16 </font> |
| 00431 |
| 00432 <font class="keywordflow">if</font>( theChar > 0xFFFF ) |
| 00433 { |
| 00434 <font class="keywordflow">if</font> (m_bufferRemaining < 2) |
| 00435 { |
| 00436 <a class="code" href="classXalanOtherEncodingWriter.html#a14">flushBuffer</a>(); |
| 00437 } |
| 00438 |
| 00439 *m_bufferPosition = (XalanDOMChar((theChar >> 10) + 0xD7C0)); |
| 00440 |
| 00441 ++m_bufferPosition; |
| 00442 |
| 00443 *m_bufferPosition = (XalanDOMChar((theChar & 0x03FF) + 0xDC00)); |
| 00444 |
| 00445 ++m_bufferPosition; |
| 00446 |
| 00447 m_bufferRemaining = m_bufferRemaining - <a class="code" href="XalanMap_8hpp.html#a1">size_type</a>(2); |
| 00448 } |
| 00449 <font class="keywordflow">else</font> |
| 00450 { |
| 00451 <font class="keywordflow">if</font> (m_bufferRemaining == 0) |
| 00452 { |
| 00453 <a class="code" href="classXalanOtherEncodingWriter.html#a14">flushBuffer</a>(); |
| 00454 } |
| 00455 |
| 00456 *m_bufferPosition = XalanDOMChar(theChar); |
| 00457 |
| 00458 ++m_bufferPosition; |
| 00459 --m_bufferRemaining; |
| 00460 } |
| 00461 } |
| 00462 |
| 00463 <font class="keywordtype">void</font> |
| 00464 writeNumericCharacterReference(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theNumber)<font class="keyword"></font> |
| 00465 <font class="keyword"> </font>{ |
| 00466 <a class="code" href="classXalanOtherEncodingWriter.html#a7">write</a>(formatNumericCharacterReference(theNumber)); |
| 00467 } |
| 00468 |
| 00469 <font class="keyword">enum</font> |
| 00470 { |
| 00471 kBufferSize = 512u <font class="comment">// The size of the buffer</font> |
| 00472 }; |
| 00473 |
| 00474 |
| 00475 <font class="comment">// Data members...</font> |
| 00476 XalanDOMChar m_buffer[kBufferSize]; |
| 00477 |
| 00478 XalanDOMChar* m_bufferPosition; |
| 00479 |
| 00480 size_type m_bufferRemaining; |
| 00481 |
| 00482 <font class="keyword">const</font> Predicate m_predicate; |
| 00483 |
| 00484 <font class="keyword">const</font> ConstantsType m_constants; |
| 00485 |
| 00486 <font class="keyword">const</font> WriteCharRef m_charRefFunctor; |
| 00487 |
| 00488 <font class="keyword">const</font> ThrowTranscodingException m_exceptionFunctor; |
| 00489 }; |
| 00490 |
| 00491 |
| 00492 |
| 00493 XALAN_CPP_NAMESPACE_END |
| 00494 |
| 00495 |
| 00496 |
| 00497 <font class="preprocessor">#endif // XALANUNICODESUBSETWRITER_HEADER_GUARD_1357924680</font> |
| </font></pre></div><p align="center"><a href="diagramnotes.html">Interpreting class diagrams</a></p>
|
| <p><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
| <i><A href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> and
|
| <A href="http://www.research.att.com/sw/tools/graphviz/">GraphViz</A> are used to generate this API documentation from the Xalan-C header files.</I></FONT></p>
|
|
|
| <TABLE border="0" cellpadding="0" cellspacing="0" width="820"><TR><TD bgcolor="#0086b2"><IMG height="1" src="../resources/dot.gif" width="1" alt="dot"></TD></TR></TABLE>
|
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
|
| <TR>
|
| <TD WIDTH="80%" VALIGN="TOP">
|
| <P ALIGN="CENTER"><B>Xalan-C++ XSLT Processor Version 1.10</B><BR>
|
| Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.</i></p>
|
| </TD>
|
| </TR>
|
| <TR>
|
| <TD WIDTH="100%">
|
| <P ALIGN="CENTER"><IMG SRC="ApacheLogo.jpg" WIDTH="387" HEIGHT="100" ALIGN="BOTTOM" BORDER="0" ALT="Apache Logo">
|
| </TD>
|
| </TR>
|
| </TABLE>
|