Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

DWFToolkit::DWFXMLCallback Class Reference
[DWF Package API]

#include "dwf/package/XML.h"

Inheritance diagram for DWFToolkit::DWFXMLCallback:

Inheritance graph
[legend]
Collaboration diagram for DWFToolkit::DWFXMLCallback:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class integrates with the Expat XML parser.
Since:
7.0.1.

The Expat XML parser uses a static callback function API, which doesn't lend itself well to multi-threaded applications directly. Classes interested in participating in XML parsing must implement this interface and set themselves as the UserData pointer on the parser.

Examples:

SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 77 of file XML.h.

Public Member Functions

virtual _DWFTK_API ~DWFXMLCallback () throw ()
virtual _DWFTK_API void notifyStartElement (const char *zName, const char **ppAttributeList)=0 throw ()
virtual _DWFTK_API void notifyEndElement (const char *zName)=0 throw ()
virtual _DWFTK_API void notifyStartNamespace (const char *zPrefix, const char *zURI)=0 throw ()
virtual _DWFTK_API void notifyEndNamespace (const char *zPrefix)=0 throw ()
virtual _DWFTK_API void notifyCharacterData (const char *zCData, int nLength)=0 throw ()
_DWFTK_API void setStreamFilter (DWFBufferInputStream *pFilter, bool bOwnFilter) throw ()
_DWFTK_API DWFBufferInputStreamgetStreamFilter () const throw ()

Protected Member Functions

_DWFTK_API DWFXMLCallback () throw ()


Constructor & Destructor Documentation

virtual _DWFTK_API DWFToolkit::DWFXMLCallback::~DWFXMLCallback  )  throw () [inline, virtual]
 

Destructor

Exceptions:
None 

Definition at line 88 of file XML.h.

_DWFTK_API DWFToolkit::DWFXMLCallback::DWFXMLCallback  )  throw () [inline, protected]
 

Constructor

Exceptions:
None 

Definition at line 236 of file XML.h.


Member Function Documentation

_DWFTK_API DWFBufferInputStream* DWFToolkit::DWFXMLCallback::getStreamFilter  )  const throw () [inline]
 

Returns the XML source stream filter, if one exists.

Returns:
A pointer to the filter stream (may be NULL) - must not be delete by the caller.
Exceptions:
None 

Definition at line 222 of file XML.h.

virtual _DWFTK_API void DWFToolkit::DWFXMLCallback::notifyCharacterData const char *  zCData,
int  nLength
throw () [pure virtual]
 

This method is notified by the static XML_CharacterDataHandler Expat parser callback function.

It is possible that this callback will be invoked a number of times for a single CDATA block; there is no requirement that zCData contain all the text in the block.

Todo:
Notifications for XML_StartCdataSectionHandler and XML_EndCdataSectionHandler static callbacks are currently not implemented and should be.
Parameters:
zCData A non-null-terminated string of CDATA.
nLength The number of characters in zCData.
Exceptions:
None 

Implemented in DWFToolkit::DWFObjectDefinitionReader, DWFToolkit::DWFManifestReader, and DWFToolkit::DWFSectionDescriptorReader.

virtual _DWFTK_API void DWFToolkit::DWFXMLCallback::notifyEndElement const char *  zName  )  throw () [pure virtual]
 

This method is notified by the static XML_EndElementHandler Expat parser callback function.

Parameters:
zName The name of the element (includes any namespace prefix)
Exceptions:
None 

Implemented in DWFToolkit::DWFEModelSectionDescriptorReader, DWFToolkit::DWFEPlotSectionDescriptorReader, DWFToolkit::DWFGlobalSectionDescriptorReader, DWFToolkit::DWFObjectDefinitionReader, DWFToolkit::DWFManifestReader, and DWFToolkit::DWFSectionDescriptorReader.

virtual _DWFTK_API void DWFToolkit::DWFXMLCallback::notifyEndNamespace const char *  zPrefix  )  throw () [pure virtual]
 

This method is notified by the static XML_EndNamespaceDeclHandler Expat parser callback function.

This callback is not currently used.

Parameters:
zPrefix The namespace prefix.
Exceptions:
None 

Implemented in DWFToolkit::DWFEModelSectionDescriptorReader, DWFToolkit::DWFEPlotSectionDescriptorReader, DWFToolkit::DWFGlobalSectionDescriptorReader, DWFToolkit::DWFObjectDefinitionReader, DWFToolkit::DWFManifestReader, and DWFToolkit::DWFSectionDescriptorReader.

virtual _DWFTK_API void DWFToolkit::DWFXMLCallback::notifyStartElement const char *  zName,
const char **  ppAttributeList
throw () [pure virtual]
 

This method is notified by the static XML_StartElementHandler Expat parser callback function.

Attribute list processing example:

                 size_t iAttrib = 0;
       
                 for(; ppAttributeList[iAttrib]; iAttrib += 2)
                 {
                    //
                    // dump attribute 
                    //
                    cout << "Attribute Name: " << ppAttributeList[iAttrib] << " ";
                    cout << "Attribute Value: " << ppAttributeList[iAttrib+1] << endl;
                }

Parameters:
zName The name of the element (includes any namespace prefix)
ppAttributeList An array of null-terminated atribute name, value string pairs. The array itself is zero-terminated.
Exceptions:
None 

Implemented in DWFToolkit::DWFEModelSectionDescriptorReader, DWFToolkit::DWFEPlotSectionDescriptorReader, DWFToolkit::DWFGlobalSectionDescriptorReader, DWFToolkit::DWFObjectDefinitionReader, DWFToolkit::DWFManifestReader, and DWFToolkit::DWFSectionDescriptorReader.

virtual _DWFTK_API void DWFToolkit::DWFXMLCallback::notifyStartNamespace const char *  zPrefix,
const char *  zURI
throw () [pure virtual]
 

This method is notified by the static XML_StartNamespaceDeclHandler Expat parser callback function.

This callback is not currently used.

Parameters:
zPrefix The namespace prefix.
zURI The namespace URI (may be NULL).
Exceptions:
None 

Implemented in DWFToolkit::DWFEModelSectionDescriptorReader, DWFToolkit::DWFEPlotSectionDescriptorReader, DWFToolkit::DWFGlobalSectionDescriptorReader, DWFToolkit::DWFObjectDefinitionReader, DWFToolkit::DWFManifestReader, and DWFToolkit::DWFSectionDescriptorReader.

_DWFTK_API void DWFToolkit::DWFXMLCallback::setStreamFilter DWFBufferInputStream pFilter,
bool  bOwnFilter
throw () [inline]
 

by the parser to filter the source XML byte stream.

There may be cases when the original XML data must be examined or even modified prior to its hitting the Expat parser. In these cases, use another stream to filter the incoming bytes before providing them to the parser.

Parameters:
pFilter The filtering stream. If ownership is to be transferred to this object, pFilter must be allocated with the DWFCORE_ALLOC_OBJECT macro.
bOwnFilter If true, this object will delete pFilter using the DWFCORE_FREE_OBJECT object; if false, the caller is reponsible for managing the lifetime of pFilter.
Exceptions:
None 
Examples:
SimpleEnumReader/SimpleEnumReader.cpp.

Definition at line 202 of file XML.h.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:39:11 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1