DWFCore::DWFXMLEncodingOutputStream Class Reference

#include "dwfcore/XMLEncodingOutputStream.h"

Inheritance diagram for DWFCore::DWFXMLEncodingOutputStream:

Inheritance graph
[legend]
Collaboration diagram for DWFCore::DWFXMLEncodingOutputStream:

Collaboration graph
[legend]
List of all members.

Detailed Description

This stream implemented performs XML character encoding on all data that is written to it.

Since:
1.0.1
This class must be used with another DWFOutputStream. As data is written into this stream, it will be XML encoded and written into the chained stream.

Definition at line 47 of file XMLEncodingOutputStream.h.

Public Member Functions

_DWFCORE_API DWFXMLEncodingOutputStream (DWFOutputStream *pOutputStream=NULL, bool bOwnStream=false, bool bAlwaysEncodeWideStrings=false) throw ()
virtual _DWFCORE_API ~DWFXMLEncodingOutputStream () throw ()
_DWFCORE_API void flush () throw ( DWFException )
virtual _DWFCORE_API size_t write (const void *pBuffer, size_t nBytesToWrite) throw ( DWFException )
_DWFCORE_API size_t bytes () const throw ()
_DWFCORE_API void attach (DWFOutputStream *pOutputStream, bool bOwnStream) throw ()
_DWFCORE_API void detach () throw ()


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFXMLEncodingOutputStream::DWFXMLEncodingOutputStream DWFOutputStream pOutputStream = NULL,
bool  bOwnStream = false,
bool  bAlwaysEncodeWideStrings = false
throw ()
 

Constructor

Parameters:
pOutputStream An output stream to which encoded data will be written. This object should be allocated with the DWFCORE_ALLOC_OBJECT macro if ownership will be transferred.
bOwnStream If true, this object will assume ownership of pInputStream and delete it as necessary using DWFCORE_FREE_OBJECT. If false, the caller retains ownership of pInputStream and is responsible for deleting it.
bAlwaysEncodeWideStrings If true, this stream will treat all incoming data as wide character strings and the "special" version of DWFString::EncodeXML() that only converts a subset of expected characters. Please read the documentation for this method before setting this flag to true. If false, the "regular" version of DWFString::EncodeXML() will be used and the incoming data will be treated as UTF-8 (or US-ASCII) character data.
Exceptions:
None 

virtual _DWFCORE_API DWFCore::DWFXMLEncodingOutputStream::~DWFXMLEncodingOutputStream  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFCORE_API void DWFCore::DWFXMLEncodingOutputStream::attach DWFOutputStream pOutputStream,
bool  bOwnStream
throw ()
 

Binds a new destination stream to this object. Any previously bound stream will be replaced; and deleted if this stream currently owns it.

Parameters:
pOutputStream An output stream to which encoded data will be written. This object should be allocated with the DWFCORE_ALLOC_OBJECT macro if ownership will be transferred.
bOwnStream If true, this object will assume ownership of pInputStream and delete it as necessary using DWFCORE_FREE_OBJECT. If false, the caller retains ownership of pInputStream and is responsible for deleting it.
Exceptions:
None 

_DWFCORE_API size_t DWFCore::DWFXMLEncodingOutputStream::bytes  )  const throw ()
 

Returns the total number of encoded bytes written to the destination stream. This is not the number of original bytes written to this stream.

Returns:
The total number of encoded bytes written.
Exceptions:
None 

_DWFCORE_API void DWFCore::DWFXMLEncodingOutputStream::detach  )  throw ()
 

Unbinds a destination stream from this objec and deletes it if this stream currently owns it.

Exceptions:
None 

_DWFCORE_API void DWFCore::DWFXMLEncodingOutputStream::flush  )  throw ( DWFException ) [virtual]
 

Writes any remaining bytes from the stream into the data sink. This method may not have any function for some implementations. It is recommended that, rather than throwing an exception, the method simply return.

Exceptions:
DWFException 

Implements DWFCore::DWFOutputStream.

virtual _DWFCORE_API size_t DWFCore::DWFXMLEncodingOutputStream::write const void *  pBuffer,
size_t  nBytesToWrite
throw ( DWFException ) [virtual]
 

Writes at most nBytesToWrite into the stream from the buffer provided.

Parameters:
pBuffer A pointer to a block of memory whose data will be written into the stream. Any implementation receiving a NULL buffer pointer should throw a DWFInvalidArgumentException.
nBytesToWrite The number of bytes to copy from pBuffer.
Returns:
The number of bytes actually written.
Exceptions:
DWFException 

Implements DWFCore::DWFOutputStream.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:39:44 2009 for Autodesk DWF Core Library by  doxygen 1.4.5