18 #if !defined(XALANFORMATTERWRITER_HEADER_GUARD_1357924680)
19 #define XALANFORMATTERWRITER_HEADER_GUARD_1357924680
26 #include <xercesc/sax/SAXException.hpp>
40 using xercesc::MemoryManager;
51 template <
class WriterType>
61 m_newlineStringLength(0)
71 m_newlineString = XalanOutputStream::defaultNewlineString();
74 assert(m_newlineString != 0);
76 m_newlineStringLength =
length(m_newlineString);
82 assert(m_newlineString != 0 &&
length(m_newlineString) == m_newlineStringLength);
84 m_writer.write(m_newlineString, m_newlineStringLength);
94 const XalanDOMChar* m_newlineString;
102 template<
class WriterType>
105 typedef typename WriterType::value_type value_type;
118 for (
size_type i = 0 ; i < count ; i++ )
120 m_writer.write(value_type(XalanUnicode::charSpace));
126 WriterType& m_writer;
146 result = m_stream->canTranscodeTo(theChar);
161 MemoryManager& theMemoryManager) :
163 m_memoryManager(theMemoryManager),
164 m_stringBuffer(5, 0, theMemoryManager)
171 m_newlineString = XalanOutputStream::defaultNewlineString();
178 assert(m_newlineString != 0);
180 m_newlineStringLength =
length(m_newlineString);
182 assert(m_newlineString != 0);
188 return m_memoryManager;
205 return m_writer.getStream();
211 return m_writer.getStream();
224 return 0xD800u <= theChar && theChar <= 0xDBFFu ? true :
false;
230 return 0xDC00u <= theChar && theChar <= 0xDFFFu ? true :
false;
233 static XalanUnicodeChar
235 XalanDOMChar theHighSurrogate,
236 XalanDOMChar theLowSurrogate,
237 MemoryManager& theManager)
239 assert(isUTF16HighSurrogate(theHighSurrogate) ==
true);
241 if (isUTF16LowSurrogate(theLowSurrogate) ==
false)
243 throwInvalidUTF16SurrogateException(theHighSurrogate, theLowSurrogate, theManager);
246 return ((theHighSurrogate - 0xD800u) << 10) + theLowSurrogate - 0xDC00u + 0x00010000u;
252 MemoryManager& theManager)
257 XalanMessageLoader::getMessage(
259 XalanMessages::InvalidScalar_1Param,
262 using xercesc::SAXException;
264 throw SAXException(theMessage.
c_str(), &theManager);
270 MemoryManager& theManager)
275 m_writer.getStream();
287 MemoryManager& theManager)
300 XalanMessageLoader::getMessage(
302 XalanMessages::InvalidSurrogatePair_2Param,
307 using xercesc::SAXException;
309 throw SAXException(theMessage.
c_str(),&theManager);
345 m_stringBuffer.
clear();
347 m_stringBuffer.
push_back(XalanDOMChar(XalanUnicode::charAmpersand));
348 m_stringBuffer.
push_back(XalanDOMChar(XalanUnicode::charNumberSign));
352 m_stringBuffer.
push_back(XalanDOMChar(XalanUnicode::charSemicolon));
354 return m_stringBuffer;
372 #endif // XALANFORMATTERWRITER_HEADER_GUARD_1357924680