16 #if !defined(XALANFORMATTERWRITER_HEADER_GUARD_1357924680)
17 #define XALANFORMATTERWRITER_HEADER_GUARD_1357924680
24 #include <xercesc/sax/SAXException.hpp>
33 XALAN_CPP_NAMESPACE_BEGIN
37 XALAN_USING_XERCES(MemoryManager)
45 template <
class WriterType>
55 m_newlineStringLength(0)
68 assert(m_newlineString != 0);
70 m_newlineStringLength =
length(m_newlineString);
76 assert(m_newlineString != 0 &&
length(m_newlineString) == m_newlineStringLength);
78 m_writer.write(m_newlineString, m_newlineStringLength);
88 const XalanDOMChar* m_newlineString;
96 template<
class WriterType>
100 typedef typename WriterType::value_type value_type;
112 for ( size_type i = 0 ; i < count ; i++ )
120 WriterType& m_writer;
140 result = m_stream->canTranscodeTo(theChar);
158 MemoryManager& theMemoryManager) :
160 m_memoryManager(theMemoryManager),
161 m_stringBuffer(5, 0, theMemoryManager)
175 assert(m_newlineString != 0);
177 m_newlineStringLength =
length(m_newlineString);
179 assert(m_newlineString != 0);
185 return m_memoryManager;
202 return m_writer.getStream();
208 return m_writer.getStream();
221 return 0xD800u <= theChar && theChar <= 0xDBFFu ?
true :
false;
227 return 0xDC00u <= theChar && theChar <= 0xDFFFu ?
true :
false;
232 XalanDOMChar theHighSurrogate,
233 XalanDOMChar theLowSurrogate,
234 MemoryManager& theManager)
236 assert(isUTF16HighSurrogate(theHighSurrogate) ==
true);
238 if (isUTF16LowSurrogate(theLowSurrogate) ==
false)
240 throwInvalidUTF16SurrogateException(theHighSurrogate, theLowSurrogate, theManager);
243 return ((theHighSurrogate - 0xD800u) << 10) + theLowSurrogate - 0xDC00u + 0x00010000u;
249 MemoryManager& theManager)
256 XalanMessages::InvalidScalar_1Param,
259 XALAN_USING_XERCES(SAXException)
261 throw SAXException(
c_wstr(theMessage), &theManager);
283 XalanMessages::InvalidSurrogatePair_2Param,
288 XALAN_USING_XERCES(SAXException)
290 throw SAXException(
c_wstr(theMessage),&theManager);
326 clear(m_stringBuffer);
335 return m_stringBuffer;
341 XalanFormatterWriter();
343 XalanFormatterWriter&
344 operator=(
const XalanFormatterWriter&);
349 XALAN_CPP_NAMESPACE_END
353 #endif // XALANFORMATTERWRITER_HEADER_GUARD_1357924680