18#if !defined(XALANOUTPUTSTREAM_HEADER_GUARD_1357924680)
19#define XALANOUTPUTSTREAM_HEADER_GUARD_1357924680
45class XalanOutputTranscoder;
53 enum { eDefaultBufferSize = 512u, eDefaultTranscoderBlockSize = 1024u };
79 return m_buffer.getMemoryManager();
85#if defined(XALAN_NEWLINE_IS_CRLF)
146 if (m_buffer.size() == m_bufferSize)
165 assert(m_buffer.empty() ==
true);
196 assert(m_buffer.empty() ==
true);
261 return m_throwTranscodeException;
276 m_throwTranscodeException =
flag;
329 other.m_memoryManager)
475 bool m_throwTranscodeException;
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual ~TranscoderInternalFailureException()
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
TranscoderInternalFailureException(const TranscoderInternalFailureException &other)
const XalanDOMString & getEncoding() const
TranscoderInternalFailureException(const XalanDOMString &theEncoding, XalanDOMString &theBuffer, const Locator *theLocator)
TranscoderInternalFailureException(const XalanDOMString &theEncoding, XalanDOMString &theBuffer)
TranscodingException(XalanDOMString &theBuffer, const Locator *theLocator)
TranscodingException(const TranscodingException &other)
virtual ~TranscodingException()
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
TranscodingException(XalanDOMString &theBuffer)
UnsupportedEncodingException(const XalanDOMString &theEncoding, XalanDOMString &theBuffer, const Locator *theLocator)
UnsupportedEncodingException(const XalanDOMString &theEncoding, XalanDOMString &theBuffer)
UnsupportedEncodingException(const UnsupportedEncodingException &other)
const XalanDOMString & getEncoding() const
virtual ~UnsupportedEncodingException()
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
XalanOutputStreamException(const XalanDOMString &theMessage, MemoryManager &theManager)
XalanOutputStreamException(const XalanDOMString &theMessage, MemoryManager &theManager, const Locator *theLocator)
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
virtual ~XalanOutputStreamException()
XalanOutputStreamException(const XalanOutputStreamException &other)
void write(char theChar)
Write a character to the output stream.
void write(const XalanDOMChar *theBuffer, size_type theBufferLength)
Write a specified number of characters to the output stream.
void transcode(const XalanDOMChar *theBuffer, size_type theBufferLength, TranscodeVectorType &theDestination)
Transcode a wide string.
static const XalanDOMChar * defaultNewlineString()
void setOutputEncoding(const XalanDOMString &theEncoding)
Set the output encoding for the stream.
const XalanDOMString & getOutputEncoding() const
Get the output encoding for the stream.
const XalanOutputTranscoder * getTranscoder() const
MemoryManager & getMemoryManager()
XalanVector< char > TranscodeVectorType
virtual void doFlush()=0
Flush the stream.
XalanTranscodingServices::size_type size_type
bool canTranscodeTo(XalanUnicodeChar theChar) const
Determine if a given value can be represented in the output encoding.
bool getThrowTranscodeException() const
Set the flag that indicates whether a transcoding error should throw an exception.
virtual void writeData(const char *theBuffer, size_type theBufferLength)=0
Write the data in the buffer.
XalanOutputStream(MemoryManager &theManager, size_type theBufferSize=eDefaultBufferSize, size_type theTranscoderBlockSize=eDefaultTranscoderBlockSize, bool fThrowTranscodeException=true)
Constructor.
static XalanDOMString & formatMessage(const XalanDOMString &theMessage, int theErrorCode, XalanDOMString &theBuffer)
static const XalanDOMString::size_type s_nlStringLength
void setBufferSize(size_type theBufferSize)
Set the size of the output buffer.
void write(const char *theBuffer, size_type theBufferLength)
Write a specified number of characters to the output stream.
void write(const XalanDOMChar *theBuffer)
Write a null-terminated wide string to the output file.
void write(XalanDOMChar theChar)
Write a wide character to the output stream.
void flush()
Flush the stream's buffer.
virtual const XalanDOMChar * getNewlineString() const
Get the string which is appropriate for inserting a line feed in the stream.
void write(const char *theBuffer)
Write a null-terminated string to the output file.
void flushBuffer()
Flush the stream's transcoding buffer, but do not request the implementation class to flush its buffe...
XalanVector< XalanDOMChar > BufferType
void setThrowTranscodeException(bool flag)
Set the flag that indicates whether a transcoding error should throw an exception.
static const XalanDOMString::size_type s_nlCRStringLength
virtual void newline()
Write the appropriate newline character(s) to the stream.
virtual ~XalanOutputStream()
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)