You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqxmlreader.3qt

207 lines
9.1 KiB

'\" t
.TH TQXmlReader 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQXmlReader \- Interface for XML readers (i.e. parsers)
.SH SYNOPSIS
All the functions in this class are reentrant when TQt is built with thread support.</p>
.PP
\fC#include <tqxml.h>\fR
.PP
Inherited by TQXmlSimpleReader.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "virtual bool \fBfeature\fR ( const TQString & name, bool * ok = 0 ) const = 0"
.br
.ti -1c
.BI "virtual void \fBsetFeature\fR ( const TQString & name, bool value ) = 0"
.br
.ti -1c
.BI "virtual bool \fBhasFeature\fR ( const TQString & name ) const = 0"
.br
.ti -1c
.BI "virtual void * \fBproperty\fR ( const TQString & name, bool * ok = 0 ) const = 0"
.br
.ti -1c
.BI "virtual void \fBsetProperty\fR ( const TQString & name, void * value ) = 0"
.br
.ti -1c
.BI "virtual bool \fBhasProperty\fR ( const TQString & name ) const = 0"
.br
.ti -1c
.BI "virtual void \fBsetEntityResolver\fR ( TQXmlEntityResolver * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlEntityResolver * \fBentityResolver\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetDTDHandler\fR ( TQXmlDTDHandler * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlDTDHandler * \fBDTDHandler\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetContentHandler\fR ( TQXmlContentHandler * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlContentHandler * \fBcontentHandler\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetErrorHandler\fR ( TQXmlErrorHandler * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlErrorHandler * \fBerrorHandler\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetLexicalHandler\fR ( TQXmlLexicalHandler * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlLexicalHandler * \fBlexicalHandler\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetDeclHandler\fR ( TQXmlDeclHandler * handler ) = 0"
.br
.ti -1c
.BI "virtual TQXmlDeclHandler * \fBdeclHandler\fR () const = 0"
.br
.ti -1c
.BI "virtual bool parse ( const TQXmlInputSource & input ) = 0 \fI(obsolete)\fR"
.br
.ti -1c
.BI "virtual bool \fBparse\fR ( const TQXmlInputSource * input ) = 0"
.br
.in -1c
.SH DESCRIPTION
The TQXmlReader class provides an interface for XML readers (i.e. parsers).
.PP
This abstract class provides an interface for all of Qt's XML readers. Currently there is only one implementation of a reader included in Qt's XML module: TQXmlSimpleReader. In future releases there might be more readers with different properties available (e.g. a validating parser).
.PP
The design of the XML classes follows the SAX2 Java interface, with the names adapted to fit TQt naming conventions. It should be very easy for anybody who has worked with SAX2 to get started with the TQt XML classes.
.PP
All readers use the class TQXmlInputSource to read the input document. Since you are normally interested in particular content in the XML document, the reader reports the content through special handler classes (TQXmlDTDHandler, TQXmlDeclHandler, TQXmlContentHandler, TQXmlEntityResolver, TQXmlErrorHandler and TQXmlLexicalHandler), which you must subclass, if you want to process the contents.
.PP
Since the handler classes only describe interfaces you must implement all the functions. We provide the TQXmlDefaultHandler class to make this easier: it implements a default behaviour (do nothing) for all functions, so you can subclass it and just implement the functions you are interested in.
.PP
Features and properties of the reader can be set with setFeature() and setProperty() respectively. You can set the reader to use your own subclasses with setEntityResolver(), setDTDHandler(), setContentHandler(), setErrorHandler(), setLexicalHandler() and setDeclHandler(). The parse itself is started with a call to parse().
.PP
See also TQXmlSimpleReader and XML.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQXmlDTDHandler * TQXmlReader::DTDHandler () const\fC [pure virtual]\fR"
Returns the DTD handler or 0 if none was set.
.PP
See also setDTDHandler().
.SH "TQXmlContentHandler * TQXmlReader::contentHandler () const\fC [pure virtual]\fR"
Returns the content handler or 0 if none was set.
.PP
See also setContentHandler().
.SH "TQXmlDeclHandler * TQXmlReader::declHandler () const\fC [pure virtual]\fR"
Returns the declaration handler or 0 if none was set.
.PP
See also setDeclHandler().
.SH "TQXmlEntityResolver * TQXmlReader::entityResolver () const\fC [pure virtual]\fR"
Returns the entity resolver or 0 if none was set.
.PP
See also setEntityResolver().
.SH "TQXmlErrorHandler * TQXmlReader::errorHandler () const\fC [pure virtual]\fR"
Returns the error handler or 0 if none is set.
.PP
See also setErrorHandler().
.SH "bool TQXmlReader::feature ( const TQString & name, bool * ok = 0 ) const\fC [pure virtual]\fR"
If the reader has the feature called \fIname\fR, the feature's value is returned. If no such feature exists the return value is undefined.
.PP
If \fIok\fR is not 0: \fI*ok\fR is set to TRUE if the reader has the feature called \fIname\fR; otherwise \fI*ok\fR is set to FALSE.
.PP
See also setFeature() and hasFeature().
.SH "bool TQXmlReader::hasFeature ( const TQString & name ) const\fC [pure virtual]\fR"
Returns \fCTRUE\fR if the reader has the feature called \fIname\fR; otherwise returns FALSE.
.PP
See also feature() and setFeature().
.SH "bool TQXmlReader::hasProperty ( const TQString & name ) const\fC [pure virtual]\fR"
Returns TRUE if the reader has the property \fIname\fR; otherwise returns FALSE.
.PP
See also property() and setProperty().
.SH "TQXmlLexicalHandler * TQXmlReader::lexicalHandler () const\fC [pure virtual]\fR"
Returns the lexical handler or 0 if none was set.
.PP
See also setLexicalHandler().
.SH "bool TQXmlReader::parse ( const TQXmlInputSource * input )\fC [pure virtual]\fR"
Reads an XML document from \fIinput\fR and parses it. Returns TRUE if the parsing was successful; otherwise returns FALSE.
.PP
Example: xml/tagreader/tagreader.cpp.
.SH "bool TQXmlReader::parse ( const TQXmlInputSource & input )\fC [pure virtual]\fR"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.SH "void * TQXmlReader::property ( const TQString & name, bool * ok = 0 ) const\fC [pure virtual]\fR"
If the reader has the property \fIname\fR, this function returns the value of the property; otherwise the return value is undefined.
.PP
If \fIok\fR is not 0: if the reader has the \fIname\fR property \fI*ok\fR is set to TRUE; otherwise \fI*ok\fR is set to FALSE.
.PP
See also setProperty() and hasProperty().
.SH "void TQXmlReader::setContentHandler ( TQXmlContentHandler * handler )\fC [pure virtual]\fR"
Sets the content handler to \fIhandler\fR.
.PP
See also contentHandler().
.PP
Example: xml/tagreader/tagreader.cpp.
.SH "void TQXmlReader::setDTDHandler ( TQXmlDTDHandler * handler )\fC [pure virtual]\fR"
Sets the DTD handler to \fIhandler\fR.
.PP
See also DTDHandler().
.SH "void TQXmlReader::setDeclHandler ( TQXmlDeclHandler * handler )\fC [pure virtual]\fR"
Sets the declaration handler to \fIhandler\fR.
.PP
See also declHandler().
.SH "void TQXmlReader::setEntityResolver ( TQXmlEntityResolver * handler )\fC [pure virtual]\fR"
Sets the entity resolver to \fIhandler\fR.
.PP
See also entityResolver().
.SH "void TQXmlReader::setErrorHandler ( TQXmlErrorHandler * handler )\fC [pure virtual]\fR"
Sets the error handler to \fIhandler\fR. Clears the error handler if \fIhandler\fR is 0.
.PP
See also errorHandler().
.SH "void TQXmlReader::setFeature ( const TQString & name, bool value )\fC [pure virtual]\fR"
Sets the feature called \fIname\fR to the given \fIvalue\fR. If the reader doesn't have the feature nothing happens.
.PP
See also feature() and hasFeature().
.PP
Reimplemented in TQXmlSimpleReader.
.SH "void TQXmlReader::setLexicalHandler ( TQXmlLexicalHandler * handler )\fC [pure virtual]\fR"
Sets the lexical handler to \fIhandler\fR.
.PP
See also lexicalHandler().
.SH "void TQXmlReader::setProperty ( const TQString & name, void * value )\fC [pure virtual]\fR"
Sets the property \fIname\fR to \fIvalue\fR. If the reader doesn't have the property nothing happens.
.PP
See also property() and hasProperty().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqxmlreader.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqxmlreader.3qt) and the Qt
version (3.3.8).