| <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>XalanUTF8Writer.hpp</h1><a href="XalanUTF8Writer_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(XALANUTF8WRITER_HEADER_GUARD_1357924680)</font> |
| <a name="l00017"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XALANUTF8WRITER_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 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00029"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a1">00029</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a1">bits19to21</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00030 <font class="keyword"></font>{ |
| 00031 <font class="keywordflow">return</font> char((theChar >> 18) & 0x7); |
| 00032 } |
| 00033 |
| 00034 |
| 00035 |
| 00036 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00037"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a2">00037</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a2">bits13to18</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00038 <font class="keyword"></font>{ |
| 00039 <font class="keywordflow">return</font> char((theChar >> 12) & 0x3F); |
| 00040 } |
| 00041 |
| 00042 |
| 00043 |
| 00044 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00045"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a3">00045</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a3">bits13to16</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00046 <font class="keyword"></font>{ |
| 00047 <font class="keywordflow">return</font> char((theChar >> 12) & 0xF); |
| 00048 } |
| 00049 |
| 00050 |
| 00051 |
| 00052 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00053"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a4">00053</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a4">bits7to12</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00054 <font class="keyword"></font>{ |
| 00055 <font class="keywordflow">return</font> char((theChar >> 6) & 0x3f); |
| 00056 } |
| 00057 |
| 00058 |
| 00059 |
| 00060 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00061"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a5">00061</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a5">bits7to11</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00062 <font class="keyword"></font>{ |
| 00063 <font class="keywordflow">return</font> char((theChar >> 6) & 0x1f); |
| 00064 } |
| 00065 |
| 00066 |
| 00067 |
| 00068 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00069"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a6">00069</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a6">bits1to6</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00070 <font class="keyword"></font>{ |
| 00071 <font class="keywordflow">return</font> char(theChar & 0x3f); |
| 00072 } |
| 00073 |
| 00074 |
| 00075 |
| 00076 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00077"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a7">00077</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a7">leadingByteOf2</a>(<font class="keywordtype">char</font> theBits)<font class="keyword"></font> |
| 00078 <font class="keyword"></font>{ |
| 00079 <font class="keywordflow">return</font> char(0xC0 + theBits); |
| 00080 } |
| 00081 |
| 00082 |
| 00083 |
| 00084 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00085"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a8">00085</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a8">leadingByteOf3</a>(<font class="keywordtype">char</font> theBits)<font class="keyword"></font> |
| 00086 <font class="keyword"></font>{ |
| 00087 <font class="keywordflow">return</font> char(0xE0 + theBits); |
| 00088 } |
| 00089 |
| 00090 |
| 00091 |
| 00092 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00093"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a9">00093</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a9">leadingByteOf4</a>(<font class="keywordtype">char</font> theBits)<font class="keyword"></font> |
| 00094 <font class="keyword"></font>{ |
| 00095 <font class="keywordflow">return</font> char(0xF0 + theBits); |
| 00096 } |
| 00097 |
| 00098 |
| 00099 |
| 00100 <font class="keyword">inline</font> <font class="keywordtype">char</font> |
| <a name="l00101"></a><a class="code" href="XalanUTF8Writer_8hpp.html#a10">00101</a> <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<font class="keywordtype">char</font> theBits)<font class="keyword"></font> |
| 00102 <font class="keyword"></font>{ |
| 00103 <font class="keywordflow">return</font> char(0x80 + theBits); |
| 00104 } |
| 00105 |
| 00106 |
| 00107 |
| <a name="l00108"></a><a class="code" href="classXalanUTF8Writer.html">00108</a> <font class="keyword">class </font><a class="code" href="classXalanUTF8Writer.html">XalanUTF8Writer</a> : <font class="keyword">public</font> <a class="code" href="classXalanFormatterWriter.html">XalanFormatterWriter</a> |
| 00109 { |
| 00110 <font class="keyword">public</font>: |
| 00111 |
| <a name="l00112"></a><a class="code" href="classXalanUTF8Writer.html#s0">00112</a> <font class="keyword">typedef</font> <font class="keywordtype">char</font> value_type; |
| 00113 |
| 00114 |
| 00115 <a class="code" href="classXalanUTF8Writer.html#a0">XalanUTF8Writer</a>( |
| 00116 <a class="code" href="classWriter.html">Writer</a>& writer, |
| 00117 MemoryManager& theMemoryManager); |
| 00118 |
| 00119 <font class="keyword">virtual</font> |
| <a name="l00120"></a><a class="code" href="classXalanUTF8Writer.html#a1">00120</a> <a class="code" href="classXalanUTF8Writer.html#a1">~XalanUTF8Writer</a>()<font class="keyword"></font> |
| 00121 <font class="keyword"> </font>{ |
| 00122 } |
| 00123 |
| 00127 <font class="keywordtype">void</font> |
| <a name="l00128"></a><a class="code" href="classXalanUTF8Writer.html#a2">00128</a> <a class="code" href="classXalanUTF8Writer.html#a2">outputNewline</a>()<font class="keyword"></font> |
| 00129 <font class="keyword"> </font>{ |
| 00130 assert(m_newlineString != 0); |
| 00131 assert(<a class="code" href="DOMStringHelper_8hpp.html#a14">length</a>(m_newlineString) == m_newlineStringLength); |
| 00132 |
| 00133 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>( |
| 00134 m_newlineString, |
| 00135 m_newlineStringLength); |
| 00136 } |
| 00137 |
| 00138 size_type |
| <a name="l00139"></a><a class="code" href="classXalanUTF8Writer.html#a3">00139</a> <a class="code" href="classXalanUTF8Writer.html#a3">writeCDATAChar</a>( |
| 00140 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00141 size_type start, |
| 00142 size_type length, |
| 00143 <font class="keywordtype">bool</font>& <font class="comment">/* outsideCDATA */</font>)<font class="keyword"></font> |
| 00144 <font class="keyword"> </font>{ |
| 00145 assert(chars != 0 && length != 0 && start < length); |
| 00146 |
| 00147 <font class="keywordflow">return</font> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(chars, start, length); |
| 00148 } |
| 00149 |
| <a name="l00153"></a><a class="code" href="classXalanUTF8Writer.html#a4">00153</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF8Writer.html#a4">writeNameChar</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00154 size_type theLength)<font class="keyword"></font> |
| 00155 <font class="keyword"> </font>{ |
| 00156 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(data, theLength); |
| 00157 } |
| 00158 |
| <a name="l00162"></a><a class="code" href="classXalanUTF8Writer.html#a5">00162</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF8Writer.html#a5">writePIChars</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00163 size_type theLength)<font class="keyword"></font> |
| 00164 <font class="keyword"> </font>{ |
| 00165 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(data, theLength); |
| 00166 } |
| 00167 |
| <a name="l00171"></a><a class="code" href="classXalanUTF8Writer.html#a6">00171</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF8Writer.html#a6">writeCommentChars</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00172 size_type theLength)<font class="keyword"></font> |
| 00173 <font class="keyword"> </font>{ |
| 00174 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(data, theLength); |
| 00175 } |
| 00176 |
| 00177 <font class="keywordtype">void</font> |
| <a name="l00178"></a><a class="code" href="classXalanUTF8Writer.html#a7">00178</a> <a class="code" href="classXalanUTF8Writer.html#a7">safeWriteContent</a>( |
| 00179 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00180 XalanDOMString::size_type theLength)<font class="keyword"></font> |
| 00181 <font class="keyword"> </font>{ |
| 00182 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00183 { |
| 00184 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<a class="code" href="classXalanUTF8Writer.html#s0">value_type</a>(theChars[i])); |
| 00185 } |
| 00186 } |
| 00187 |
| 00188 <font class="keywordtype">void</font> |
| <a name="l00189"></a><a class="code" href="classXalanUTF8Writer.html#a8">00189</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>( |
| 00190 <font class="keyword">const</font> value_type* theChars, |
| 00191 XalanDOMString::size_type theLength)<font class="keyword"></font> |
| 00192 <font class="keyword"> </font>{ |
| 00193 <font class="preprocessor"> #if defined(NDEBUG)</font> |
| 00194 <font class="preprocessor"></font> <font class="keywordflow">if</font> (theLength > <font class="keyword">sizeof</font>(m_buffer)) |
| 00195 { |
| 00196 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00197 |
| 00198 m_writer.write(theChars, 0, theLength); |
| 00199 } |
| 00200 <font class="keywordflow">else</font> |
| 00201 { |
| 00202 <font class="keywordflow">if</font> (m_bufferRemaining < theLength) |
| 00203 { |
| 00204 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00205 } |
| 00206 |
| 00207 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00208 { |
| 00209 *m_bufferPosition = theChars[i]; |
| 00210 |
| 00211 ++m_bufferPosition; |
| 00212 } |
| 00213 |
| 00214 m_bufferRemaining -= theLength; |
| 00215 } |
| 00216 <font class="preprocessor"> #else</font> |
| 00217 <font class="preprocessor"></font> <font class="keywordflow">for</font>(XalanDOMString::size_type i = 0; i < theLength; ++i) |
| 00218 { |
| 00219 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(theChars[i]); |
| 00220 } |
| 00221 <font class="preprocessor"> #endif</font> |
| 00222 <font class="preprocessor"></font> } |
| 00223 |
| 00224 <font class="keywordtype">void</font> |
| <a name="l00225"></a><a class="code" href="classXalanUTF8Writer.html#a9">00225</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<font class="keyword">const</font> XalanDOMChar* theChars)<font class="keyword"></font> |
| 00226 <font class="keyword"> </font>{ |
| 00227 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(theChars, XalanDOMString::length(theChars)); |
| 00228 } |
| 00229 |
| 00230 <font class="keywordtype">void</font> |
| <a name="l00231"></a><a class="code" href="classXalanUTF8Writer.html#a10">00231</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>& theChars)<font class="keyword"></font> |
| 00232 <font class="keyword"> </font>{ |
| 00233 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(theChars.<a class="code" href="classXalanDOMString.html#a33">c_str</a>(), theChars.<a class="code" href="classXalanDOMString.html#a20">length</a>()); |
| 00234 } |
| 00235 |
| 00236 <font class="keywordtype">void</font> |
| <a name="l00237"></a><a class="code" href="classXalanUTF8Writer.html#a11">00237</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(value_type theChar)<font class="keyword"></font> |
| 00238 <font class="keyword"> </font>{ |
| 00239 assert(theChar < 128); |
| 00240 |
| 00241 <font class="keywordflow">if</font> (m_bufferRemaining == 0) |
| 00242 { |
| 00243 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00244 } |
| 00245 |
| 00246 *m_bufferPosition = theChar; |
| 00247 |
| 00248 ++m_bufferPosition; |
| 00249 --m_bufferRemaining; |
| 00250 } |
| 00251 |
| 00252 <font class="keywordtype">void</font> |
| <a name="l00253"></a><a class="code" href="classXalanUTF8Writer.html#a12">00253</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>( |
| 00254 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00255 XalanDOMString::size_type theLength)<font class="keyword"></font> |
| 00256 <font class="keyword"> </font>{ |
| 00257 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00258 { |
| 00259 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>((<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>)theChars[i]); |
| 00260 } |
| 00261 } |
| 00262 |
| 00263 size_type |
| <a name="l00264"></a><a class="code" href="classXalanUTF8Writer.html#a13">00264</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>( |
| 00265 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00266 XalanDOMString::size_type start, |
| 00267 XalanDOMString::size_type length)<font class="keyword"></font> |
| 00268 <font class="keyword"> </font>{ |
| 00269 XalanDOMChar ch = chars[start]; |
| 00270 |
| 00271 <font class="keywordflow">if</font> (XalanFormatterWriter::isUTF16HighSurrogate(ch) == <font class="keyword">false</font>) |
| 00272 { |
| 00273 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>((<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>)ch); |
| 00274 } |
| 00275 <font class="keywordflow">else</font> |
| 00276 { |
| 00277 <font class="keywordflow">if</font> (start + 1 >= length) |
| 00278 { |
| 00279 XalanFormatterWriter::throwInvalidUTF16SurrogateException( |
| 00280 ch, |
| 00281 0, |
| 00282 getMemoryManager()); |
| 00283 } |
| 00284 <font class="keywordflow">else</font> |
| 00285 { |
| 00286 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>( |
| 00287 XalanFormatterWriter::decodeUTF16SurrogatePair( |
| 00288 ch, |
| 00289 chars[++start], |
| 00290 getMemoryManager())); |
| 00291 } |
| 00292 } |
| 00293 |
| 00294 <font class="keywordflow">return</font> start; |
| 00295 } |
| 00296 |
| 00297 <font class="keywordtype">void</font> |
| <a name="l00298"></a><a class="code" href="classXalanUTF8Writer.html#a14">00298</a> <a class="code" href="classXalanUTF8Writer.html#a14">writeSafe</a>( |
| 00299 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00300 XalanDOMString::size_type theLength)<font class="keyword"></font> |
| 00301 <font class="keyword"> </font>{ |
| 00302 XalanDOMChar ch = 0; |
| 00303 |
| 00304 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00305 { |
| 00306 ch = theChars[i]; |
| 00307 |
| 00308 <font class="keywordflow">if</font> (XalanFormatterWriter::isUTF16HighSurrogate(ch) == <font class="keyword">true</font>) |
| 00309 { |
| 00310 <font class="keywordflow">if</font> (i + 1 >= theLength) |
| 00311 { |
| 00312 XalanFormatterWriter::throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager()); |
| 00313 } |
| 00314 <font class="keywordflow">else</font> |
| 00315 { |
| 00316 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(XalanFormatterWriter::decodeUTF16SurrogatePair(ch, theChars[i+1], getMemoryManager())); |
| 00317 |
| 00318 ++i; |
| 00319 } |
| 00320 } |
| 00321 <font class="keywordflow">else</font> |
| 00322 { |
| 00323 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>((<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>)ch); |
| 00324 } |
| 00325 } |
| 00326 |
| 00327 } |
| 00328 |
| 00329 <font class="keywordtype">void</font> |
| <a name="l00330"></a><a class="code" href="classXalanUTF8Writer.html#a15">00330</a> <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<font class="keyword">const</font> value_type* theChars)<font class="keyword"></font> |
| 00331 <font class="keyword"> </font>{ |
| 00332 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(theChars, XalanDOMString::length(theChars)); |
| 00333 } |
| 00334 |
| 00335 <font class="keywordtype">void</font> |
| <a name="l00336"></a><a class="code" href="classXalanUTF8Writer.html#a16">00336</a> <a class="code" href="classXalanUTF8Writer.html#a16">flushWriter</a>()<font class="keyword"></font> |
| 00337 <font class="keyword"> </font>{ |
| 00338 m_writer.flush(); |
| 00339 } |
| 00340 |
| 00341 <font class="keywordtype">void</font> |
| <a name="l00342"></a><a class="code" href="classXalanUTF8Writer.html#a17">00342</a> <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>()<font class="keyword"></font> |
| 00343 <font class="keyword"> </font>{ |
| 00344 m_writer.write(m_buffer, 0, m_bufferPosition - m_buffer); |
| 00345 |
| 00346 m_bufferPosition = m_buffer; |
| 00347 m_bufferRemaining = kBufferSize; |
| 00348 } |
| 00349 |
| 00350 <font class="keyword">private</font>: |
| 00351 |
| 00352 <font class="keywordtype">void</font> |
| 00353 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> theChar)<font class="keyword"></font> |
| 00354 <font class="keyword"> </font>{ |
| 00355 <font class="keywordflow">if</font> (theChar <= 0x7F) |
| 00356 { |
| 00357 <a class="code" href="classXalanUTF8Writer.html#a8">write</a>(<font class="keywordtype">char</font>(theChar)); |
| 00358 } |
| 00359 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (theChar <= 0x7FF) |
| 00360 { |
| 00361 <font class="keywordflow">if</font> (m_bufferRemaining < 2) |
| 00362 { |
| 00363 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00364 } |
| 00365 |
| 00366 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a7">leadingByteOf2</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a5">bits7to11</a>(theChar)); |
| 00367 ++m_bufferPosition; |
| 00368 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a6">bits1to6</a>(theChar)); |
| 00369 ++m_bufferPosition; |
| 00370 |
| 00371 m_bufferRemaining -= 2; |
| 00372 } |
| 00373 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (theChar <= 0xFFFF) |
| 00374 { |
| 00375 <font class="comment">// We should never get a high or low surrogate here...</font> |
| 00376 assert(theChar < 0xD800 || theChar > 0xDBFF); |
| 00377 assert(theChar < 0xDC00 || theChar > 0xDFFF); |
| 00378 |
| 00379 <font class="keywordflow">if</font> (m_bufferRemaining < 3) |
| 00380 { |
| 00381 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00382 } |
| 00383 |
| 00384 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a8">leadingByteOf3</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a3">bits13to16</a>(theChar)); |
| 00385 ++m_bufferPosition; |
| 00386 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a4">bits7to12</a>(theChar)); |
| 00387 ++m_bufferPosition; |
| 00388 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a6">bits1to6</a>(theChar)); |
| 00389 ++m_bufferPosition; |
| 00390 |
| 00391 m_bufferRemaining -= 3; |
| 00392 } |
| 00393 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (theChar <= 0x10FFFF) |
| 00394 { |
| 00395 <font class="keywordflow">if</font> (m_bufferRemaining < 4) |
| 00396 { |
| 00397 <a class="code" href="classXalanUTF8Writer.html#a17">flushBuffer</a>(); |
| 00398 } |
| 00399 |
| 00400 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a9">leadingByteOf4</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a1">bits19to21</a>(theChar)); |
| 00401 ++m_bufferPosition; |
| 00402 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a2">bits13to18</a>(theChar)); |
| 00403 ++m_bufferPosition; |
| 00404 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a4">bits7to12</a>(theChar)); |
| 00405 ++m_bufferPosition; |
| 00406 *m_bufferPosition = <a class="code" href="XalanUTF8Writer_8hpp.html#a10">trailingByte</a>(<a class="code" href="XalanUTF8Writer_8hpp.html#a6">bits1to6</a>(theChar)); |
| 00407 ++m_bufferPosition; |
| 00408 |
| 00409 m_bufferRemaining -= 4; |
| 00410 } |
| 00411 <font class="keywordflow">else</font> |
| 00412 { |
| 00413 XalanFormatterWriter::throwInvalidCharacterException(theChar, getMemoryManager()); |
| 00414 } |
| 00415 } |
| 00416 |
| 00417 <font class="keyword">enum</font> |
| 00418 { |
| 00419 kBufferSize = 512 <font class="comment">// The size of the buffer</font> |
| 00420 }; |
| 00421 |
| 00422 |
| 00423 <font class="comment">// Data members...</font> |
| 00424 value_type m_buffer[kBufferSize]; |
| 00425 |
| 00426 value_type* m_bufferPosition; |
| 00427 |
| 00428 XalanDOMString::size_type m_bufferRemaining; |
| 00429 }; |
| 00430 |
| 00431 |
| 00432 |
| 00433 XALAN_CPP_NAMESPACE_END |
| 00434 |
| 00435 |
| 00436 |
| 00437 <font class="preprocessor">#endif // XALANUTF8WRITER_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>
|