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