описание класса QXmlReaderКласс QXmlReader предоставляет интерфейс для XML читателей (т.е. анализаторов). Далее... #include <QXmlReader> Inherited by: QXmlSimpleReader. Замечание: Все функции в этом классе реентерабельны. Открытые функции
Подробное описаниеКласс QXmlReader предоставляет интерфейс для XML читателей (т.е. анализаторов). Этот абстрактный класс представляет собой интерфейс всех XML читателей в Qt. Currently there is only one implementation of a reader included in Qt's XML module: QXmlSimpleReader. In future releases there might be more readers with different properties available (e.g. a validating parser). The design of the XML classes follows the SAX2 Java interface, with the names adapted to fit Qt naming conventions. 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. Since you are normally interested in particular content in the XML document, the reader reports the content through special handler classes (QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler and QXmlLexicalHandler), which you must subclass, if you want to process the contents. Since the handler classes only describe interfaces you must implement all the functions. We provide the QXmlDefaultHandler class to make this easier: it implements a default behavior (do nothing) for all functions, so you can subclass it and just implement the functions you are interested in. 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(). Смотрите также QXmlSimpleReader. Описание функций-членовQXmlReader::~QXmlReader () [virtual]Destroys the reader. QXmlDTDHandler * QXmlReader::DTDHandler () const [pure virtual]Returns the DTD handler or 0 if none was set. See also setDTDHandler(). QXmlContentHandler * QXmlReader::contentHandler () const [pure virtual]Returns the content handler or 0 if none was set. See also setContentHandler(). QXmlDeclHandler * QXmlReader::declHandler () const [pure virtual]Returns the declaration handler or 0 if none was set. See also setDeclHandler(). QXmlEntityResolver * QXmlReader::entityResolver () const [pure virtual]Returns the entity resolver or 0 if none was set. See also setEntityResolver(). QXmlErrorHandler * QXmlReader::errorHandler () const [pure virtual]Returns the error handler or 0 if none is set. See also setErrorHandler(). bool QXmlReader::feature ( const QString & name, bool * ok = 0 ) const [pure virtual]If the reader has the feature called name, the feature's value is returned. If no such feature exists the return value is undefined. If ok is not 0: *ok is set to true if the reader has the feature called name; otherwise *ok is set to false. See also setFeature() and hasFeature(). bool QXmlReader::hasFeature ( const QString & name ) const [pure virtual]Returns true if the reader has the feature called name; otherwise returns false. See also feature() and setFeature(). bool QXmlReader::hasProperty ( const QString & name ) const [pure virtual]Returns true if the reader has the property name; otherwise returns false. See also property() and setProperty(). QXmlLexicalHandler * QXmlReader::lexicalHandler () const [pure virtual]Returns the lexical handler or 0 if none was set. See also setLexicalHandler(). bool QXmlReader::parse ( const QXmlInputSource * input ) [pure virtual]Reads an XML document from input and parses it. Returns true if the parsing was successful; otherwise returns false. 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; otherwise the return value is undefined. If ok is not 0: if the reader has the name property *ok is set to true; otherwise *ok is set to false. See also setProperty() and hasProperty(). void QXmlReader::setContentHandler ( QXmlContentHandler * handler ) [pure virtual]Устаравливает обработчик содержимого в handler. See also contentHandler(). void QXmlReader::setDTDHandler ( QXmlDTDHandler * handler ) [pure virtual]Устанавливает DTD обработчик в handler. See also DTDHandler(). void QXmlReader::setDeclHandler ( QXmlDeclHandler * handler ) [pure virtual]Устанавливает обработчик деклараций в handler. See also declHandler(). void QXmlReader::setEntityResolver ( QXmlEntityResolver * handler ) [pure virtual]Устанавливает разрешатель сущностей в handler. See also entityResolver(). void QXmlReader::setErrorHandler ( QXmlErrorHandler * handler ) [pure virtual]Устанавливает handler обработчиком ошибок. Очищает обработчик ошибок, если handler равен 0. See also errorHandler(). void QXmlReader::setFeature ( const QString & name, bool value ) [pure virtual]Задаёт функции с именем name переданное значение value. Если читатель не имеет означенной функции, ничего не происходит. See also feature() and hasFeature(). void QXmlReader::setLexicalHandler ( QXmlLexicalHandler * handler ) [pure virtual]Устанавливает лексический обработчик в handler. See also lexicalHandler(). void QXmlReader::setProperty ( const QString & name, void * value ) [pure virtual]Устанавливает свойство name в value. Если читатель не имеет означенного свойства, ничего не происходит. See also property() and hasProperty(). |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |