Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

OutputSAXReceptor Class Reference

Simple SAX receptor used for output. More...

#include <outputsaxreceptor.h>

Inheritance diagram for OutputSAXReceptor:

SAXReceptor UserOfTextCodec SAXBase List of all members.

Public Methods

 OutputSAXReceptor (void)
 A constructor. More...

 OutputSAXReceptor (IODevice *outDevice)
 A constructor. More...

virtual ~OutputSAXReceptor (void)
 A destructor. More...

virtual void setOutputDevice (IODevice *outDevice)
 Set output device. More...

virtual void reportError (void)
 Report error messages. More...

virtual void startElement (void *userData, const XmlChar *name, const XmlChar **atts)
 Start element handler. More...

virtual void endElement (void *userData, const XmlChar *name)
 End element handler. More...

virtual void characterData (void *userData, const XmlChar *data, int length)
 Character data handler. More...

virtual void processingInstruction (void *userData, const XmlChar *target, const XmlChar *data)
 Processing instruction handler. More...

virtual void comment (void *userData, const XmlChar *data)
 Comment handler. More...

virtual void startCDATASection (void *userData)
 Start CDATA section handler. More...

virtual void endCDATASection (void *userData)
 End CDATA section handler. More...

virtual void defaultHandler (void *userData, const XmlChar *data, int length)
 Default handler. More...

virtual int unknownEncoding (void *unknownEncodingData, const XmlChar *name, XML_Encoding *info)
 Unknown encoding handler. More...

virtual void xmlDecl (void *userData, const XmlChar *version, const XmlChar *encoding, int standalone)
 XML declaration handler. More...

virtual void startDoctypeDecl (void *userData, const XmlChar *doctypeName, const XmlChar *systemId, const XmlChar *publicId, int hasInternalSubset)
 Start doctype handler. More...

virtual void endDoctypeDecl (void *userData)
 End doctype handler. More...

virtual void entityDecl (void *userData, const XmlChar *entityName, int isParameterEntity, const XmlChar *value, int valueLength, const XmlChar *base, const XmlChar *systemId, const XmlChar *publicId, const XmlChar *notationName)
 Entity declaration handler. More...

virtual void notationDecl (void *userData, const XmlChar *notationName, const XmlChar *base, const XmlChar *systemId, const XmlChar *publicId)
 Notation declaration handler. More...


Protected Methods

void init (void)
 Initialize the receptor. More...


Protected Attributes

IODeviceoutputDevice
 Pointer to the input device.

bool dtdHasInternalSubset
 Has the DTD an internal subset?

bool inCDATA
 Are we located in the CDATA section?


Detailed Description

Simple SAX receptor used for output.

The receptor translates incoming SAX events into a stream of XML data, and writes it to the output device.

Definition at line 45 of file outputsaxreceptor.h.


Constructor & Destructor Documentation

OutputSAXReceptor::OutputSAXReceptor void   
 

A constructor.

Initialization of the receptor is performed by call to init(). The output device is set to NULL.

Definition at line 93 of file outputsaxreceptor.cpp.

References init, and outputDevice.

OutputSAXReceptor::OutputSAXReceptor IODevice   outDevice
 

A constructor.

Initialization of the receptor is performed by call to init(). The output device is set to given device.

Parameters:
outDevice  The output device to be used by the receptor.

Definition at line 107 of file outputsaxreceptor.cpp.

References init, and outputDevice.

OutputSAXReceptor::~OutputSAXReceptor void    [virtual]
 

A destructor.

The instance of TextCodec is deleted.

Definition at line 118 of file outputsaxreceptor.cpp.

References UserOfTextCodec::deleteDefaultTextCodec.


Member Function Documentation

void OutputSAXReceptor::characterData void *    userData,
const XmlChar *    data,
int    length
[virtual]
 

Character data handler.

Examines the character data and emits an event to the XML model. If the data contain characters &, ', ", < or >, these are substituted by corresponding entities (&amp;, &apos;, &quot;, &lt; or &gt;).

Parameters:
userData  Pointer to the user data structure.
data  Character data.
length  Length of the data.
See also:
OutputSAXReceptor::exposeEvent()

Reimplemented from SAXBase.

Definition at line 224 of file outputsaxreceptor.cpp.

References AMP_REPLACEMENT, ENT_AMP, ENT_APOS, ENT_GT, ENT_LT, ENT_QUOT, inCDATA, OUTPUT_TO_DEVICE, OUTPUT_TO_DEVICE_CHAR, OUTPUT_TO_DEVICE_LENGTH, and XmlChar.

void OutputSAXReceptor::comment void *    userData,
const XmlChar *    data
[virtual]
 

Comment handler.

Outputs corresponding string to the output device.

Parameters:
userData  Pointer to the user data structure.
data  Data of the comment.

Reimplemented from SAXBase.

Definition at line 309 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, and XmlChar.

void OutputSAXReceptor::defaultHandler void *    userData,
const XmlChar *    data,
int    length
[virtual]
 

Default handler.

Outputs the string of given length to the output device.

Parameters:
userData  Pointer to the user data structure.
data  The default data.
length  The length of the default data.

Reimplemented from SAXBase.

Definition at line 352 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE_LENGTH, and XmlChar.

void OutputSAXReceptor::endCDATASection void *    userData [virtual]
 

End CDATA section handler.

Outputs corresponding string to the output device.

Parameters:
userData  Pointer to the user data structure.

Reimplemented from SAXBase.

Definition at line 337 of file outputsaxreceptor.cpp.

References inCDATA, and OUTPUT_TO_DEVICE.

void OutputSAXReceptor::endDoctypeDecl void *    userData [virtual]
 

