summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qregularexpression.cpp73
-rw-r--r--src/corelib/text/qregularexpression.h8
2 files changed, 75 insertions, 6 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 1127b778310..72079c19964 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -2,7 +2,7 @@
**
** Copyright (C) 2020 Giuseppe D'Angelo <[email protected]>.
** Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Giuseppe D'Angelo <[email protected]>
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -1371,12 +1371,28 @@ QRegularExpression::QRegularExpression(const QRegularExpression &re)
}
/*!
+ \fn QRegularExpression::QRegularExpression(QRegularExpression &&re)
+
+ \since 6.1
+
+ Constructs a QRegularExpression object by moving from \a re.
+
+ Note that a moved-from QRegularExpression can only be destroyed or
+ assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
+
+ \sa operator=()
+*/
+
+/*!
Destroys the QRegularExpression object.
*/
QRegularExpression::~QRegularExpression()
{
}
+QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QRegularExpressionPrivate)
+
/*!
Assigns the regular expression \a re to this object, and returns a reference
to the copy. Both the pattern and the pattern options are copied.
@@ -1723,8 +1739,12 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
/*!
\fn QRegularExpression & QRegularExpression::operator=(QRegularExpression && re)
- Move-assigns the regular expression \a re to this object, and returns a reference
- to the copy. Both the pattern and the pattern options are copied.
+ Move-assigns the regular expression \a re to this object, and returns a
+ reference to the result. Both the pattern and the pattern options are copied.
+
+ Note that a moved-from QRegularExpression can only be destroyed or
+ assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
*/
/*!
@@ -2036,6 +2056,8 @@ QRegularExpressionMatch::~QRegularExpressionMatch()
{
}
+QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QRegularExpressionMatchPrivate)
+
/*!
Constructs a match result by copying the result of the given \a match.
@@ -2047,6 +2069,20 @@ QRegularExpressionMatch::QRegularExpressionMatch(const QRegularExpressionMatch &
}
/*!
+ \fn QRegularExpressionMatch::QRegularExpressionMatch(QRegularExpressionMatch &&match)
+
+ \since 6.1
+
+ Constructs a match result by moving the result from the given \a match.
+
+ Note that a moved-from QRegularExpressionMatch can only be destroyed or
+ assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
+
+ \sa operator=()
+*/
+
+/*!
Assigns the match result \a match to this object, and returns a reference
to the copy.
*/
@@ -2059,8 +2095,12 @@ QRegularExpressionMatch &QRegularExpressionMatch::operator=(const QRegularExpres
/*!
\fn QRegularExpressionMatch &QRegularExpressionMatch::operator=(QRegularExpressionMatch &&match)
- Move-assigns the match result \a match to this object, and returns a reference
- to the copy.
+ Move-assigns the match result \a match to this object, and returns a
+ reference to the result.
+
+ Note that a moved-from QRegularExpressionMatch can only be destroyed or
+ assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
*/
/*!
@@ -2468,6 +2508,8 @@ QRegularExpressionMatchIterator::~QRegularExpressionMatchIterator()
{
}
+QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QRegularExpressionMatchIteratorPrivate)
+
/*!
Constructs a QRegularExpressionMatchIterator object as a copy of \a
iterator.
@@ -2480,6 +2522,20 @@ QRegularExpressionMatchIterator::QRegularExpressionMatchIterator(const QRegularE
}
/*!
+ \fn QRegularExpressionMatchIterator::QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator)
+
+ \since 6.1
+
+ Constructs a QRegularExpressionMatchIterator object by moving from \a iterator.
+
+ Note that a moved-from QRegularExpressionMatchIterator can only be destroyed
+ or assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
+
+ \sa operator=()
+*/
+
+/*!
Assigns the iterator \a iterator to this object, and returns a reference to
the copy.
*/
@@ -2492,7 +2548,12 @@ QRegularExpressionMatchIterator &QRegularExpressionMatchIterator::operator=(cons
/*!
\fn QRegularExpressionMatchIterator &QRegularExpressionMatchIterator::operator=(QRegularExpressionMatchIterator &&iterator)
- Move-assigns the \a iterator to this object.
+ Move-assigns the \a iterator to this object, and returns a reference to the
+ result.
+
+ Note that a moved-from QRegularExpressionMatchIterator can only be destroyed
+ or assigned to. The effect of calling other functions than the destructor
+ or one of the assignment operators is undefined.
*/
/*!
diff --git a/src/corelib/text/qregularexpression.h b/src/corelib/text/qregularexpression.h
index 142ec7f8389..570679800c6 100644
--- a/src/corelib/text/qregularexpression.h
+++ b/src/corelib/text/qregularexpression.h
@@ -2,6 +2,7 @@
**
** Copyright (C) 2020 Giuseppe D'Angelo <[email protected]>.
** Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Giuseppe D'Angelo <[email protected]>
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -60,6 +61,8 @@ class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
class QRegularExpression;
+QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionPrivate, Q_CORE_EXPORT)
+
Q_CORE_EXPORT size_t qHash(const QRegularExpression &key, size_t seed = 0) noexcept;
class Q_CORE_EXPORT QRegularExpression
@@ -86,6 +89,7 @@ public:
QRegularExpression();
explicit QRegularExpression(const QString &pattern, PatternOptions options = NoPatternOption);
QRegularExpression(const QRegularExpression &re);
+ QRegularExpression(QRegularExpression &&re) = default;
~QRegularExpression();
QRegularExpression &operator=(const QRegularExpression &re);
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QRegularExpression)
@@ -204,6 +208,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug debug, QRegularExpression::PatternOptions
#endif
struct QRegularExpressionMatchPrivate;
+QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionMatchPrivate, Q_CORE_EXPORT)
class Q_CORE_EXPORT QRegularExpressionMatch
{
@@ -211,6 +216,7 @@ public:
QRegularExpressionMatch();
~QRegularExpressionMatch();
QRegularExpressionMatch(const QRegularExpressionMatch &match);
+ QRegularExpressionMatch(QRegularExpressionMatch &&match) = default;
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) noexcept
{ d.swap(match.d); return *this; }
@@ -278,6 +284,7 @@ class QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel {};
}
struct QRegularExpressionMatchIteratorPrivate;
+QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QRegularExpressionMatchIteratorPrivate, Q_CORE_EXPORT)
class Q_CORE_EXPORT QRegularExpressionMatchIterator
{
@@ -285,6 +292,7 @@ public:
QRegularExpressionMatchIterator();
~QRegularExpressionMatchIterator();
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
+ QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator) = default;
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) noexcept
{ d.swap(iterator.d); return *this; }