Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
XalanOutputStream Class Referenceabstract
Inheritance diagram for XalanOutputStream:
XalanFileOutputStream XalanFStreamOutputStream XalanNullOutputStream XalanStdOutputStream XalanTransformerOutputStream

Classes

class  TranscoderInternalFailureException
 
class  TranscodingException
 
class  UnknownEncodingException
 
class  UnsupportedEncodingException
 
class  XalanOutputStreamException
 

Public Types

enum  { eDefaultBufferSize = 512u, eDefaultTranscoderBlockSize = 1024u }
 
typedef XalanVector< XalanDOMChar > BufferType
 
typedef XalanVector< char > TranscodeVectorType
 
typedef
XalanTranscodingServices::size_type 
size_type
 
typedef
XalanTranscodingServices::UnicodeCharType 
UnicodeCharType
 

Public Member Functions

 XalanOutputStream (MemoryManagerType &theManager, size_type theBufferSize=eDefaultBufferSize, size_type theTranscoderBlockSize=eDefaultTranscoderBlockSize, bool fThrowTranscodeException=true)
 Constructor. More...
 
virtual ~XalanOutputStream ()
 
MemoryManagerTypegetMemoryManager ()
 
virtual void newline ()
 Write the appropriate newline character(s) to the stream. More...
 
virtual const XalanDOMChar * getNewlineString () const
 Get the string which is appropriate for inserting a line feed in the stream. More...
 
void flushBuffer ()
 Flush the stream's transcoding buffer, but do not request the implementation class to flush its buffer. More...
 
void flush ()
 Flush the stream's buffer. More...
 
void write (char theChar)
 Write a character to the output stream. More...
 
void write (XalanDOMChar theChar)
 Write a wide character to the output stream. More...
 
void write (const char *theBuffer)
 Write a null-terminated string to the output file. More...
 
void write (const XalanDOMChar *theBuffer)
 Write a null-terminated wide string to the output file. More...
 
void write (const char *theBuffer, size_type theBufferLength)
 Write a specified number of characters to the output stream. More...
 
void write (const XalanDOMChar *theBuffer, size_type theBufferLength)
 Write a specified number of characters to the output stream. More...
 
const XalanDOMStringgetOutputEncoding () const
 Get the output encoding for the stream. More...
 
void setOutputEncoding (const XalanDOMString &theEncoding)
 Set the output encoding for the stream. More...
 
bool canTranscodeTo (UnicodeCharType theChar) const
 Determine if a given value can be represented in the output encoding. More...
 
const XalanOutputTranscodergetTranscoder () const
 
bool getThrowTranscodeException () const
 Set the flag that indicates whether a transcoding error should throw an exception. More...
 
void setThrowTranscodeException (bool flag)
 Set the flag that indicates whether a transcoding error should throw an exception. More...
 
void setBufferSize (size_type theBufferSize)
 Set the size of the output buffer. More...
 

Static Public Member Functions

static const XalanDOMChar * defaultNewlineString ()
 

Protected Member Functions

void transcode (const XalanDOMChar *theBuffer, size_type theBufferLength, TranscodeVectorType &theDestination)
 Transcode a wide string. More...
 
virtual void writeData (const char *theBuffer, size_type theBufferLength)=0
 Write the data in the buffer. More...
 
virtual void doFlush ()=0
 Flush the stream. More...
 

Static Protected Attributes

static const XalanDOMChar s_nlString []
 
static const XalanDOMChar s_nlCRString []
 
static const
XalanDOMString::size_type 
s_nlStringLength
 
static const
XalanDOMString::size_type 
s_nlCRStringLength
 

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
Enumerator
eDefaultBufferSize 
eDefaultTranscoderBlockSize 

Constructor & Destructor Documentation

XalanOutputStream::XalanOutputStream ( MemoryManagerType theManager,
size_type  theBufferSize = eDefaultBufferSize,
size_type  theTranscoderBlockSize = eDefaultTranscoderBlockSize,
bool  fThrowTranscodeException = true 
)
explicit

Constructor.

Parameters
theBufferSizethe size of the transcoding buffer
theTranscoderBlockSizethe size of the block used by the transcoder
fThrowTranscodeExceptionIf true, an error transcoding will result in an exception being thrown.
virtual XalanOutputStream::~XalanOutputStream ( )
virtual

Member Function Documentation

bool XalanOutputStream::canTranscodeTo ( UnicodeCharType  theChar) const

