DWFCore::DWFXMLCallback Interface Reference

#include <dwfcore/XML.h>

Collaboration diagram for DWFCore::DWFXMLCallback:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class integrates with the Expat XML parser.

Since:
7.4
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.

Definition at line 44 of file XML.h.

Public Member Functions

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

Protected Member Functions

_DWFCORE_API DWFXMLCallback () throw ()

Protected Attributes

unsigned int _nElementDepth
unsigned int _nNamespaceDepth


Constructor & Destructor Documentation

virtual _DWFCORE_API DWFCore::DWFXMLCallback::~DWFXMLCallback  )  throw () [inline, virtual]
 

Destructor

Exceptions:
None 

Definition at line 55 of file XML.h.

_DWFCORE_API DWFCore::DWFXMLCallback::DWFXMLCallback  )  throw () [inline, protected]
 

Constructor

Exceptions:
None 

Definition at line 203 of file XML.h.


Member Function Documentation

_DWFCORE_API DWFBufferInputStream* DWFCore::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 deleted by the caller.
Exceptions:
None 

Definition at line 189 of file XML.h.

virtual _DWFCORE_API void DWFCore::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 implemented.
Parameters:
zCData A non-null-terminated string of CDATA.
nLength The number of characters in zCData.
Exceptions:
None 

virtual _DWFCORE_API void DWFCore::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 

virtual _DWFCORE_API void DWFCore::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 

virtual _DWFCORE_API void DWFCore::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 

virtual _DWFCORE_API void DWFCore::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 

_DWFCORE_API void DWFCore::DWFXMLCallback::setStreamFilter DWFBufferInputStream pFilter,
bool  bOwnFilter
throw () [inline]
 

This method attaches a stream that can be should be used 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 

Definition at line 169 of file XML.h.


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