diff options
Diffstat (limited to 'src/corelib/serialization/qcborarray.cpp')
-rw-r--r-- | src/corelib/serialization/qcborarray.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/corelib/serialization/qcborarray.cpp b/src/corelib/serialization/qcborarray.cpp index 020841d604..a1b0d1573c 100644 --- a/src/corelib/serialization/qcborarray.cpp +++ b/src/corelib/serialization/qcborarray.cpp @@ -42,6 +42,8 @@ QT_BEGIN_NAMESPACE +using namespace QtCbor; + /*! \class QCborArray \inmodule QtCore @@ -300,7 +302,7 @@ QCborValue QCborArray::at(qsizetype i) const must have at least \a i elements before the insertion. \sa at(), operator[](), first(), last(), prepend(), append(), - removeAt(), takeAt() + removeAt(), takeAt(), extract() */ void QCborArray::insert(qsizetype i, const QCborValue &value) { @@ -312,6 +314,21 @@ void QCborArray::insert(qsizetype i, const QCborValue &value) } /*! + Extracts a value from the array at the position indicated by iterator \a it + and returns the value so extracted. + + \sa insert(), erase(), takeAt(), removeAt() + */ +QCborValue QCborArray::extract(iterator it) +{ + detach(); + + QCborValue v = d->extractAt(it.item.i); + d->removeAt(it.item.i); + return v; +} + +/*! \fn void QCborArray::prepend(const QCborValue &value) Prepends \a value into the array before any other elements it may already |