Determine if a given value can be represented in the output encoding.

Returns
true if the value can be represented, and false if not.
static const XalanDOMChar* XalanOutputStream::defaultNewlineString ( )
static
virtual void XalanOutputStream::doFlush ( )
protectedpure virtual
void XalanOutputStream::flush ( )

Flush the stream's buffer.

void XalanOutputStream::flushBuffer ( )

Flush the stream's transcoding buffer, but do not request the implementation class to flush its buffer.

MemoryManagerType& XalanOutputStream::getMemoryManager ( )
virtual const XalanDOMChar* XalanOutputStream::getNewlineString ( ) const
virtual

Get the string which is appropriate for inserting a line feed in the stream.

const XalanDOMString& XalanOutputStream::getOutputEncoding ( ) const

Get the output encoding for the stream.

Returns
The encoding name
bool XalanOutputStream::getThrowTranscodeException ( ) const

Set the flag that indicates whether a transcoding error should throw an exception.

The default is to throw an exception. If this flag is false, and and an error occurs transcoding, then data will likely be lost.

Returns
the value of the flag.
const XalanOutputTranscoder* XalanOutputStream::getTranscoder ( ) const
virtual void XalanOutputStream::newline ( )
virtual

Write the appropriate newline character(s) to the stream.

void XalanOutputStream::setBufferSize ( size_type  theBufferSize)

Set the size of the output buffer.

Parameters
theBufferSizeThe buffer size.
void XalanOutputStream::setOutputEncoding ( const XalanDOMString theEncoding)

Set the output encoding for the stream.

Parameters
theEncodingThe encoding name
void XalanOutputStream::setThrowTranscodeException ( bool  flag)

Set the flag that indicates whether a transcoding error should throw an exception.

The default is to throw an exception. If this flag is false, and and an error occurs transcoding, then data will likely be lost.

Parameters
thenew value of the flag.
void XalanOutputStream::transcode ( const XalanDOMChar *  theBuffer,
size_type  theBufferLength,
TranscodeVectorType theDestination 
)
protected

Transcode a wide string.

Parameters
theBufferThe string to transcode.
theBufferLengthThe length of the string.
theDestinationThe destination vector.
void XalanOutputStream::write ( char  theChar)

Write a character to the output stream.

The character will not be transcoded.

Parameters
theCharthe character to write
void XalanOutputStream::write ( XalanDOMChar  theChar)

Write a wide character to the output stream.

The character will be transcoded, if an output encoding is specified.

Parameters
theCharthe character to write
void XalanOutputStream::write ( const char *  theBuffer)

Write a null-terminated string to the output file.

The character will not be transcoded. The caller is responsible for making sure the buffer is flushed before calling this member function.

Parameters
theBuffercharacter buffer to write
void XalanOutputStream::write ( const XalanDOMChar *  theBuffer)

Write a null-terminated wide string to the output file.

The string will be transcoded, if an output encoding is specified.

Parameters
theBuffercharacter buffer to write
void XalanOutputStream::write ( const char *  theBuffer,
size_type  theBufferLength 
)

Write a specified number of characters to the output stream.

The string will not be transcoded. The caller is responsible for making sure the buffer is flushed before calling this member function.

Parameters
theBuffercharacter buffer to write
theBufferLengthnumber of characters to write
void XalanOutputStream::write ( const XalanDOMChar *  theBuffer,
size_type  theBufferLength 
)

Write a specified number of characters to the output stream.

The string will be transcoded, if an output encoding is specified.

Parameters
theBuffercharacter buffer to write
theBufferLengthnumber of characters to write
virtual void XalanOutputStream::writeData ( const char *  theBuffer,
size_type  theBufferLength 
)
protectedpure virtual

Write the data in the buffer.

Parameters
theBufferThe data to write
theBufferLengthThe length of theBuffer.

Implemented in XalanFileOutputStream, XalanStdOutputStream, XalanFStreamOutputStream, XalanTransformerOutputStream, and XalanNullOutputStream.

Member Data Documentation

const XalanDOMChar XalanOutputStream::s_nlCRString[]
staticprotected
const XalanDOMString::size_type XalanOutputStream::s_nlCRStringLength
staticprotected
const XalanDOMChar XalanOutputStream::s_nlString[]
staticprotected
const XalanDOMString::size_type XalanOutputStream::s_nlStringLength
staticprotected

The documentation for this class was generated from the following file:

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo