Public Member Functions | List of all members
QXmlReader Class Referenceabstract

The QXmlReader class provides an interface for XML readers (i.e. parsers). More...

#include <qxml.h>

Inheritance diagram for QXmlReader:
QXmlSimpleReader

Public Member Functions

virtual ~QXmlReader ()
 
virtual bool feature (const QString &name, bool *ok=0) const =0
 
virtual void setFeature (const QString &name, bool value)=0
 
virtual bool hasFeature (const QString &name) const =0
 
virtual void * property (const QString &name, bool *ok=0) const =0
 
virtual void setProperty (const QString &name, void *value)=0
 
virtual bool hasProperty (const QString &name) const =0
 
virtual void setEntityResolver (QXmlEntityResolver *handler)=0
 
virtual QXmlEntityResolverentityResolver () const =0
 
virtual void setDTDHandler (QXmlDTDHandler *handler)=0
 
virtual QXmlDTDHandlerDTDHandler () const =0
 
virtual void setContentHandler (QXmlContentHandler *handler)=0
 
virtual QXmlContentHandlercontentHandler () const =0
 
virtual void setErrorHandler (QXmlErrorHandler *handler)=0
 
virtual QXmlErrorHandlererrorHandler () const =0
 
virtual void setLexicalHandler (QXmlLexicalHandler *handler)=0
 
virtual QXmlLexicalHandlerlexicalHandler () const =0
 
virtual void setDeclHandler (QXmlDeclHandler *handler)=0
 
virtual QXmlDeclHandlerdeclHandler () const =0
 
virtual bool parse (const QXmlInputSource &input)=0
 

Detailed Description

The QXmlReader class provides an interface for XML readers (i.e. parsers).

XML

This abstract class describes an interface for all XML readers in Qt. At the moment there is only one implementation of a reader included in the XML module of Qt (QXmlSimpleReader). In future releases there might be more readers with different properties available (e.g. a validating parser).

The design of the XML classes follow the SAX2 java interface. It was adopted to fit into the Qt naming conventions; so it should be very easy for anybody who has worked with SAX2 to get started with the Qt XML classes.

All readers use the class QXmlInputSource to read the input document from. Since you are normally interested in certain contents of the XML document, the reader reports those contents through special handler classes (QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler and QXmlLexicalHandler).

You have to subclass these classes. Since the handler classes describe only interfaces you must implement all functions; there is a class (QXmlDefaultHandler) to make this easier; it implements a default behaviour (do nothing) for all functions.

For getting started see also the Quick start.

See also
QXmlSimpleReader

Definition at line 213 of file qxml.h.

Constructor & Destructor Documentation

virtual QXmlReader::~QXmlReader ( )
inlinevirtual

Definition at line 216 of file qxml.h.

216 {}

Member Function Documentation

QXmlContentHandler * QXmlReader::contentHandler ( ) const
pure virtual

Returns the content handler or 0 if none was set.

See also
setContentHandler()

Implemented in QXmlSimpleReader.

QXmlDeclHandler * QXmlReader::declHandler ( ) const
pure virtual

Returns the declaration handler or 0 if none was set.

See also
setDeclHandler()

Implemented in QXmlSimpleReader.

QXmlDTDHandler * QXmlReader::DTDHandler ( ) const
pure virtual

Returns the DTD handler or 0 if none was set.

See also
setDTDHandler()

Implemented in QXmlSimpleReader.

QXmlEntityResolver * QXmlReader::entityResolver ( ) const
pure virtual

Returns the entity resolver or 0 if none was set.

See also
setEntityResolver()

Implemented in QXmlSimpleReader.

QXmlErrorHandler * QXmlReader::errorHandler ( ) const
pure virtual

Returns the error handler or 0 if none was set

See also
setErrorHandler()

Implemented in QXmlSimpleReader.

bool QXmlReader::feature ( const QString name,
bool ok = 0 
) const
pure virtual

If the reader has the feature name, this function returns the value of the feature.

If the reader has not the feature name, the return value may be anything.

If ok is not 0, then ok is set to TRUE if the reader has the feature name, otherwise ok is set to FALSE.

See also
setFeature() hasFeature()

Implemented in QXmlSimpleReader.

bool QXmlReader::hasFeature ( const QString name) const
pure virtual

Returns TRUE if the reader has the feature name, otherwise FALSE.

See also
feature() setFeature()

Implemented in QXmlSimpleReader.

bool QXmlReader::hasProperty ( const QString name) const
pure virtual

Returns TRUE if the reader has the property name, otherwise FALSE.

See also
property() setProperty()

Implemented in QXmlSimpleReader.

QXmlLexicalHandler * QXmlReader::lexicalHandler ( ) const
pure virtual

Returns the lexical handler or 0 if none was set.

See also
setLexicalHandler()

Implemented in QXmlSimpleReader.

bool QXmlReader::parse ( const QXmlInputSource input)
pure virtual

Parses the XML document input. Returns TRUE if the parsing was successful, otherwise FALSE.

Parses the XML document at the location systemId. Returns TRUE if the parsing was successful, otherwise FALSE.

Implemented in QXmlSimpleReader.

void * QXmlReader::property ( const QString name,
bool ok = 0 
) const
pure virtual

If the reader has the property name, this function returns the value of the property.

If the reader has not the property name, the return value is 0.

If ok is not 0, then ok is set to TRUE if the reader has the property name, otherwise ok is set to FALSE.

See also
setProperty() hasProperty()

Implemented in QXmlSimpleReader.

void QXmlReader::setContentHandler ( QXmlContentHandler handler)
pure virtual

Sets the content handler to handler.

See also
contentHandler()

Implemented in QXmlSimpleReader.

void QXmlReader::setDeclHandler ( QXmlDeclHandler handler)
pure virtual

Sets the declaration handler to handler.

See also
declHandler()

Implemented in QXmlSimpleReader.

void QXmlReader::setDTDHandler ( QXmlDTDHandler handler)
pure virtual

Sets the DTD handler to handler.

See also
DTDHandler()

Implemented in QXmlSimpleReader.

void QXmlReader::setEntityResolver ( QXmlEntityResolver handler)
pure virtual

Sets the entity resolver to handler.

See also
entityResolver()

Implemented in QXmlSimpleReader.

void QXmlReader::setErrorHandler ( QXmlErrorHandler handler)
pure virtual

Sets the error handler to handler.

See also
errorHandler()

Implemented in QXmlSimpleReader.

void QXmlReader::setFeature ( const QString name,
bool  value 
)
pure virtual

Sets the feature name to value. If the reader has not the feature name, this value is ignored.

See also
feature() hasFeature()

Implemented in QXmlSimpleReader.

void QXmlReader::setLexicalHandler ( QXmlLexicalHandler handler)
pure virtual

Sets the lexical handler to handler.

See also
lexicalHandler()

Implemented in QXmlSimpleReader.

void QXmlReader::setProperty ( const QString name,
void *  value 
)
pure virtual

Sets the property name to value. If the reader has not the property name, this value is ignored.

See also
property() hasProperty()

Implemented in QXmlSimpleReader.


The documentation for this class was generated from the following files: