diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2022-11-06 14:40:33 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2022-11-16 18:25:35 +0200 |
commit | 4d8484382248d7bd9e86ccf0f3847b7240a13418 (patch) | |
tree | 319a4d23bf690845f1cf0860c78cecee2fac9cdd /src/corelib/text/qbytearray.cpp | |
parent | 4c975fd564e3b1f5c398f6ffe6b4b87ff6f95379 (diff) |
QString, QByteArray: add removeAt/First/Last() convenience methods
Requested in codereview.qt-project.org/c/qt/qtbase/+/441770
[ChangeLog][QtCore][Text] Add removeAt/First/Last() convenience methods to
QString and QByteArray
Change-Id: I48a803e456e70cc51d51726a5e3aa7c125aedb1c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index a8d131dbc5..0f6e57e38b 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -2271,6 +2271,38 @@ QByteArray &QByteArray::remove(qsizetype pos, qsizetype len) } /*! + \fn QByteArray &QByteArray::removeAt(qsizetype pos) + + \since 6.5 + + Removes the character at index \a pos. If \a pos is out of bounds + (i.e. \a pos >= size()) this function does nothing. + + \sa remove() +*/ + +/*! + \fn QByteArray &QByteArray::removeFirst() + + \since 6.5 + + Removes the first character in this byte array. If the byte array is empty, + this function does nothing. + + \sa remove() +*/ +/*! + \fn QByteArray &QByteArray::removeLast() + + \since 6.5 + + Removes the last character in this byte array. If the byte array is empty, + this function does nothing. + + \sa remove() +*/ + +/*! \fn template <typename Predicate> QByteArray &QByteArray::removeIf(Predicate pred) \since 6.1 |