File indexing completed on 2025-09-18 09:26:20
0001
0002
0003
0004
0005
0006 #include <QtCore/qlist.h>
0007
0008 #ifndef QBYTEARRAYLIST_H
0009 #define QBYTEARRAYLIST_H
0010
0011 #include <QtCore/qbytearray.h>
0012
0013 #include <limits>
0014
0015 QT_BEGIN_NAMESPACE
0016
0017 #if !defined(QT_NO_JAVA_STYLE_ITERATORS)
0018 typedef QListIterator<QByteArray> QByteArrayListIterator;
0019 typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator;
0020 #endif
0021
0022 #ifndef Q_QDOC
0023
0024 namespace QtPrivate {
0025 #if QT_CORE_REMOVED_SINCE(6, 3) && QT_POINTER_SIZE != 4
0026 QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *separator, int separatorLength);
0027 #endif
0028 QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *sep, qsizetype len);
0029 }
0030 #endif
0031
0032 #ifdef Q_QDOC
0033 class QByteArrayList : public QList<QByteArray>
0034 #else
0035 template <> struct QListSpecialMethods<QByteArray> : QListSpecialMethodsBase<QByteArray>
0036 #endif
0037 {
0038 #ifndef Q_QDOC
0039 protected:
0040 QListSpecialMethods() = default;
0041 ~QListSpecialMethods() = default;
0042 QListSpecialMethods(const QListSpecialMethods &) = default;
0043 QListSpecialMethods(QListSpecialMethods &&) = default;
0044 QListSpecialMethods &operator=(const QListSpecialMethods &) = default;
0045 QListSpecialMethods &operator=(QListSpecialMethods &&) = default;
0046 #endif
0047 public:
0048 using QListSpecialMethodsBase<QByteArray>::indexOf;
0049 using QListSpecialMethodsBase<QByteArray>::lastIndexOf;
0050 using QListSpecialMethodsBase<QByteArray>::contains;
0051
0052 QByteArray join(QByteArrayView sep = {}) const
0053 {
0054 return QtPrivate::QByteArrayList_join(self(), sep.data(), sep.size());
0055 }
0056 Q_WEAK_OVERLOAD
0057 inline QByteArray join(const QByteArray &sep) const
0058 { return join(qToByteArrayViewIgnoringNull(sep)); }
0059 inline QByteArray join(char sep) const
0060 { return join({&sep, 1}); }
0061 };
0062
0063 QT_END_NAMESPACE
0064
0065 #endif