diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/xml/qxmlstream.cpp | 7 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream.h | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 69e2e5d5c1..64a130e45a 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -2622,6 +2622,13 @@ QXmlStreamEntityDeclaration::~QXmlStreamEntityDeclaration() { } +/*! \fn QXmlStreamStringRef::swap(QXmlStreamStringRef &other) + \since 5.6 + + Swaps this string reference's contents with \a other. + This function is very fast and never fails. +*/ + /*! \fn QStringRef QXmlStreamEntityDeclaration::name() const Returns the entity name. diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h index 7b1ea624c5..4e603a951a 100644 --- a/src/corelib/xml/qxmlstream.h +++ b/src/corelib/xml/qxmlstream.h @@ -54,12 +54,21 @@ public: :m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){} inline QXmlStreamStringRef(const QString &aString):m_string(aString), m_position(0), m_size(aString.size()){} inline ~QXmlStreamStringRef(){} + + void swap(QXmlStreamStringRef &other) Q_DECL_NOTHROW + { + qSwap(m_string, other.m_string); + qSwap(m_position, other.m_position); + qSwap(m_size, other.m_size); + } + inline void clear() { m_string.clear(); m_position = m_size = 0; } inline operator QStringRef() const { return QStringRef(&m_string, m_position, m_size); } inline const QString *string() const { return &m_string; } inline int position() const { return m_position; } inline int size() const { return m_size; } }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QXmlStreamStringRef) class QXmlStreamReaderPrivate; |