18 #if !defined(XALANFORMATTERWRITER_HEADER_GUARD_1357924680) 19 #define XALANFORMATTERWRITER_HEADER_GUARD_1357924680 26 #include <xercesc/sax/SAXException.hpp> 36 XALAN_CPP_NAMESPACE_BEGIN
51 template <
class WriterType>
61 m_newlineStringLength(0)
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;
99 size_type m_newlineStringLength;
102 template<
class WriterType>
105 typedef typename WriterType::value_type value_type;
118 for ( size_type i = 0 ; i < count ; i++ )
126 WriterType& m_writer;
146 result = m_stream->canTranscodeTo(theChar);
161 MemoryManager& theMemoryManager) :
163 m_memoryManager(theMemoryManager),
164 m_stringBuffer(5, 0, theMemoryManager)
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)
259 XalanMessages::InvalidScalar_1Param,
264 throw SAXException(theMessage.
c_str(), &theManager);
270 MemoryManager& theManager)
275 m_writer.getStream();
287 MemoryManager& theManager)
302 XalanMessages::InvalidSurrogatePair_2Param,
309 throw SAXException(theMessage.
c_str(),&theManager);
345 m_stringBuffer.
clear();
354 return m_stringBuffer;
360 XalanFormatterWriter();
362 XalanFormatterWriter&
363 operator=(
const XalanFormatterWriter&);
368 XALAN_CPP_NAMESPACE_END
372 #endif // XALANFORMATTERWRITER_HEADER_GUARD_1357924680
static const XalanDOMChar * defaultNewlineString()
static XalanDOMString & getMessage(XalanDOMString &theResultMessage, XalanMessages::Codes msgToLoad, const char *repText1, const char *repText2=0, const char *repText3=0, const char *repText4=0)
const XalanDOMChar * c_str() const
void push_back(XalanDOMChar theChar)
NumberToDOMString(double theValue, XalanDOMString &theResult)
Converts a double value into a XalanDOMString.
const XalanDOMString & getOutputEncoding() const
Get the output encoding for the stream.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
NumberToHexDOMString(XALAN_UINT64 theValue, XalanDOMString &theResult)
Converts an 64-bit unsigned value into a XalanDOMString.
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
virtual const XalanDOMChar * getNewlineString() const
Get the string which is appropriate for inserting a line feed in the stream.
virtual XalanOutputStream * getStream()
Get the stream associated with the writer...