DWFCore::DWFXMLSerializer Class Reference

#include <dwfcore/DWFXMLSerializer.h>

Inheritance diagram for DWFCore::DWFXMLSerializer:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

An object that facilitates the publishing of toolkit data objects into XML.

Since:
7.4

Definition at line 65 of file DWFXMLSerializer.h.

Public Types

enum  teFlags
 Named enumerations for use during the serialization.

Public Member Functions

_DWFCORE_API DWFXMLSerializer (DWFUUID &rUUID) throw ()
virtual _DWFCORE_API ~DWFXMLSerializer () throw ()
_DWFCORE_API void attach (DWFOutputStream &rStream) throw ( DWFException )
_DWFCORE_API void detach () throw ( DWFException )
_DWFCORE_API const DWFStringnextUUID (bool bSquash) throw ()
_DWFCORE_API void emitXMLHeader () throw ( DWFException )
_DWFCORE_API void startElement (const DWFString &zName, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const DWFString &zValue, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, int nValue, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const int *anValues, size_t nCount, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const float &fValue, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const float *anValues, size_t nCount, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const double &dValue, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addAttribute (const DWFString &zName, const double *anValues, size_t nCount, const DWFString &zNamespace=L"") throw ( DWFException )
_DWFCORE_API void addCData (const DWFString &zCData) throw ( DWFException )
_DWFCORE_API void insertXMLStream (DWFInputStream *pInputStream, bool bCloseCurrentElement=true) throw ( DWFException )
_DWFCORE_API void endElement () throw ( DWFException )

Protected Attributes

XMLOutputStream_pStream

Classes

class  XMLOutputStream


Constructor & Destructor Documentation

_DWFCORE_API DWFCore::DWFXMLSerializer::DWFXMLSerializer DWFUUID rUUID  )  throw ()
 

Constructor

Parameters:
rUUID A unique identifier generator that is available to consumers of the serializer.
Exceptions:
None 

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

Destructor

Exceptions:
None 


Member Function Documentation

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const double *  anValues,
size_t  nCount,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts new double attributes into an open element.

Parameters:
zName The name of the attribute.
anValues A pointer to an array of double attribute values.
nCount The number of attribute values.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const double &  dValue,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts a new double attribute into an open element.

Parameters:
zName The name of the attribute.
dValue The value of the attribute.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const float *  anValues,
size_t  nCount,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts new float attributes into an open element.

Parameters:
zName The name of the attribute.
afValues A pointer to an array of float attribute values.
nCount The number of attribute values.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const float &  fValue,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts a new float attribute into an open element.

Parameters:
zName The name of the attribute.
fValue The value of the attribute.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const int *  anValues,
size_t  nCount,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts new integer attributes into an open element.

Parameters:
zName The name of the attribute.
anValues A pointer to an array of integer attribute values.
nCount The number of attribute values.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
int  nValue,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts a new integer attribute into an open element.

Parameters:
zName The name of the attribute.
nValue The value of the attribute.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 
Since:
7.2

_DWFCORE_API void DWFCore::DWFXMLSerializer::addAttribute const DWFString zName,
const DWFString zValue,
const DWFString zNamespace = L""
throw ( DWFException )
 

Inserts a new string attribute into an open element.

Parameters:
zName The name of the attribute.
zValue The value of the attribute.
zNamespace An optional namespace to add to the attribute.
Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::addCData const DWFString zCData  )  throw ( DWFException )
 

Insert a block of CDATA to the XML data stream.

Parameters:
zCData The CDATA text to add.
Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::attach DWFOutputStream rStream  )  throw ( DWFException )
 

Binds a new output stream to the serializer.

All subsequent output will be written to rStream.

Parameters:
rStream The XML destination stream.
Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::detach  )  throw ( DWFException )
 

Unbinds an output stream from the serializer.

Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::emitXMLHeader  )  throw ( DWFException )
 

Emits the xml header

Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::endElement  )  throw ( DWFException )
 

Closes an open element in the XML data stream.

Exceptions:
DWFException 

_DWFCORE_API void DWFCore::DWFXMLSerializer::insertXMLStream DWFInputStream pInputStream,
bool  bCloseCurrentElement = true
throw ( DWFException )
 

Inserts the contents of the given stream directly into the current XML output. It is assumed that the contents of the stream are valid XML and are encoded in the correct unicode format (i.e. UTF-8).

Parameters:
pInputStream An input stream holding the data to be inserted.
bCloseCurrentElement Forces the current element (header) to be closed before serializing the given stream.
Exceptions:
DWFException 
Since:
7.4.0
Warning:
if bCloseCurrentElement is false, then it is required that the inserted data contain *only* attribute data, with the attribute name and appropriate ="" wrappers around the content, and must not contain any xml elements, cdata, etc. Breaking this rule will most certainly produce mal-formed XML.

_DWFCORE_API const DWFString& DWFCore::DWFXMLSerializer::nextUUID bool  bSquash  )  throw ()
 

Helper utility that provides a unique but sequential UUID that can be used by client code for object IDs, etc.

Sequential IDs are preferred as the compress better resulting in smaller DWF package files.

Parameters:
bSquash If true, the 128-bit uuid will be Base64 encoded into a short form string representation, otherwise the standard form string representation will be returned. The encoding used for the short form string will be non RFC 1521 compliant as detailed in DWFString::EncodeBase64().
Exceptions:
None 

_DWFCORE_API void DWFCore::DWFXMLSerializer::startElement const DWFString zName,
const DWFString zNamespace = L""
throw ( DWFException )
 

Opens a new element tag in the XML data stream.

Parameters:
zName The name of the element.
zNamespace An optional namespace to add to the element.
Exceptions:
DWFException 


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