16 #if !defined(XALANUTF8WRITER_HEADER_GUARD_1357924680)
17 #define XALANUTF8WRITER_HEADER_GUARD_1357924680
24 XALAN_CPP_NAMESPACE_BEGIN
31 return char((theChar >> 18) & 0x7);
39 return char((theChar >> 12) & 0x3F);
47 return char((theChar >> 12) & 0xF);
55 return char((theChar >> 6) & 0x3f);
63 return char((theChar >> 6) & 0x1f);
71 return char(theChar & 0x3f);
79 return char(0xC0 + theBits);
87 return char(0xE0 + theBits);
95 return char(0xF0 + theBits);
103 return char(0x80 + theBits);
117 MemoryManager& theMemoryManager);
140 const XalanDOMChar chars[],
145 assert(chars != 0 && length != 0 && start < length);
147 return write(chars, start, length);
156 write(data, theLength);
165 write(data, theLength);
174 write(data, theLength);
179 const XalanDOMChar* theChars,
194 if (theLength >
sizeof(m_buffer))
202 if (m_bufferRemaining < theLength)
209 *m_bufferPosition = theChars[i];
214 m_bufferRemaining -= theLength;
239 assert(theChar < 128);
241 if (m_bufferRemaining == 0)
246 *m_bufferPosition = theChar;
254 const XalanDOMChar* theChars,
259 write((
unsigned int)theChars[i]);
265 const XalanDOMChar chars[],
269 XalanDOMChar ch = chars[start];
273 write((
unsigned int)ch);
277 if (start + 1 >= length)
299 const XalanDOMChar* theChars,
310 if (i + 1 >= theLength)
323 write((
unsigned int)ch);
346 m_bufferPosition = m_buffer;
347 m_bufferRemaining = kBufferSize;
353 write(
unsigned int theChar)
357 write(
char(theChar));
359 else if (theChar <= 0x7FF)
361 if (m_bufferRemaining < 2)
371 m_bufferRemaining -= 2;
373 else if (theChar <= 0xFFFF)
376 assert(theChar < 0xD800 || theChar > 0xDBFF);
377 assert(theChar < 0xDC00 || theChar > 0xDFFF);
379 if (m_bufferRemaining < 3)
391 m_bufferRemaining -= 3;
393 else if (theChar <= 0x10FFFF)
395 if (m_bufferRemaining < 4)
409 m_bufferRemaining -= 4;
433 XALAN_CPP_NAMESPACE_END
437 #endif // XALANUTF8WRITER_HEADER_GUARD_1357924680