Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-18 08:32:21

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // Copyright (C) 2016 Intel Corporation.
0003 // Copyright (C) 2014 by Southwest Research Institute (R)
0004 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0005 // Qt-Security score:significant reason:default
0006 
0007 #include <QtCore/qlist.h>
0008 
0009 #ifndef QBYTEARRAYLIST_H
0010 #define QBYTEARRAYLIST_H
0011 
0012 #include <QtCore/qbytearray.h>
0013 
0014 #include <limits>
0015 
0016 QT_BEGIN_NAMESPACE
0017 
0018 #if !defined(QT_NO_JAVA_STYLE_ITERATORS)
0019 typedef QListIterator<QByteArray> QByteArrayListIterator;
0020 typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator;
0021 #endif
0022 
0023 #ifndef Q_QDOC
0024 
0025 namespace QtPrivate {
0026 #if QT_CORE_REMOVED_SINCE(6, 3) && QT_POINTER_SIZE != 4
0027     QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *separator, int separatorLength);
0028 #endif
0029     QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *sep, qsizetype len);
0030 }
0031 #endif
0032 
0033 #ifdef Q_QDOC
0034 class QByteArrayList : public QList<QByteArray>
0035 #else
0036 template <> struct QListSpecialMethods<QByteArray> : QListSpecialMethodsBase<QByteArray>
0037 #endif
0038 {
0039 #ifndef Q_QDOC
0040 protected:
0041     QListSpecialMethods() = default;
0042     ~QListSpecialMethods() = default;
0043     QListSpecialMethods(const QListSpecialMethods &) = default;
0044     QListSpecialMethods(QListSpecialMethods &&) = default;
0045     QListSpecialMethods &operator=(const QListSpecialMethods &) = default;
0046     QListSpecialMethods &operator=(QListSpecialMethods &&) = default;
0047 #endif
0048 public:
0049     using QListSpecialMethodsBase<QByteArray>::indexOf;
0050     using QListSpecialMethodsBase<QByteArray>::lastIndexOf;
0051     using QListSpecialMethodsBase<QByteArray>::contains;
0052 
0053     QByteArray join(QByteArrayView sep = {}) const
0054     {
0055         return QtPrivate::QByteArrayList_join(self(), sep.data(), sep.size());
0056     }
0057     Q_WEAK_OVERLOAD
0058     inline QByteArray join(const QByteArray &sep) const
0059     { return join(qToByteArrayViewIgnoringNull(sep)); }
0060     inline QByteArray join(char sep) const
0061     { return join({&sep, 1}); }
0062 };
0063 
0064 QT_END_NAMESPACE
0065 
0066 #endif // QBYTEARRAYLIST_H