| <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>XalanUTF16Writer.hpp</h1><a href="XalanUTF16Writer_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(XALANUTF16WRITER_HEADER_GUARD_1357924680)</font> |
| <a name="l00017"></a><a class="code" href="XalanUTF16Writer_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XALANUTF16WRITER_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 XALAN_CPP_NAMESPACE_BEGIN |
| 00024 |
| 00025 |
| <a name="l00026"></a><a class="code" href="classXalanUTF16Writer.html">00026</a> <font class="keyword">class </font><a class="code" href="classXalanUTF16Writer.html">XalanUTF16Writer</a> : <font class="keyword">public</font> <a class="code" href="classXalanFormatterWriter.html">XalanFormatterWriter</a> |
| 00027 { |
| 00028 <font class="keyword">public</font>: |
| 00029 |
| <a name="l00030"></a><a class="code" href="classXalanUTF16Writer.html#s0">00030</a> <font class="keyword">typedef</font> XalanDOMChar value_type; |
| 00031 |
| 00032 |
| 00033 <a class="code" href="classXalanUTF16Writer.html#a0">XalanUTF16Writer</a>( |
| 00034 <a class="code" href="classWriter.html">Writer</a>& writer, |
| 00035 MemoryManager& theMemoryManager); |
| 00036 |
| 00037 <font class="keyword">virtual</font> |
| <a name="l00038"></a><a class="code" href="classXalanUTF16Writer.html#a1">00038</a> <a class="code" href="classXalanUTF16Writer.html#a1">~XalanUTF16Writer</a>()<font class="keyword"></font> |
| 00039 <font class="keyword"> </font>{ |
| 00040 } |
| 00041 |
| 00045 <font class="keywordtype">void</font> |
| <a name="l00046"></a><a class="code" href="classXalanUTF16Writer.html#a2">00046</a> <a class="code" href="classXalanUTF16Writer.html#a2">outputNewline</a>()<font class="keyword"></font> |
| 00047 <font class="keyword"> </font>{ |
| 00048 assert(m_newlineString != 0); |
| 00049 assert(<a class="code" href="DOMStringHelper_8hpp.html#a14">length</a>(m_newlineString) == m_newlineStringLength); |
| 00050 |
| 00051 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>( |
| 00052 m_newlineString, |
| 00053 m_newlineStringLength); |
| 00054 } |
| 00055 |
| 00056 |
| 00057 size_type |
| <a name="l00058"></a><a class="code" href="classXalanUTF16Writer.html#a3">00058</a> <a class="code" href="classXalanUTF16Writer.html#a3">writeCDATAChar</a>( |
| 00059 <font class="keyword">const</font> XalanDOMChar chars[], |
| 00060 size_type start, |
| 00061 size_type <font class="comment">/*length*/</font>, |
| 00062 <font class="keywordtype">bool</font>& <font class="comment">/* outsideCDATA */</font>)<font class="keyword"></font> |
| 00063 <font class="keyword"> </font>{ |
| 00064 assert( chars != 0 ); |
| 00065 |
| 00066 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(chars[start]); |
| 00067 |
| 00068 <font class="keywordflow">return</font> start; |
| 00069 } |
| 00070 |
| <a name="l00074"></a><a class="code" href="classXalanUTF16Writer.html#a4">00074</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF16Writer.html#a4">writeNameChar</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00075 size_type theLength)<font class="keyword"></font> |
| 00076 <font class="keyword"> </font>{ |
| 00077 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(data, theLength); |
| 00078 } |
| 00079 |
| <a name="l00083"></a><a class="code" href="classXalanUTF16Writer.html#a5">00083</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF16Writer.html#a5">writePIChars</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00084 size_type theLength)<font class="keyword"></font> |
| 00085 <font class="keyword"> </font>{ |
| 00086 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(data, theLength); |
| 00087 } |
| 00088 |
| <a name="l00092"></a><a class="code" href="classXalanUTF16Writer.html#a6">00092</a> <font class="keywordtype">void</font> <a class="code" href="classXalanUTF16Writer.html#a6">writeCommentChars</a>(<font class="keyword">const</font> XalanDOMChar* data, |
| 00093 size_type theLength)<font class="keyword"></font> |
| 00094 <font class="keyword"> </font>{ |
| 00095 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(data, theLength); |
| 00096 } |
| 00097 |
| 00098 <font class="keywordtype">void</font> |
| <a name="l00099"></a><a class="code" href="classXalanUTF16Writer.html#a7">00099</a> <a class="code" href="classXalanUTF16Writer.html#a7">safeWriteContent</a>( |
| 00100 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00101 size_type theLength)<font class="keyword"></font> |
| 00102 <font class="keyword"> </font>{ |
| 00103 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(theChars, theLength); |
| 00104 } |
| 00105 |
| 00106 <font class="keywordtype">void</font> |
| <a name="l00107"></a><a class="code" href="classXalanUTF16Writer.html#a8">00107</a> <a class="code" href="classXalanUTF16Writer.html#a8">write</a>( |
| 00108 <font class="keyword">const</font> value_type* theChars, |
| 00109 size_type theLength)<font class="keyword"></font> |
| 00110 <font class="keyword"> </font>{ |
| 00111 <font class="keywordflow">if</font> (theLength > <font class="keyword">sizeof</font>(m_buffer)) |
| 00112 { |
| 00113 <a class="code" href="classXalanUTF16Writer.html#a14">flushBuffer</a>(); |
| 00114 |
| 00115 m_writer.write(theChars, 0, theLength); |
| 00116 } |
| 00117 <font class="keywordflow">else</font> |
| 00118 { |
| 00119 <font class="keywordflow">if</font> (m_bufferRemaining < theLength) |
| 00120 { |
| 00121 <a class="code" href="classXalanUTF16Writer.html#a14">flushBuffer</a>(); |
| 00122 } |
| 00123 |
| 00124 <font class="keywordflow">for</font>(size_type i = 0; i < theLength; ++i) |
| 00125 { |
| 00126 *m_bufferPosition = theChars[i]; |
| 00127 |
| 00128 ++m_bufferPosition; |
| 00129 } |
| 00130 |
| 00131 m_bufferRemaining -= theLength; |
| 00132 } |
| 00133 |
| 00134 } |
| 00135 |
| 00136 <font class="keywordtype">void</font> |
| <a name="l00137"></a><a class="code" href="classXalanUTF16Writer.html#a9">00137</a> <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(<font class="keyword">const</font> <a class="code" href="classXalanDOMString.html">XalanDOMString</a>& theChars)<font class="keyword"></font> |
| 00138 <font class="keyword"> </font>{ |
| 00139 <a class="code" href="classXalanUTF16Writer.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>()); |
| 00140 } |
| 00141 |
| 00142 <font class="keywordtype">void</font> |
| <a name="l00143"></a><a class="code" href="classXalanUTF16Writer.html#a10">00143</a> <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(value_type theChar)<font class="keyword"></font> |
| 00144 <font class="keyword"> </font>{ |
| 00145 |
| 00146 <font class="keywordflow">if</font> (m_bufferRemaining == 0) |
| 00147 { |
| 00148 <a class="code" href="classXalanUTF16Writer.html#a14">flushBuffer</a>(); |
| 00149 } |
| 00150 |
| 00151 *m_bufferPosition = theChar; |
| 00152 |
| 00153 ++m_bufferPosition; |
| 00154 --m_bufferRemaining; |
| 00155 } |
| 00156 |
| 00157 |
| 00158 size_type |
| <a name="l00159"></a><a class="code" href="classXalanUTF16Writer.html#a11">00159</a> <a class="code" href="classXalanUTF16Writer.html#a8">write</a>( |
| 00160 <font class="keyword">const</font> value_type chars[], |
| 00161 size_type start, |
| 00162 size_type <font class="comment">/*length*/</font>)<font class="keyword"></font> |
| 00163 <font class="keyword"> </font>{ |
| 00164 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(chars[start]); |
| 00165 |
| 00166 <font class="keywordflow">return</font> start; |
| 00167 } |
| 00168 |
| 00169 <font class="keywordtype">void</font> |
| <a name="l00170"></a><a class="code" href="classXalanUTF16Writer.html#a12">00170</a> <a class="code" href="classXalanUTF16Writer.html#a12">writeSafe</a>( |
| 00171 <font class="keyword">const</font> XalanDOMChar* theChars, |
| 00172 size_type theLength)<font class="keyword"></font> |
| 00173 <font class="keyword"> </font>{ |
| 00174 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(theChars, theLength); |
| 00175 } |
| 00176 |
| 00177 <font class="keywordtype">void</font> |
| <a name="l00178"></a><a class="code" href="classXalanUTF16Writer.html#a13">00178</a> <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(<font class="keyword">const</font> value_type* theChars)<font class="keyword"></font> |
| 00179 <font class="keyword"> </font>{ |
| 00180 <a class="code" href="classXalanUTF16Writer.html#a8">write</a>(theChars, XalanDOMString::length(theChars)); |
| 00181 } |
| 00182 |
| 00183 <font class="keywordtype">void</font> |
| <a name="l00184"></a><a class="code" href="classXalanUTF16Writer.html#a14">00184</a> <a class="code" href="classXalanUTF16Writer.html#a14">flushBuffer</a>()<font class="keyword"></font> |
| 00185 <font class="keyword"> </font>{ |
| 00186 m_writer.write( |
| 00187 reinterpret_cast<const char*>(m_buffer), |
| 00188 0, |
| 00189 (m_bufferPosition - m_buffer) * <font class="keyword">sizeof</font> m_buffer[0]); |
| 00190 |
| 00191 |
| 00192 m_bufferPosition = m_buffer; |
| 00193 m_bufferRemaining = kBufferSize; |
| 00194 } |
| 00195 |
| 00196 |
| 00197 <font class="keyword">private</font>: |
| 00198 |
| 00199 <font class="keyword">enum</font> |
| 00200 { |
| 00201 kBufferSize = 512 <font class="comment">// The size of the buffer</font> |
| 00202 }; |
| 00203 |
| 00204 |
| 00205 <font class="comment">// Data members...</font> |
| 00206 value_type m_buffer[kBufferSize]; |
| 00207 |
| 00208 value_type* m_bufferPosition; |
| 00209 |
| 00210 size_type m_bufferRemaining; |
| 00211 }; |
| 00212 |
| 00213 |
| 00214 |
| 00215 XALAN_CPP_NAMESPACE_END |
| 00216 |
| 00217 |
| 00218 |
| 00219 <font class="preprocessor">#endif // XALANUTF16WRITER_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>
|