📄 qxmlstream.cpp
字号:
void QXmlStreamReader::raiseError(const QString& message){ Q_D(QXmlStreamReader); d->raiseError(CustomError, message);}/*! Returns the error message that was set with raiseError(). \sa error(), lineNumber(), columnNumber(), characterOffset() */QString QXmlStreamReader::errorString() const{ Q_D(const QXmlStreamReader); if (d->type == QXmlStreamReader::Invalid) return d->errorString; return QString();}/*! Returns the type of the current error, or NoError if no error occurred. \sa errorString(), raiseError() */QXmlStreamReader::Error QXmlStreamReader::error() const{ Q_D(const QXmlStreamReader); if (d->type == QXmlStreamReader::Invalid) return d->error; return NoError;}/*! Returns the target of a ProcessingInstruction. */QStringRef QXmlStreamReader::processingInstructionTarget() const{ Q_D(const QXmlStreamReader); return d->processingInstructionTarget;}/*! Returns the data of a ProcessingInstruction. */QStringRef QXmlStreamReader::processingInstructionData() const{ Q_D(const QXmlStreamReader); return d->processingInstructionData;}/*! Returns the local name of a StartElement, EndElement, or an EntityReference. \sa namespaceUri(), qualifiedName() */QStringRef QXmlStreamReader::name() const{ Q_D(const QXmlStreamReader); return d->name;}/*! Returns the namespaceUri of a StartElement or EndElement. \sa name(), qualifiedName() */QStringRef QXmlStreamReader::namespaceUri() const{ Q_D(const QXmlStreamReader); return d->namespaceUri;}/*! 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(). \sa name(), namespaceUri() */QStringRef QXmlStreamReader::qualifiedName() const{ Q_D(const QXmlStreamReader); return d->qualifiedName;}/*! Returns the attributes of a StartElement. */QXmlStreamAttributes QXmlStreamReader::attributes() const{ Q_D(const QXmlStreamReader); return d->attributes;}/*! \class QXmlStreamAttribute \since 4.3 \reentrant \brief The QXmlStreamAttribute class represents a single XML attribute \module XML \ingroup xml-tools An attribute consists of an optionally empty namespaceUri(), a name(), a value(), and an isDefault() attribute. The raw XML attribute name is returned as qualifiedName().*//*! Creates an empty attribute. */QXmlStreamAttribute::QXmlStreamAttribute(){ m_isDefault = false;}/*! Destructs an attribute. */QXmlStreamAttribute::~QXmlStreamAttribute(){}/*! Constructs an attribute in the namespace described with \a namespaceUri with \a name and value \a value. */QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value){ m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri)); m_name = m_qualifiedName = QXmlStreamStringRef(QStringRef(&name)); m_value = QXmlStreamStringRef(QStringRef(&value)); m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri));}/*! Constructs an attribute with qualified name \a qualifiedName and value \a value. */QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value){ int colon = qualifiedName.indexOf(QLatin1Char(':')); m_name = QXmlStreamStringRef(QStringRef(&qualifiedName, colon + 1, qualifiedName.size() - (colon + 1))); m_qualifiedName = QXmlStreamStringRef(QStringRef(&qualifiedName)); m_value = QXmlStreamStringRef(QStringRef(&value));}/*! \fn QStringRef QXmlStreamAttribute::namespaceUri() const Returns the attribute's resolved namespaceUri, or an empty string reference if the attribute does not have a defined namespace. *//*! \fn QStringRef QXmlStreamAttribute::name() const Returns the attribute's local name. *//*! \fn QStringRef QXmlStreamAttribute::qualifiedName() const Returns the attribute's qualified name. A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix, followed by colon, followed by the attribute'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(). *//*! \fn QStringRef QXmlStreamAttribute::value() const Returns the attribute's value. *//*! \fn bool QXmlStreamAttribute::isDefault() const Returns true if the parser added this attribute with a default value following an ATTLIST declaration in the DTD; otherwise returns false.*//*! \fn bool QXmlStreamAttribute::operator==(const QXmlStreamAttribute &other) const Compares this attribute with \a other and returns true if they are equal; otherwise returns false. *//*! \fn bool QXmlStreamAttribute::operator!=(const QXmlStreamAttribute &other) const Compares this attribute with \a other and returns true if they are not equal; otherwise returns false. *//*! Creates a copy of \a other. */QXmlStreamAttribute::QXmlStreamAttribute(const QXmlStreamAttribute &other){ *this = other;}/*! Assigns \a other to this attribute. */QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &other){ m_name = other.m_name; m_namespaceUri = other.m_namespaceUri; m_qualifiedName = other.m_qualifiedName; m_value = other.m_value; m_isDefault = other.m_isDefault; return *this;}/*! \class QXmlStreamAttributes \since 4.3 \reentrant \brief The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute. Attributes are returned by a QXmlStreamReader in \l{QXmlStreamReader::attributes()} {attributes()} when the reader reports a \l {QXmlStreamReader::StartElement}{start element}. The class can also be used with a QXmlStreamWriter as an argument to \l {QXmlStreamWriter::writeAttributes()}{writeAttributes()}. The convenience function value() loops over the vector and returns an attribute value for a given namespaceUri and an attribute's name. New attributes can be added with append(). \module XML \ingroup xml-tools*//*! \fn void QXmlStreamAttributes::append(const QXmlStreamAttribute &attribute) Appends the given \a attribute to the end of the vector. \sa QVector::append()*//*! \typedef QXmlStreamNotationDeclarations \relates QXmlStreamNotationDeclaration Synonym for QVector<QXmlStreamNotationDeclaration>.*//*! \class QXmlStreamNotationDeclaration \since 4.3 \reentrant \brief The QXmlStreamNotationDeclaration class represents a DTD notation declaration. \module XML \ingroup xml-tools An notation declaration consists of a name(), a systemId(), and a publicId().*//*! Creates an empty notation declaration.*/QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration(){}/*! Creates a copy of \a other. */QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration(const QXmlStreamNotationDeclaration &other){ *this = other;}/*! Assigns \a other to this notation declaration. */QXmlStreamNotationDeclaration& QXmlStreamNotationDeclaration::operator=(const QXmlStreamNotationDeclaration &other){ m_name = other.m_name; m_systemId = other.m_systemId; m_publicId = other.m_publicId; return *this;}/*!Destructs this notation declaration.*/QXmlStreamNotationDeclaration::~QXmlStreamNotationDeclaration(){}/*! \fn QStringRef QXmlStreamNotationDeclaration::name() constReturns the notation name.*//*! \fn QStringRef QXmlStreamNotationDeclaration::systemId() constReturns the system identifier.*//*! \fn QStringRef QXmlStreamNotationDeclaration::publicId() constReturns the public identifier.*//*! \fn inline bool QXmlStreamNotationDeclaration::operator==(const QXmlStreamNotationDeclaration &other) const Compares this notation declaration with \a other and returns true if they are equal; otherwise returns false. *//*! \fn inline bool QXmlStreamNotationDeclaration::operator!=(const QXmlStreamNotationDeclaration &other) const Compares this notation declaration with \a other and returns true if they are not equal; otherwise returns false. *//*! \typedef QXmlStreamNamespaceDeclarations \relates QXmlStreamNamespaceDeclaration Synonym for QVector<QXmlStreamNamespaceDeclaration>.*//*! \class QXmlStreamNamespaceDeclaration \since 4.3 \reentrant \brief The QXmlStreamNamespaceDeclaration class represents a namespace declaration. \module XML \ingroup xml-tools An namespace declaration consists of a prefix() and a namespaceUri().*//*! \fn inline bool QXmlStreamNamespaceDeclaration::operator==(const QXmlStreamNamespaceDeclaration &other) const Compares this namespace declaration with \a other and returns true if they are equal; otherwise returns false. *//*! \fn inline bool QXmlStreamNamespaceDeclaration::operator!=(const QXmlStreamNamespaceDeclaration &other) const Compares this namespace declaration with \a other and returns true if they are not equal; otherwise returns false. *//*! Creates an empty namespace declaration.*/QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(){}/*! Creates a copy of \a other. */QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &other){ *this = other;}/*! Assigns \a other to this namespace declaration. */QXmlStreamNamespaceDeclaration& QXmlStreamNamespaceDeclaration::operator=(const QXmlStreamNamespaceDeclaration &other){ m_prefix = other.m_prefix; m_namespaceUri = other.m_namespaceUri; return *this;}/*!Destructs this namespace declaration.*/QXmlStreamNamespaceDeclaration::~QXmlStreamNamespaceDeclaration(){}/*! \fn QStringRef QXmlStreamNamespaceDeclaration::prefix() constReturns the prefix.*//*! \fn QStringRef QXmlStreamNamespaceDeclaration::namespaceUri() constReturns the namespaceUri.*//*! \typedef QXmlStreamEntityDeclarations \relates QXmlStreamEntityDeclaration Synonym for QVector<QXmlStreamEntityDeclaration>.*//*! \class QXmlStreamStringRef \since 4.3 \internal*//*! \class QXmlStreamEntityDeclaration \since 4.3 \reentrant \brief The QXmlStreamEntityDeclaration class represents a DTD entity declaration. \module XML \ingroup xml-tools An entity declaration consists of a name(), a notationName(), a systemId(), a publicId(), and a value().*//*! Creates an empty entity declaration.*/QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration(){}/*! Creates a copy of \a ot
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -