18 #if !defined(XALANOUTPUTSTREAM_HEADER_GUARD_1357924680) 19 #define XALANOUTPUTSTREAM_HEADER_GUARD_1357924680 41 XALAN_CPP_NAMESPACE_BEGIN
53 enum { eDefaultBufferSize = 512u, eDefaultTranscoderBlockSize = 1024u };
68 MemoryManager& theManager,
69 size_type theBufferSize = eDefaultBufferSize,
70 size_type theTranscoderBlockSize = eDefaultTranscoderBlockSize,
71 bool fThrowTranscodeException =
true);
79 return m_buffer.getMemoryManager();
82 static const XalanDOMChar*
85 #if defined(XALAN_NEWLINE_IS_CRLF) 101 virtual const XalanDOMChar*
102 getNewlineString()
const;
144 assert(m_bufferSize > 0);
146 if (m_buffer.size() == m_bufferSize)
151 m_buffer.push_back(theChar);
164 assert(theBuffer != 0);
165 assert(m_buffer.empty() ==
true);
167 write(theBuffer,
length(theBuffer));
177 write(
const XalanDOMChar* theBuffer)
179 write(theBuffer,
length(theBuffer));
192 const char* theBuffer,
193 size_type theBufferLength)
195 assert(theBuffer != 0);
196 assert(m_buffer.empty() ==
true);
211 const XalanDOMChar* theBuffer,
212 size_type theBufferLength);
240 canTranscodeTo(XalanUnicodeChar theChar)
const;
261 return m_throwTranscodeException;
276 m_throwTranscodeException = flag;
285 setBufferSize(size_type theBufferSize);
294 MemoryManager& theManager,
295 const Locator* theLocator);
299 MemoryManager& theManager);
306 virtual const XalanDOMChar*
319 const Locator* theLocator);
329 other.m_memoryManager)
342 virtual const XalanDOMChar*
357 const Locator* theLocator);
368 virtual const XalanDOMChar*
388 const Locator* theLocator);
398 virtual const XalanDOMChar*
419 const XalanDOMChar* theBuffer,
420 size_type theBufferLength,
421 TranscodeVectorType& theDestination);
431 const char* theBuffer,
432 size_type theBufferLength) = 0;
440 static const XalanDOMChar s_nlString[];
441 static const XalanDOMChar s_nlCRString[];
459 const XalanDOMChar* theBuffer,
460 size_type theBufferLength);
463 const size_type m_transcoderBlockSize;
467 size_type m_bufferSize;
475 bool m_throwTranscodeException;
477 TranscodeVectorType m_transcodingBuffer;
482 XALAN_CPP_NAMESPACE_END
486 #endif // XALANOUTPUTSTREAM_HEADER_GUARD_1357924680 void flush()
Flush the stream's buffer.
void transcode(const XalanDOMChar *theBuffer, size_type theBufferLength, TranscodeVectorType &theDestination)
Transcode a wide string.
virtual const XalanDOMChar * getType() const =0
Retrieve type of exception.
static const XalanDOMChar * defaultNewlineString()
void write(XalanDOMChar theChar)
Write a wide character to the output stream.
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
const XalanDOMString & getEncoding() const
void write(char theChar)
Write a character to the output stream.
static XalanDOMString & formatMessage(const XalanDOMString &theMessage, int theErrorCode, XalanDOMString &theBuffer)
XalanVector< char > TranscodeVectorType
XalanVector< XalanDOMChar > BufferType
const XalanOutputTranscoder * getTranscoder() const
void write(const char *theBuffer)
Write a null-terminated string to the output file.
XalanTranscodingServices::size_type size_type
virtual void doFlush()=0
Flush the stream.
const XalanDOMString & getEncoding() const
void write(const XalanDOMChar *theBuffer)
Write a null-terminated wide string to the output file.
const XalanDOMString & getOutputEncoding() const
Get the output encoding for the stream.
MemoryManager & getMemoryManager()
XalanOutputStream(MemoryManager &theManager, size_type theBufferSize=eDefaultBufferSize, size_type theTranscoderBlockSize=eDefaultTranscoderBlockSize, bool fThrowTranscodeException=true)
Constructor.
void setThrowTranscodeException(bool flag)
Set the flag that indicates whether a transcoding error should throw an exception.
static const XalanDOMString::size_type s_nlStringLength
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
static const XalanDOMString::size_type s_nlCRStringLength
UnsupportedEncodingException(const UnsupportedEncodingException &other)
void write(const char *theBuffer, size_type theBufferLength)
Write a specified number of characters to the output stream.
virtual void writeData(const char *theBuffer, size_type theBufferLength)=0
Write the data in the buffer.
bool getThrowTranscodeException() const
Set the flag that indicates whether a transcoding error should throw an exception.