QXmlString: add a few missing operations

... namely isNull() and op==/!=().

These will be needed for porting comparesEqual() from public getters
to direct data member access, in order to make them earn their
noexcept tagging.

Change-Id: Id8677d39dc581d03adfd3d0d420907ff60c0423a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e0ae91bd5880d1f8ab36d42cff428bb8246f73c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-08-27 18:56:09 +02:00 committed by Qt Cherry-pick Bot
parent 92597843d6
commit 1f129d1589

View File

@ -33,6 +33,14 @@ public:
operator QStringView() const noexcept { return QStringView(m_string.data(), m_string.size); }
qsizetype size() const noexcept { return m_string.size; }
bool isNull() const noexcept { return m_string.isNull(); }
private:
friend bool comparesEqual(const QXmlString &lhs, const QXmlString &rhs) noexcept
{
return QStringView(lhs) == QStringView(rhs);
}
Q_DECLARE_EQUALITY_COMPARABLE(QXmlString)
};
}