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
Definition: XalanUnicode.hpp:44
Definition: XalanUnicode.hpp:56
const XalanDOMChar * c_wstr(const XalanDOMString &theString)
Get the underlying representation of the target XalanDOMString as a null-terminated string...
Definition: DOMStringHelper.hpp:153
Definition: XalanUnicode.hpp:50
UnsignedLongToHexDOMString(unsigned long theValue, XalanDOMString &theResult)
Converts an unsigned long value and appends the result to a XalanDOMString.
virtual const XalanDOMChar * getNewlineString() const
Get the string which is appropriate for inserting a line feed in the stream.
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: Writer.hpp:42
static const XalanDOMChar * defaultNewlineString()
Definition: XalanOutputStream.hpp:82
static XalanDOMString & getMessage(XalanDOMString &theResultMessage, XalanMessages::Codes msgToLoad, const char *repText1, const char *repText2=0, const char *repText3=0, const char *repText4=0)
void clear(XalanDOMString &theString)
Remove all elements from target string.
Definition: DOMStringHelper.hpp:2291
Definition: XalanUnicode.hpp:87
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
void push_back(XalanDOMChar theChar)
Definition: XalanDOMString.hpp:503
Definition: XalanOutputStream.hpp:47
Definition: XalanDOMString.hpp:42
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:277
UnsignedLongToDOMString(unsigned long theValue, XalanDOMString &theResult)
Converts an unsigned long value and appends the result to a XalanDOMString.
unsigned int size_type
Definition: XalanDOMString.hpp:53
virtual XalanOutputStream * getStream()
Get the stream associated with the writer...