End doctype handler.

Outputs the end the DTD declaration.

Parameters:
userData  Pointer to the user data structure.

Reimplemented from SAXBase.

Definition at line 481 of file outputsaxreceptor.cpp.

References dtdHasInternalSubset, and OUTPUT_TO_DEVICE.

void OutputSAXReceptor::endElement void *    userData,
const XmlChar *    name
[virtual]
 

End element handler.

Examines the name of the element and emits corresponding event to the XML model.

Parameters:
userData  Pointer to the user data structure.
name  Name of the element.
See also:
OutputSAXReceptor::exposeEvent()

Reimplemented from SAXBase.

Definition at line 204 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, and XmlChar.

void OutputSAXReceptor::entityDecl void *    userData,
const XmlChar *    entityName,
int    isParameterEntity,
const XmlChar *    value,
int    valueLength,
const XmlChar *    base,
const XmlChar *    systemId,
const XmlChar *    publicId,
const XmlChar *    notationName
[virtual]
 

Entity declaration handler.

Outputs the entity declaration.

Parameters:
userData  Pointer to the user data structure.
entityName  The name of the entity.
isParameterEntity  Is the entity a parameter entity?
value  The value of the entity.
valueLength  The length of the value.
base  The base.
systemId  The system id.
publicId  The public id.
notationName  The name of the notation.

Reimplemented from SAXBase.

Definition at line 508 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, OUTPUT_TO_DEVICE_LENGTH, and XmlChar.

void OutputSAXReceptor::init void    [protected]
 

Initialize the receptor.

Initializes some state variables.

Definition at line 127 of file outputsaxreceptor.cpp.

References dtdHasInternalSubset, and inCDATA.

Referenced by OutputSAXReceptor.

void OutputSAXReceptor::notationDecl void *    userData,
const XmlChar *    notationName,
const XmlChar *    base,
const XmlChar *    systemId,
const XmlChar *    publicId
[virtual]
 

Notation declaration handler.

Outputs the notation declaration.

Parameters:
userData  Pointer to the user data structure.
notationName  The name of the notation.
base  The base.
systemId  The system id.
publicId  The public id.

Reimplemented from SAXBase.

Definition at line 569 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, and XmlChar.

void OutputSAXReceptor::processingInstruction void *    userData,
const XmlChar *    target,
const XmlChar *    data
[virtual]
 

Processing instruction handler.

Examines the description of the processing instruction and outputs corresponding string to the output device.

Parameters:
userData  Pointer to the user data structure.
target  Target of the instruction.
data  Data of the instruction.

Reimplemented from SAXBase.

Definition at line 286 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, XmlChar, and xmlchar_strlen.

void OutputSAXReceptor::reportError void    [virtual]
 

Report error messages.

Used for reporting error messages generated by Expat.

Reimplemented from SAXBase.

Definition at line 154 of file outputsaxreceptor.cpp.

References FATAL.

void OutputSAXReceptor::setOutputDevice IODevice   outDevice [virtual]
 

Set output device.

Sets the output device used by the receptor for output.

Parameters:
outDevice  The output device.

Definition at line 140 of file outputsaxreceptor.cpp.

References outputDevice.

void OutputSAXReceptor::startCDATASection void *    userData [virtual]
 

Start CDATA section handler.

Outputs corresponding string to the output device.

Parameters:
userData  Pointer to the user data structure.

Reimplemented from SAXBase.

Definition at line 324 of file outputsaxreceptor.cpp.

References inCDATA, and OUTPUT_TO_DEVICE.

void OutputSAXReceptor::startDoctypeDecl void *    userData,
const XmlChar *    doctypeName,
const XmlChar *    systemId,
const XmlChar *    publicId,
int    hasInternalSubset
[virtual]
 

Start doctype handler.

Outputs the start of the DTD declaration.

Parameters:
userData  Pointer to the user data structure.
doctypeName  The name of the doctype.
systemId  The system id.
publicId  The public id.
hasInternalSubset  Has the DTD an internal subset?

Reimplemented from SAXBase.

Definition at line 438 of file outputsaxreceptor.cpp.

References dtdHasInternalSubset, OUTPUT_TO_DEVICE, and XmlChar.

void OutputSAXReceptor::startElement void *    userData,
const XmlChar *    name,
const XmlChar **    attr
[virtual]
 

Start element handler.

Examines the name of the element and the values of its attributes and emits corresponding events to the XML model.

Parameters:
userData  Pointer to the user data structure.
name  Name of the element.
attr  An array of attributes
See also:
OutputSAXReceptor::exposeEvent()

Reimplemented from SAXBase.

Definition at line 170 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, and XmlChar.

int OutputSAXReceptor::unknownEncoding void *    unknownEncodingData,
const XmlChar *    name,
XML_Encoding *    info
[virtual]
 

Unknown encoding handler.

Does nothing.

Parameters:
unknownEncodingData  The data structure describing the unknown encoding.
name  The name of the encoding.
info  The information about the encoding.
Return values:
1. 

Reimplemented from SAXBase.

Definition at line 370 of file outputsaxreceptor.cpp.

References XmlChar.

void OutputSAXReceptor::xmlDecl void *    userData,
const XmlChar *    version,
const XmlChar *    encoding,
int    standalone
[virtual]
 

XML declaration handler.

Outputs the XML declaration to the output device.

Parameters:
userData  Pointer to the user data structure.
version  The XML version string.
encoding  The document encoding.
standalone  Is the document standalone?

Reimplemented from SAXBase.

Definition at line 388 of file outputsaxreceptor.cpp.

References OUTPUT_TO_DEVICE, and XmlChar.


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 10:43:06 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002