18#if !defined(XALANUTF8WRITER_HEADER_GUARD_1357924680)
19#define XALANUTF8WRITER_HEADER_GUARD_1357924680
33 return static_cast<char>((
theChar >> 18) & 0x7);
41 return static_cast<char>((
theChar >> 12) & 0x3F);
49 return static_cast<char>((
theChar >> 12) & 0xF);
57 return static_cast<char>((
theChar >> 6) & 0x3f);
65 return static_cast<char>((
theChar >> 6) & 0x1f);
73 return static_cast<char>(
theChar & 0x3f);
81 return static_cast<char>(0xC0 +
theBits);
89 return static_cast<char>(0xE0 +
theBits);
97 return static_cast<char>(0xF0 +
theBits);
105 return static_cast<char>(0x80 +
theBits);
132 assert(m_newlineString != 0);
133 assert(
length(m_newlineString) == m_newlineStringLength);
137 m_newlineStringLength);
252 if (m_bufferRemaining == 0)
270 if (isUTF16HighSurrogate(
theChars[
i]) ==
false)
276 throwInvalidUTF16SurrogateException(
284 decodeUTF16SurrogatePair(
287 getMemoryManager()));
302 if (isUTF16HighSurrogate(
ch) ==
false)
306 else if (start + 1 >=
length)
308 throwInvalidUTF16SurrogateException(
316 decodeUTF16SurrogatePair(
319 getMemoryManager()));
334 if (isUTF16HighSurrogate(
ch) ==
true)
338 throwInvalidUTF16SurrogateException(
346 decodeUTF16SurrogatePair(
349 getMemoryManager()));
377 m_writer.write(m_buffer, 0, m_bufferPosition - m_buffer);
379 m_bufferPosition = m_buffer;
380 m_bufferRemaining = kBufferSize;
392 else if (theChar <= 0x7FF)
394 if (m_bufferRemaining < 2)
404 m_bufferRemaining -= 2;
406 else if (theChar <= 0xFFFF)
409 assert(theChar < 0xD800 || theChar > 0xDBFF);
410 assert(theChar < 0xDC00 || theChar > 0xDFFF);
412 if (m_bufferRemaining < 3)
424 m_bufferRemaining -= 3;
426 else if (theChar <= 0x10FFFF)
428 if (m_bufferRemaining < 4)
442 m_bufferRemaining -= 4;
446 throwInvalidCharacterException(theChar, getMemoryManager());
457 value_type m_buffer[kBufferSize];
459 value_type* m_bufferPosition;
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
void write(const XalanDOMChar *theChars, size_type theLength)
void write(const XalanDOMChar *theChars)
void safeWriteContent(const XalanDOMChar *theChars, size_type theLength)
XalanUTF8Writer(Writer &writer, MemoryManager &theMemoryManager)
size_type writeCDATAChar(const XalanDOMChar chars[], size_type start, size_type length, bool &)
void writePIChars(const XalanDOMChar *data, size_type theLength)
Writes PI characters.
void outputNewline()
Output a line break.
void writeSafe(const XalanDOMChar *theChars, size_type theLength)
void write(const value_type *theChars, size_type theLength)
size_type write(const XalanDOMChar chars[], size_type start, size_type length)
void write(const value_type *theChars)
void writeNameChar(const XalanDOMChar *data, size_type theLength)
Writes name characters.
void writeCommentChars(const XalanDOMChar *data, size_type theLength)
Writes comment characters.
void write(value_type theChar)
void write(const XalanDOMString &theChars)
virtual ~XalanUTF8Writer()
char leadingByteOf2(char theBits)
char leadingByteOf3(char theBits)
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
char bits7to11(XalanUnicodeChar theChar)
char trailingByte(char theBits)
char leadingByteOf4(char theBits)
char bits13to18(XalanUnicodeChar theChar)
char bits13to16(XalanUnicodeChar theChar)
char bits1to6(XalanUnicodeChar theChar)
char bits19to21(XalanUnicodeChar theChar)
char bits7to12(XalanUnicodeChar theChar)