QByteArrayList Class▲
-
Header: QByteArrayList
-
Since: Qt 5.4
-
qmake: QT += core
-
Inherits: QList
-
Group: QByteArrayList is part of tools, Implicitly Shared Classes, string-processing
Detailed Description▲
QByteArrayList is actually just a QList<QByteArray>. It is documented as a full class just for simplicity of documenting the member methods that exist only in QList<QByteArray>.
All of QList's functionality also applies to QByteArrayList. For example, you can use isEmpty() to test whether the list is empty, and you can call functions like append(), prepend(), insert(), replace(), removeAll(), removeAt(), removeFirst(), removeLast(), and removeOne() to modify a QByteArrayList. In addition, QByteArrayList provides several join() methods for concatenating the list into a single QByteArray.
The purpose of QByteArrayList is quite different from that of QStringList. Whereas QStringList has many methods for manipulation of elements within the list, QByteArrayList does not. Normally, QStringList should be used whenever working with a list of printable strings. QByteArrayList should be used to handle and efficiently join large blobs of binary data, as when sequentially receiving serialized data through a QIODevice.
See Also▲
See also QByteArray, QStringList
Member Function Documentation▲
[since 5.13] int QByteArrayList::indexOf(const char *needle, int from = 0) const▲
Returns the index position of the first occurrence of needle in the list, searching forward from index position from. Returns -1 if no item matched.
needle must be NUL-terminated.
This overload doesn't require creating a QByteArray, thus saving a memory allocation and some CPU time.
This is an overloaded function.
This function was introduced in Qt 5.13.
QByteArray QByteArrayList::join() const▲
Joins all the byte arrays into a single byte array.
QByteArray QByteArrayList::join(const QByteArray &separator) const▲
Joins all the byte arrays into a single byte array with each element separated by the given separator.
QByteArray QByteArrayList::join(char separator) const▲
Joins all the byte arrays into a single byte array with each element separated by the given separator.
Related Non-Members▲
QByteArrayListIterator▲
The QByteArrayListIterator type definition provides a Java-style const iterator for QByteArrayList.
QByteArrayList provides both Java-style iterators and STL-style iterators. The Java-style const iterator is simply a type definition for QListIterator<QByteArray>.
See Also▲
QMutableByteArrayListIterator▲
The QByteArrayListIterator type definition provides a Java-style non-const iterator for QByteArrayList.
QByteArrayList provides both Java-style iterators and STL-style iterators. The Java-style non-const iterator is simply a type definition for QMutableListIterator<QByteArray>.