Описание класса QXmlStreamReader
|
Константа | Значение | Описание |
---|---|---|
QXmlStreamReader::NoError | 0 | Нет ошибок. |
QXmlStreamReader::CustomError | 2 | Собственная ошибка была инициирована с помощью raiseError() |
QXmlStreamReader::NotWellFormedError | 3 | Анализатор вызвал внутреннюю ошибку, так как XML содержит синтаксические ошибки. |
QXmlStreamReader::PrematureEndOfDocumentError | 4 | The input stream ended before a well-formed XML document was parsed. Recovery from this error is possible if more XML arrives in the stream, either by calling addData() or by waiting for it to arrive on the device(). |
QXmlStreamReader::UnexpectedElementError | 1 | Анализатор встретил неожиданный элемент. |
Это перечисление определяет типы маркеров, которые только что были прочитаны.
Константа | Значение | Описание |
---|---|---|
QXmlStreamReader::NoToken | 0 | Пока не прочитано ни одно маркера. |
QXmlStreamReader::Invalid | 1 | Произошла ошибка, подробнее в error() и errorString(). |
QXmlStreamReader::StartDocument | 2 | Читатель сообщает о номере версии XML в documentVersion() и о кодировке XML документа в documentEncoding(). Если документ определён как самостоятельный, isStandaloneDocument() вернёт true; в противном случае возвращается false. |
QXmlStreamReader::EndDocument | 3 | Читатель сообщает о конце документа. |
QXmlStreamReader::StartElement | 4 | Читатель сообщает о начале элемента с URI пространства имён namespaceUri() и именем name(). О пустых элементах также сообщается в виде StartElement с последующим сразу EndElement. Вспомогательная функция readElementText() может быть вызвана для объединения всего содержимого до соответствующего EndElement. Об атрибутах сообщается в attributes(), пространства имён декларируются в namespaceDeclarations(). |
QXmlStreamReader::EndElement | 5 | Читатель сообщает о конце элемента с URI пространства имён namespaceUri() и именем name(). |
QXmlStreamReader::Characters | 6 | Читатель сообщает о символах в text(). Если полученый текст состоит из символов пустого пространства, isWhitespace() вернёт true. Если полученный текст из области CDATA, isCDATA() вернёт true. |
QXmlStreamReader::Comment | 7 | Читатель сообщает о комментарии в text(). |
QXmlStreamReader::DTD | 8 | Читатель сообщает о DTD в text(), о нотации декларации в notationDeclarations() о сущности декларации в entityDeclarations(). Детали декларации DTD доступны в dtdName(), dtdPublicId() и dtdSystemId(). |
QXmlStreamReader::EntityReference | 9 | Читатель сообщает о ссылке на сущность, которая не может быть разрешена. Имя ссылки на сущность сообщается в name(), заменяемый текст - вtext(). |
QXmlStreamReader::ProcessingInstruction | 10 | Читатель сообщает о инструкции обработки в processingInstructionTarget() и processingInstructionData(). |
флаг обработки пространств имён потоком чтения
Это свойство определяет, обрабатывает или нет поток пространства имён. Если оно включено, читатель будет обрабатывать пространства имён, в противном случае - нет.
По-умолчанию обработка пространств имён включена.
Функции доступа:
Создаёт поток чтения.
Смотрите также setDevice() и addData().
Создаёт поток чтения, который рабтает с устройством device.
Смотрите также setDevice() и clear().
Создаёт поток чтения, который читает с data.
Смотрите также addData(), clear() и setDevice().
Создаёт поток чтения, который читает с data.
Смотрите также addData(), clear() и setDevice().
Создаёт поток чтения, который читает с data.
Смотрите также addData(), clear() и setDevice().
Уничтожает объект читателя.
Добавляет больше данных data в поток для чтения. This function does nothing if the reader has a device().
See also readNext() and clear().
Добавляет больше данных data в поток для чтения. This function does nothing if the reader has a device().
See also readNext() and clear().
Добавляет больше данных data в поток для чтения. This function does nothing if the reader has a device().
See also readNext() and clear().
Добавляет extraNamespaceDeclaration. Декларация будет действительной для детей текущего элемента или - при вызове этой функции до чтения всех элементов - для всего XML документа.
Эта функция была введена в Qt 4.4.
Смотрите также namespaceDeclarations(), addExtraNamespaceDeclarations() и setNamespaceProcessing().
Добавляет вектор деклараций, определённых в extraNamespaceDeclarations.
Эта функция была введена в Qt 4.4.
Смотрите также namespaceDeclarations() и addExtraNamespaceDeclaration().
Returns true if the reader has read until the end of the XML document, or if an error() has occurred and reading has been aborted. Otherwise, it returns false.
When atEnd() and hasError() return true and error() returns PrematureEndOfDocumentError, it means the XML has been well-formed so far, but a complete XML document has not been parsed. The next chunk of XML can be added with addData(), if the XML is being read from a QByteArray, or by waiting for more data to arrive if the XML is being read from a QIODevice. Either way, atEnd() will return false once more adata is available.
See also hasError(), error(), device(), and QIODevice::atEnd().
Returns the attributes of a StartElement.
Returns the current character offset, starting with 0.
See also lineNumber() and columnNumber().
Removes any device() or data from the reader and resets its internal state to the initial state.
See also addData().
Returns the current column number, starting with 0.
See also lineNumber() and characterOffset().
Returns the current device associated with the QXmlStreamReader, or 0 if no device has been assigned.
Смотрите также setDevice().
If the state() is StartDocument, this function returns the encoding string as specified in the XML declaration. В противном случае возвращается пустая строка.
Эта функция была введена в Qt 4.4.
If the state() is StartDocument, this function returns the version string as specified in the XML declaration. В противном случае возвращается пустая строка.
Эта функция была введена в Qt 4.4.
If the state() is DTD, this function returns the DTD's name. В противном случае возвращается пустая строка.
Эта функция была введена в Qt 4.4.
If the state() is DTD, this function returns the DTD's public identifier. В противном случае возвращается пустая строка.
Эта функция была введена в Qt 4.4.
If the state() is DTD, this function returns the DTD's system identifier. В противном случае возвращается пустая строка.
Эта функция была введена в Qt 4.4.
If the state() is DTD, this function returns the DTD's unparsed (external) entity declarations. Otherwise an empty vector is returned.
The QXmlStreamEntityDeclarations class is defined to be a QVector of QXmlStreamEntityDeclaration.
Returns the entity resolver, or 0 if there is no entity resolver.
Эта функция была введена в Qt 4.4.
See also setEntityResolver().
Returns the type of the current error, or NoError if no error occurred.
See also errorString() and raiseError().
Returns the error message that was set with raiseError().
See also error(), lineNumber(), columnNumber(), and characterOffset().
Returns true if an error has occurred, otherwise false.
See also errorString() and error().
Returns true if the reader reports characters that stem from a CDATA section; otherwise returns false.
Смотрите также isCharacters() и text().
Возвращает true, если tokenType() равен Characters; в противном случае возвращает false.
Смотрите также isWhitespace() и isCDATA().
Возвращает true, если tokenType() равен Comment; в противном случае возвращает false.
Возвращает true, если tokenType() равен DTD; в противном случае возвращает false.
Возвращает true, если tokenType() равен EndDocument; в противном случае возвращает false.
Возвращает true, если tokenType() равен EndElement; в противном случае возвращает false.
Возвращает true, если tokenType() равен EntityReference; в противном случае возвращает false.
Возвращает true, если tokenType() равен ProcessingInstruction; в противном случае возвращает false.
Возвращает true, если текущий документ был объявлен автономным в декларации XML; в противном случае возвращает false.
Если не было проанализировано XML декларации, эта функция вернёт false.
Возвращает true, если tokenType() равен StartDocument; в противном случае возвращает false.
Возвращает true, если tokenType() равен StartElement; в противном случае возвращает false.
Возвращает true, если отчёт читателя содержит только символы пустого пространства; в противном случае возвращает false.
Смотрите также isCharacters() и text().
Возвращает текущий номер строки, начиная с 1.
Смотрите также columnNumber() и characterOffset().
Returns the local name of a StartElement, EndElement, or an EntityReference.
See also namespaceUri() and qualifiedName().
If the state() is StartElement, this function returns the element's namespace declarations. Otherwise an empty vector is returned.
The QXmlStreamNamespaceDeclaration class is defined to be a QVector of QXmlStreamNamespaceDeclaration.
See also addExtraNamespaceDeclaration() and addExtraNamespaceDeclarations().
Returns the namespaceUri of a StartElement or EndElement.
See also name() and qualifiedName().
If the state() is DTD, this function returns the DTD's notation declarations. Otherwise an empty vector is returned.
The QXmlStreamNotationDeclarations class is defined to be a QVector of QXmlStreamNotationDeclaration.
Returns the prefix of a StartElement or EndElement.
Эта функция была введена в Qt 4.4.
See also name() and qualifiedName().
Returns the data of a ProcessingInstruction.
Returns the target of a ProcessingInstruction.
Returns the qualified name of a StartElement or EndElement;
A qualified name is the raw name of an element in the XML data. It consists of the namespace prefix, followed by colon, followed by the element's local name. Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you shouldn't use qualifiedName(), but the resolved namespaceUri() and the attribute's local name().
See also name(), prefix(), and namespaceUri().
Raises a custom error with an optional error message.
Смотрите также error() и errorString().
Вспомогательная функция, вызываемая, если прочитан StartElement. Читает пока не встретится EndElement и возвращает текст между элементами. In case of no error, the current token (see tokenType()) after having called this function is EndElement.
The function concatenates text() when it reads either Characters or EntityReference tokens, but skips ProcessingInstruction and Comment. In case anything else is read before reaching EndElement, the function returns what it read so far and raises an UnexpectedElementError. Если текущий символ не StartElement, возвращается пустая строка.
Читает следующий символ и возвращает его тип.
With one exception, once an error() is reported by readNext(), further reading of the XML stream is not possible. Then atEnd() returns true, hasError() returns true, and this function returns QXmlStreamReader::Invalid.
The exception is when error() return PrematureEndOfDocumentError. This error is reported when the end of an otherwise well-formed chunk of XML is reached, but the chunk doesn't represent a complete XML document. In that case, parsing can be resumed by calling addData() to add the next chunk of XML, when the stream is being read from a QByteArray, or by waiting for more data to arrive when the stream is being read from a device().
Смотрите также tokenType() и tokenString().
Устанавливает текущее устройство в device. Переданное устройство переключает поток в начальное состояние.
Смотрите также device() и clear().
Устанавливает распознватель resolver в качестве распознавателя сущностей entityResolver().
Поток чтения не владеет этим распознавателем. Обязаность вызвавшего фунцию - убедиться, что распознаватель будет валиден в течении жизни объекта потока чтения или пока новый распознаватель или 0 не будут установлены.
Эта функция была введена в Qt 4.4.
Смотрите также entityResolver().
Возвращает текст Characters, Comment, DTD или EntityReference.
Возвращает текущий маркер в виде строки.
Смотрите также tokenType().
Возвращает тип текущего маркера.
The current token can also be queried with the convenience functions isStartDocument(), isEndDocument(), isStartElement(), isEndElement(), isCharacters(), isComment(), isDTD(), isEntityReference(), and isProcessingInstruction().
Смотрите также tokenString().
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Торговые марки | Qt 4.5.3 |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |