FastInfosetStreamReader Class

FastInfosetStreamReader represents a reader that provides fast, noncached, forward-only access to FastInfoset stream. More...

Header: #include <FastInfosetStreamReader>
Inherits: IXmlStreamReader

Public Functions

FastInfosetStreamReader(QObject *parent = Q_NULL)
FastInfosetStreamReader(const QString &fileName, QObject *parent = Q_NULL)
FastInfosetStreamReader(QIODevice *device, QObject *parent = Q_NULL)
virtual ~FastInfosetStreamReader()
FastInfoset::ErrorCode error() const
bool isCharacters() const
bool isComment() const
bool isDTD() const
bool isEndDocument() const
bool isEndElement() const
bool isEntityReference() const
bool isProcessingInstruction() const
bool isStartDocument() const
bool isStartElement() const

Reimplemented Public Functions

virtual bool atEnd() const override
virtual QXmlStreamAttributes attributes() const override
virtual QIODevice *device() const override
virtual QStringSubset documentEncoding() const override
virtual QStringSubset documentVersion() const override
virtual QStringSubset dtdName() const override
virtual QStringSubset dtdPublicId() const override
virtual QStringSubset dtdSystemId() const override
virtual QXmlStreamEntityDeclarations entityDeclarations() const override
virtual QString errorString() const override
virtual bool hasError() const override
virtual bool isCDATA() const override
virtual bool isStandaloneDocument() const override
virtual bool isWhitespace() const override
virtual QStringSubset name() const override
virtual QXmlStreamNamespaceDeclarations namespaceDeclarations() const override
virtual bool namespaceProcessing() const override
virtual QStringSubset namespaceUri() const override
virtual QXmlStreamNotationDeclarations notationDeclarations() const override
virtual QStringSubset prefix() const override
virtual QStringSubset processingInstructionData() const override
virtual QStringSubset processingInstructionTarget() const override
virtual QStringSubset qualifiedName() const override
virtual QXmlStreamReader::TokenType readNext() override
virtual bool readNextStartElement() override
virtual void setDevice(QIODevice *device) override
virtual void setNamespaceProcessing(bool) override
virtual void skipCurrentElement() override
virtual QStringSubset text() const override
virtual QString tokenString() const override
virtual QXmlStreamReader::TokenType tokenType() const override
enum EncodingAlgorithmId { AlgorithmNotUse, AlgorithmHexadecimal, AlgorithmBase64, AlgorithmShort, AlgorithmInt, …, AlgorithmCDATA }
enum ErrorCode { FSINoError, FSIMiscError, FSIIllegalArgumentError, FSINotImplementedError, FSINotSupportedError, …, FSIEncodingAlgorithmError }

Detailed Description

Member Function Documentation

[explicit] FastInfosetStreamReader::FastInfosetStreamReader(QObject *parent = Q_NULL)

Constructs a FastInfoset stream reader with the given parent.

See also setDevice().

[explicit] FastInfosetStreamReader::FastInfosetStreamReader(const QString &fileName, QObject *parent = Q_NULL)

Constructs a FastInfoset stream reader with the given parent that reads from file fileName.

[explicit] FastInfosetStreamReader::FastInfosetStreamReader(QIODevice *device, QObject *parent = Q_NULL)

Constructs a FastInfoset stream reader with the given parent that reads from device.

[virtual noexcept] FastInfosetStreamReader::~FastInfosetStreamReader()

Destructs the reader.

[override virtual] bool FastInfosetStreamReader::atEnd() const

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.

See also hasError(), error(), device(), and QIODevice::atEnd().

[override virtual] QXmlStreamAttributes FastInfosetStreamReader::attributes() const

Returns the attributes of a StartElement.

[override virtual] QIODevice *FastInfosetStreamReader::device() const

Returns the current device associated with the FastInfosetStreamReader, or 0 if no device has been assigned.

See also setDevice().

[override virtual] QStringSubset FastInfosetStreamReader::documentEncoding() const

Returns document encoding as a string. For FastInfoset stream UTF8 or UTF16BE encoding are permitted only.

[override virtual] QStringSubset FastInfosetStreamReader::documentVersion() const

Returns XML document version as a string. In most cases it is "1.0".

[override virtual] QStringSubset FastInfosetStreamReader::dtdName() const

If the tokenType() is QXmlStreamReader::DTD, this function returns the DTD's name. Otherwise an empty string is returned.

[override virtual] QStringSubset FastInfosetStreamReader::dtdPublicId() const

If the tokenType() is QXmlStreamReader::DTD, this function returns the DTD's public identifier. Otherwise an empty string is returned.

[override virtual] QStringSubset FastInfosetStreamReader::dtdSystemId() const

If the tokenType() is QXmlStreamReader::DTD, this function returns the DTD's system identifier. Otherwise an empty string is returned.

[override virtual] QXmlStreamEntityDeclarations FastInfosetStreamReader::entityDeclarations() const

If the tokenType() is QXmlStreamReader::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.

FastInfoset::ErrorCode FastInfosetStreamReader::error() const

Returns the type of the current error, or FastInfoset::FSINoError if no error occurred.

See also errorString().

[override virtual] QString FastInfosetStreamReader::errorString() const

Returns the error message that was set by FastInfoset parser.

See also error().

[override virtual] bool FastInfosetStreamReader::hasError() const

Returns true if an error has occurred, otherwise false.

See also errorString() and error().

[override virtual] bool FastInfosetStreamReader::isCDATA() const

Returns true if the reader reports characters that stem from a CDATA section; otherwise returns false.

See also isCharacters() and text().

bool FastInfosetStreamReader::isCharacters() const

Returns true if tokenType() equals QXmlStreamReader::Characters; otherwise returns false.

See also isWhitespace() and isCDATA().

bool FastInfosetStreamReader::isComment() const

Returns true if tokenType() equals QXmlStreamReader::Comment; otherwise returns false.

bool FastInfosetStreamReader::isDTD() const

Returns true if tokenType() equals QXmlStreamReader::DTD; otherwise returns false.

bool FastInfosetStreamReader::isEndDocument() const

Returns true if tokenType() equals QXmlStreamReader::EndDocument; otherwise returns false.

bool FastInfosetStreamReader::isEndElement() const

Returns true if tokenType() equals QXmlStreamReader::EndElement; otherwise returns false.

bool FastInfosetStreamReader::isEntityReference() const

Returns true if tokenType() equals QXmlStreamReader::EntityReference; otherwise returns false.

bool FastInfosetStreamReader::isProcessingInstruction() const

Returns true if tokenType() equals QXmlStreamReader::ProcessingInstruction; otherwise returns false.

[override virtual] bool FastInfosetStreamReader::isStandaloneDocument() const

Returns true if this document has been declared standalone in the XML declaration; otherwise returns false.

bool FastInfosetStreamReader::isStartDocument() const

Returns true if tokenType() equals QXmlStreamReader::StartDocument; otherwise returns false.

bool FastInfosetStreamReader::isStartElement() const

Returns true if tokenType() equals QXmlStreamReader::StartElement; otherwise returns false.

[override virtual] bool FastInfosetStreamReader::isWhitespace() const

Returns true if the reader reports characters that only consist of white-space; otherwise returns false.

See also isCharacters() and text().

[override virtual] QStringSubset FastInfosetStreamReader::name() const

Returns the local name of a StartElement, EndElement, or an EntityReference.

See also namespaceUri() and qualifiedName().

[override virtual] QXmlStreamNamespaceDeclarations FastInfosetStreamReader::namespaceDeclarations() const

If the tokenType() is QXmlStreamReader::StartElement, this function returns the element's namespace declarations. Otherwise an empty vector is returned.

The QXmlStreamNamespaceDeclarations class is defined to be a QVector of QXmlStreamNamespaceDeclaration.

[override virtual] bool FastInfosetStreamReader::namespaceProcessing() const

See also setNamespaceProcessing().

[override virtual] QStringSubset FastInfosetStreamReader::namespaceUri() const

Returns the namespaceUri of a StartElement or EndElement.

See also name() and qualifiedName().

[override virtual] QXmlStreamNotationDeclarations FastInfosetStreamReader::notationDeclarations() const

If the tokenType() is QXmlStreamReader::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.

[override virtual] QStringSubset FastInfosetStreamReader::prefix() const

Returns the prefix of a StartElement or EndElement.

See also name() and qualifiedName().

[override virtual] QStringSubset FastInfosetStreamReader::processingInstructionData() const

Returns the data of a ProcessingInstruction.

[override virtual] QStringSubset FastInfosetStreamReader::processingInstructionTarget() const

Returns the target of a ProcessingInstruction.

[override virtual] QStringSubset FastInfosetStreamReader::qualifiedName() const

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().

[override virtual] QXmlStreamReader::TokenType FastInfosetStreamReader::readNext()

Reads the next token and returns its type.

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.

See also tokenType() and tokenString().

[override virtual] bool FastInfosetStreamReader::readNextStartElement()

Reads until the next start element within the current element. Returns true when a start element was reached. When the end element was reached, or when an error occurred, false is returned.

The current element is the element matching the most recently parsed start element of which a matching end element has not yet been reached. When the parser has reached the end element, the current element becomes the parent element.

See also readNext().

[override virtual] void FastInfosetStreamReader::setDevice(QIODevice *device)

Sets the current device to device. Setting the device resets the stream to its initial state.

See also device().

[override virtual] void FastInfosetStreamReader::setNamespaceProcessing(bool)

See also namespaceProcessing().

[override virtual] void FastInfosetStreamReader::skipCurrentElement()

Reads until the end of the current element, skipping any child nodes. This function is useful for skipping unknown elements.

The current element is the element matching the most recently parsed start element of which a matching end element has not yet been reached. When the parser has reached the end element, the current element becomes the parent element.

[override virtual] QStringSubset FastInfosetStreamReader::text() const

Returns the text of QXmlStreamReader::Characters, QXmlStreamReader::Comment, QXmlStreamReader::DTD, or EntityReference.

[override virtual] QString FastInfosetStreamReader::tokenString() const

Returns the reader's current token as string.

See also tokenType().

[override virtual] QXmlStreamReader::TokenType FastInfosetStreamReader::tokenType() const

Returns the type of the current token.

The current token can also be queried with the convenience functions isStartDocument(), isEndDocument(), isStartElement(), isEndElement(), isCharacters(), isComment(), isDTD(), isEntityReference(), and isProcessingInstruction().

See also tokenString().

Related Non-Members

enum EncodingAlgorithmId

This enum describes encoding algorithms which can be used for encoding text data.

ConstantValueDescription
FastInfosetStreamReader::AlgorithmNotUse-1do not use encoding
FastInfosetStreamReader::AlgorithmHexadecimal0interpret the string as a hexadecimal data
FastInfosetStreamReader::AlgorithmBase641interpret the string as a base64 data
FastInfosetStreamReader::AlgorithmShort2interpret the string as a short numeric value
FastInfosetStreamReader::AlgorithmInt3interpret the string as an integer numeric value
FastInfosetStreamReader::AlgorithmLong4interpret the string as a long numeric value
FastInfosetStreamReader::AlgorithmBoolean5interpret the string as a boolean value
FastInfosetStreamReader::AlgorithmFloat6interpret the string as a float numeric value
FastInfosetStreamReader::AlgorithmDouble7interpret the string as a double numeric value
FastInfosetStreamReader::AlgorithmUUID8interpret the string as a GUID
FastInfosetStreamReader::AlgorithmCDATA9do not used directly!

enum ErrorCode

This enum describes errors of parsing or serializing.

ConstantValueDescription
FastInfosetStreamReader::FSINoError0no error
FastInfosetStreamReader::FSIMiscError1custom error
FastInfosetStreamReader::FSIIllegalArgumentError2wrong argument error
FastInfosetStreamReader::FSINotImplementedError3not implemented error
FastInfosetStreamReader::FSINotSupportedError4not supported error
FastInfosetStreamReader::FSIIllegalStateError5improper use of reader/writer
FastInfosetStreamReader::FSIEncodingAlgorithmError6an error in the encoding mechanism