QtBase  v6.3.1
qbytearraylist.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Copyright (C) 2016 Intel Corporation.
5 ** Copyright (C) 2014 by Southwest Research Institute (R)
6 ** Contact: https://www.qt.io/licensing/
7 **
8 ** This file is part of the QtCore module of the Qt Toolkit.
9 **
10 ** $QT_BEGIN_LICENSE:LGPL$
11 ** Commercial License Usage
12 ** Licensees holding valid commercial Qt licenses may use this file in
13 ** accordance with the commercial license agreement provided with the
14 ** Software or, alternatively, in accordance with the terms contained in
15 ** a written agreement between you and The Qt Company. For licensing terms
16 ** and conditions see https://www.qt.io/terms-conditions. For further
17 ** information use the contact form at https://www.qt.io/contact-us.
18 **
19 ** GNU Lesser General Public License Usage
20 ** Alternatively, this file may be used under the terms of the GNU Lesser
21 ** General Public License version 3 as published by the Free Software
22 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
23 ** packaging of this file. Please review the following information to
24 ** ensure the GNU Lesser General Public License version 3 requirements
25 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
26 **
27 ** GNU General Public License Usage
28 ** Alternatively, this file may be used under the terms of the GNU
29 ** General Public License version 2.0 or (at your option) the GNU General
30 ** Public license version 3 or any later version approved by the KDE Free
31 ** Qt Foundation. The licenses are as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
33 ** included in the packaging of this file. Please review the following
34 ** information to ensure the GNU General Public License requirements will
35 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
36 ** https://www.gnu.org/licenses/gpl-3.0.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <QtCore/qlist.h>
43 
44 #ifndef QBYTEARRAYLIST_H
45 #define QBYTEARRAYLIST_H
46 
47 #include <QtCore/qbytearray.h>
48 
49 #include <limits>
50 
52 
53 #if !defined(QT_NO_JAVA_STYLE_ITERATORS)
54 typedef QListIterator<QByteArray> QByteArrayListIterator;
55 typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator;
56 #endif
57 
58 #ifndef Q_CLANG_QDOC
59 
60 namespace QtPrivate {
61 #if QT_CORE_REMOVED_SINCE(6, 3) && QT_POINTER_SIZE != 4
62  QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *separator, int separatorLength);
63 #endif
64  QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *sep, qsizetype len);
65 }
66 #endif
67 
68 #ifdef Q_CLANG_QDOC
69 class QByteArrayList : public QList<QByteArray>
70 #else
71 template <> struct QListSpecialMethods<QByteArray> : QListSpecialMethodsBase<QByteArray>
72 #endif
73 {
74 #ifndef Q_CLANG_QDOC
75 protected:
76  ~QListSpecialMethods() = default;
77 #endif
78 public:
82 
83  QByteArray join(QByteArrayView sep = {}) const
84  {
85  return QtPrivate::QByteArrayList_join(self(), sep.data(), sep.size());
86  }
88  inline QByteArray join(const QByteArray &sep) const
89  { return join(qToByteArrayViewIgnoringNull(sep)); }
90  inline QByteArray join(char sep) const
91  { return join({&sep, 1}); }
92 };
93 
95 
96 #endif // QBYTEARRAYLIST_H
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:85
The QByteArrayList class provides a list of byte arrays.
Definition: qlist.h:108
QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *sep, qsizetype len)
QT_BEGIN_NAMESPACE typedef QListIterator< QByteArray > QByteArrayListIterator
QByteArrayView qToByteArrayViewIgnoringNull(const QByteArrayLike &b) noexcept
#define Q_WEAK_OVERLOAD
ptrdiff_t qsizetype
Definition: qglobal.h:308
GLenum GLsizei len
Definition: qopenglext.h:3292
Q_WEAK_OVERLOAD QByteArray join(const QByteArray &sep) const
QByteArray join(char sep) const
QByteArray join(QByteArrayView sep={}) const