Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qlatin1stringview.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// Copyright (C) 2019 Intel Corporation.
3// Copyright (C) 2019 Mail.ru Group.
4// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
5// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
6// Qt-Security score:critical reason:data-parser
7
8#ifndef QLATIN1STRINGVIEW_H
9#define QLATIN1STRINGVIEW_H
10
11#include <QtCore/qchar.h>
12#include <QtCore/qcompare.h>
13#include <QtCore/qcontainerfwd.h>
14#include <QtCore/qnamespace.h>
15#include <QtCore/qtversionchecks.h>
16#include <QtCore/qstringfwd.h>
17#include <QtCore/qstringview.h>
18
19#if 0
20// Workaround for generating forward headers
21#pragma qt_class(QLatin1String)
22#pragma qt_class(QLatin1StringView)
23#endif
24
25QT_BEGIN_NAMESPACE
26
27class QString;
28
29#ifdef Q_L1S_VIEW_IS_PRIMARY
30class QLatin1StringView
31#else
33#endif
34{
35public:
36#ifdef Q_L1S_VIEW_IS_PRIMARY
37 constexpr QLatin1StringView() noexcept {}
38 constexpr QLatin1StringView(std::nullptr_t) noexcept : QLatin1StringView() {}
39 constexpr explicit QLatin1StringView(const char *s) noexcept
41 constexpr QLatin1StringView(const char *f, const char *l)
43 constexpr QLatin1StringView(const char *s, qsizetype sz) noexcept : m_data(s), m_size(sz) {}
44 explicit QLatin1StringView(const QByteArray &s) noexcept
45 : QLatin1StringView{s.begin(), s.size()} {}
46 constexpr explicit QLatin1StringView(QByteArrayView s) noexcept
48#else
49 constexpr QLatin1String() noexcept : m_size(0), m_data(nullptr) {}
51 constexpr QLatin1String(std::nullptr_t) noexcept : QLatin1String() {}
52 constexpr explicit QLatin1String(const char *s) noexcept
53 : m_size(s ? qsizetype(QtPrivate::lengthHelperPointer(s)) : 0), m_data(s) {}
54 constexpr QLatin1String(const char *f, const char *l)
55 : QLatin1String(f, qsizetype(l - f)) {}
56 constexpr QLatin1String(const char *s, qsizetype sz) noexcept : m_size(sz), m_data(s) {}
57 explicit QLatin1String(const QByteArray &s) noexcept : QLatin1String(s.begin(), s.size()) {}
58 constexpr explicit QLatin1String(QByteArrayView s) noexcept : m_size(s.size()), m_data(s.data()) {}
59#endif // !Q_L1S_VIEW_IS_PRIMARY
60
61 inline QString toString() const;
62 QByteArray toUtf8() const { return QtPrivate::convertToUtf8(*this); }
63
64 constexpr const char *latin1() const noexcept { return m_data; }
65 constexpr qsizetype size() const noexcept { return m_size; }
66 constexpr const char *data() const noexcept { return m_data; }
67 [[nodiscard]] constexpr const char *constData() const noexcept { return data(); }
68 [[nodiscard]] constexpr const char *constBegin() const noexcept { return begin(); }
69 [[nodiscard]] constexpr const char *constEnd() const noexcept { return end(); }
70
71 [[nodiscard]] constexpr QLatin1Char first() const { return front(); }
72 [[nodiscard]] constexpr QLatin1Char last() const { return back(); }
73
74 [[nodiscard]] constexpr qsizetype length() const noexcept { return size(); }
75
76 constexpr bool isNull() const noexcept { return !data(); }
77 constexpr bool isEmpty() const noexcept { return !size(); }
78
79 [[nodiscard]] constexpr bool empty() const noexcept { return size() == 0; }
80
81 template <typename...Args>
82 [[nodiscard]] inline QString arg(Args &&...args) const;
83
84 [[nodiscard]] constexpr QLatin1Char at(qsizetype i) const
85 {
86 Q_ASSERT(i >= 0);
87 Q_ASSERT(i < size());
88 return QLatin1Char(m_data[i]);
89 }
90 [[nodiscard]] constexpr QLatin1Char operator[](qsizetype i) const { return at(i); }
91
92 [[nodiscard]] constexpr QLatin1Char front() const { return at(0); }
93 [[nodiscard]] constexpr QLatin1Char back() const { return at(size() - 1); }
94
95 [[nodiscard]] int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
96 { return QtPrivate::compareStrings(*this, other, cs); }
97 [[nodiscard]] int compare(QLatin1StringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
98 { return QtPrivate::compareStrings(*this, other, cs); }
99 [[nodiscard]] inline int compare(QUtf8StringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
100 [[nodiscard]] constexpr int compare(QChar c) const noexcept
101 { return isEmpty() ? -1 : front() == c ? int(size() > 1) : uchar(m_data[0]) - c.unicode(); }
102 [[nodiscard]] int compare(QChar c, Qt::CaseSensitivity cs) const noexcept
103 { return QtPrivate::compareStrings(*this, QStringView(&c, 1), cs); }
104
105 [[nodiscard]] bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
106 { return QtPrivate::startsWith(*this, s, cs); }
107 [[nodiscard]] bool startsWith(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
108 { return QtPrivate::startsWith(*this, s, cs); }
109 [[nodiscard]] constexpr bool startsWith(QChar c) const noexcept
110 { return !isEmpty() && front() == c; }
111 [[nodiscard]] bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
112 { return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); }
113
114 [[nodiscard]] bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
115 { return QtPrivate::endsWith(*this, s, cs); }
116 [[nodiscard]] bool endsWith(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
117 { return QtPrivate::endsWith(*this, s, cs); }
118 [[nodiscard]] constexpr bool endsWith(QChar c) const noexcept
119 { return !isEmpty() && back() == c; }
120 [[nodiscard]] bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
121 { return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); }
122
123 [[nodiscard]] qsizetype indexOf(QStringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
124 { return QtPrivate::findString(*this, from, s, cs); }
125 [[nodiscard]] qsizetype indexOf(QLatin1StringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
126 { return QtPrivate::findString(*this, from, s, cs); }
127 [[nodiscard]] qsizetype indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
128 { return QtPrivate::findString(*this, from, QStringView(&c, 1), cs); }
129
130 [[nodiscard]] bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
131 { return indexOf(s, 0, cs) != -1; }
132 [[nodiscard]] bool contains(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
133 { return indexOf(s, 0, cs) != -1; }
134 [[nodiscard]] bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
135 { return indexOf(c, 0, cs) != -1; }
136
137 [[nodiscard]] qsizetype lastIndexOf(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
138 { return lastIndexOf(s, size(), cs); }
139 [[nodiscard]] qsizetype lastIndexOf(QStringView s, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
140 { return QtPrivate::lastIndexOf(*this, from, s, cs); }
141 [[nodiscard]] qsizetype lastIndexOf(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
142 { return lastIndexOf(s, size(), cs); }
143 [[nodiscard]] qsizetype lastIndexOf(QLatin1StringView s, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
144 { return QtPrivate::lastIndexOf(*this, from, s, cs); }
145 [[nodiscard]] qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
146 { return lastIndexOf(c, -1, cs); }
147 [[nodiscard]] qsizetype lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
148 { return QtPrivate::lastIndexOf(*this, from, QStringView(&c, 1), cs); }
149
150 [[nodiscard]] qsizetype count(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
151 { return QtPrivate::count(*this, str, cs); }
152 [[nodiscard]] qsizetype count(QLatin1StringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
153 { return QtPrivate::count(*this, str, cs); }
154 [[nodiscard]] qsizetype count(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
155 { return QtPrivate::count(*this, ch, cs); }
156
157 [[nodiscard]] short toShort(bool *ok = nullptr, int base = 10) const
158 { return QtPrivate::toIntegral<short>(QByteArrayView(*this), ok, base); }
159 [[nodiscard]] ushort toUShort(bool *ok = nullptr, int base = 10) const
160 { return QtPrivate::toIntegral<ushort>(QByteArrayView(*this), ok, base); }
161 [[nodiscard]] int toInt(bool *ok = nullptr, int base = 10) const
162 { return QtPrivate::toIntegral<int>(QByteArrayView(*this), ok, base); }
163 [[nodiscard]] uint toUInt(bool *ok = nullptr, int base = 10) const
164 { return QtPrivate::toIntegral<uint>(QByteArrayView(*this), ok, base); }
165 [[nodiscard]] long toLong(bool *ok = nullptr, int base = 10) const
166 { return QtPrivate::toIntegral<long>(QByteArrayView(*this), ok, base); }
167 [[nodiscard]] ulong toULong(bool *ok = nullptr, int base = 10) const
168 { return QtPrivate::toIntegral<ulong>(QByteArrayView(*this), ok, base); }
169 [[nodiscard]] qlonglong toLongLong(bool *ok = nullptr, int base = 10) const
170 { return QtPrivate::toIntegral<qlonglong>(QByteArrayView(*this), ok, base); }
171 [[nodiscard]] qulonglong toULongLong(bool *ok = nullptr, int base = 10) const
172 { return QtPrivate::toIntegral<qulonglong>(QByteArrayView(*this), ok, base); }
173 [[nodiscard]] float toFloat(bool *ok = nullptr) const
174 {
175 const auto r = QtPrivate::toFloat(*this);
176 if (ok)
177 *ok = bool(r);
178 return r.value_or(0.0f);
179 }
180 [[nodiscard]] double toDouble(bool *ok = nullptr) const
181 {
182 const auto r = QtPrivate::toDouble(*this);
183 if (ok)
184 *ok = bool(r);
185 return r.value_or(0.0);
186 }
187
188 using value_type = const char;
195 using difference_type = qsizetype; // violates Container concept requirements
196 using size_type = qsizetype; // violates Container concept requirements
197
198 constexpr const_iterator begin() const noexcept { return data(); }
199 constexpr const_iterator cbegin() const noexcept { return data(); }
200 constexpr const_iterator end() const noexcept { return data() + size(); }
201 constexpr const_iterator cend() const noexcept { return data() + size(); }
202
205
206 const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
207 const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
208 const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
209 const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
210
211 [[nodiscard]] constexpr qsizetype max_size() const noexcept { return maxSize(); }
212
213 [[nodiscard]] static constexpr qsizetype maxSize() noexcept
214 {
215 // -1 to deal with the pointer one-past-the-end;
216 return QtPrivate::MaxAllocSize - 1;
217 }
218
219 [[nodiscard]] constexpr QLatin1StringView mid(qsizetype pos, qsizetype n = -1) const
220 {
221 using namespace QtPrivate;
222 auto result = QContainerImplHelper::mid(size(), &pos, &n);
223 return result == QContainerImplHelper::Null ? QLatin1StringView()
224 : QLatin1StringView(m_data + pos, n);
225 }
226 [[nodiscard]] constexpr QLatin1StringView left(qsizetype n) const
227 {
228 if (size_t(n) >= size_t(size()))
229 n = size();
230 return {m_data, n};
231 }
232 [[nodiscard]] constexpr QLatin1StringView right(qsizetype n) const
233 {
234 if (size_t(n) >= size_t(size()))
235 n = size();
236 return {m_data + m_size - n, n};
237 }
238
239 [[nodiscard]] constexpr QLatin1StringView sliced(qsizetype pos) const
240 { verify(pos, 0); return {m_data + pos, m_size - pos}; }
241 [[nodiscard]] constexpr QLatin1StringView sliced(qsizetype pos, qsizetype n) const
242 { verify(pos, n); return {m_data + pos, n}; }
243 [[nodiscard]] constexpr QLatin1StringView first(qsizetype n) const
244 { verify(0, n); return sliced(0, n); }
245 [[nodiscard]] constexpr QLatin1StringView last(qsizetype n) const
246 { verify(0, n); return sliced(size() - n, n); }
247 [[nodiscard]] constexpr QLatin1StringView chopped(qsizetype n) const
248 { verify(0, n); return sliced(0, size() - n); }
249
250 constexpr QLatin1StringView &slice(qsizetype pos)
251 { *this = sliced(pos); return *this; }
252 constexpr QLatin1StringView &slice(qsizetype pos, qsizetype n)
253 { *this = sliced(pos, n); return *this; }
254
255 constexpr void chop(qsizetype n)
256 { verify(0, n); m_size -= n; }
257 constexpr void truncate(qsizetype n)
258 { verify(0, n); m_size = n; }
259
260 [[nodiscard]] QLatin1StringView trimmed() const noexcept { return QtPrivate::trimmed(*this); }
261
262 template <typename Needle, typename...Flags>
263 [[nodiscard]] constexpr auto tokenize(Needle &&needle, Flags...flags) const
264 noexcept(noexcept(qTokenize(std::declval<const QLatin1StringView &>(),
265 std::forward<Needle>(needle), flags...)))
266 -> decltype(qTokenize(*this, std::forward<Needle>(needle), flags...))
267 { return qTokenize(*this, std::forward<Needle>(needle), flags...); }
268
269 friend bool comparesEqual(const QLatin1StringView &s1, const QLatin1StringView &s2) noexcept
270 { return s1.size() == s2.size() && QtPrivate::equalStrings(s1, s2); }
271 friend Qt::strong_ordering
272 compareThreeWay(const QLatin1StringView &s1, const QLatin1StringView &s2) noexcept
273 {
274 const int res = QtPrivate::compareStrings(s1, s2);
275 return Qt::compareThreeWay(res, 0);
276 }
277 Q_DECLARE_STRONGLY_ORDERED(QLatin1StringView)
278
279 // QChar <> QLatin1StringView
280 friend bool comparesEqual(const QLatin1StringView &lhs, QChar rhs) noexcept
281 { return lhs.size() == 1 && rhs == lhs.front(); }
282 friend Qt::strong_ordering
284 {
285 // negate, as the helper function expects QChar as lhs
286 const int res = -compare_helper(&rhs, 1, lhs);
287 return Qt::compareThreeWay(res, 0);
288 }
290
291 // QStringView <> QLatin1StringView
292 friend bool comparesEqual(const QLatin1StringView &lhs, const QStringView &rhs) noexcept
293 { return lhs.size() == rhs.size() && QtPrivate::equalStrings(lhs, rhs); }
294 friend Qt::strong_ordering
296 {
297 const int res = QtPrivate::compareStrings(lhs, rhs);
298 return Qt::compareThreeWay(res, 0);
299 }
301
302 // Reversed helper methods for QStringView <> QLatin1StringView comparison.
303 // If we do not provide them explicitly, QStringView <> QByteArrayView
304 // overloads will be selected, which will provide wrong results, because
305 // they will convert from utf-8
306 friend bool comparesEqual(const QStringView &lhs, const QLatin1StringView &rhs) noexcept
307 { return comparesEqual(rhs, lhs); }
308 friend Qt::strong_ordering
311
312private:
313 friend bool comparesEqual(const QLatin1StringView &lhs, const QByteArrayView &rhs) noexcept
314 { return equal_helper(lhs, rhs.data(), rhs.size()); }
315 friend Qt::strong_ordering
317 {
318 const int res = compare_helper(lhs, rhs.data(), rhs.size());
319 return Qt::compareThreeWay(res, 0);
320 }
321
322 // Reversed helper methods for QByteArrayView <> QLatin1StringView comparison.
323 // If we do not provide them explicitly, QByteArrayView <> QByteArrayView
324 // overloads will be selected, which will provide wrong results
325 friend bool comparesEqual(const QByteArrayView &lhs, const QLatin1StringView &rhs) noexcept
326 { return comparesEqual(rhs, lhs); }
327 friend Qt::strong_ordering
330
331public:
332#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
336#endif // !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
337
338private:
340 [[maybe_unused]] qsizetype n = 1) const
341 {
342 Q_ASSERT(pos >= 0);
343 Q_ASSERT(pos <= size());
344 Q_ASSERT(n >= 0);
345 Q_ASSERT(n <= size() - pos);
346 }
347 static int compare_helper(const QLatin1StringView &s1, const char *s2) noexcept
348 { return compare_helper(s1, s2, qstrlen(s2)); }
349 Q_CORE_EXPORT static bool equal_helper(QLatin1StringView s1, const char *s2, qsizetype len) noexcept;
350 Q_CORE_EXPORT static int compare_helper(const QLatin1StringView &s1, const char *s2, qsizetype len) noexcept;
351 Q_CORE_EXPORT static int compare_helper(const QChar *data1, qsizetype length1,
352 QLatin1StringView s2,
353 Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
354#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
355 const char *m_data = nullptr;
356 qsizetype m_size = 0;
357#else
358 qsizetype m_size;
359 const char *m_data;
360#endif
361
362 friend class QStringView;
363};
364#ifdef Q_L1S_VIEW_IS_PRIMARY
365Q_DECLARE_TYPEINFO(QLatin1StringView, Q_RELOCATABLE_TYPE);
366#else
368#endif
369
370namespace Qt {
371inline namespace Literals {
372inline namespace StringLiterals {
373
374constexpr inline QLatin1StringView operator""_L1(const char *str, size_t size) noexcept
375{
376 return {str, qsizetype(size)};
377}
378
379} // StringLiterals
380} // Literals
381} // Qt
382
383QT_END_NAMESPACE
384
385#ifdef Q_L1S_VIEW_IS_PRIMARY
386# undef Q_L1S_VIEW_IS_PRIMARY
387#endif
388
389#endif // QLATIN1STRINGVIEW_H
const_reverse_iterator rend() const noexcept
long toLong(bool *ok=nullptr, int base=10) const
constexpr QLatin1String(const char *s, qsizetype sz) noexcept
constexpr int compare(QChar c) const noexcept
qulonglong toULongLong(bool *ok=nullptr, int base=10) const
constexpr const_iterator cbegin() const noexcept
qsizetype indexOf(QStringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr QLatin1StringView mid(qsizetype pos, qsizetype n=-1) const
constexpr bool startsWith(QChar c) const noexcept
constexpr QLatin1StringView & slice(qsizetype pos, qsizetype n)
bool endsWith(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr QLatin1Char back() const
constexpr void truncate(qsizetype n)
constexpr QLatin1Char at(qsizetype i) const
constexpr const char * constBegin() const noexcept
value_type * pointer
constexpr bool isNull() const noexcept
QLatin1StringView trimmed() const noexcept
constexpr QLatin1String() noexcept
constexpr qsizetype size() const noexcept
const_reverse_iterator crbegin() const noexcept
int compare(QStringView other, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
ulong toULong(bool *ok=nullptr, int base=10) const
double toDouble(bool *ok=nullptr) const
ushort toUShort(bool *ok=nullptr, int base=10) const
const_reverse_iterator rbegin() const noexcept
constexpr QLatin1StringView last(qsizetype n) const
QString toString() const
constexpr const char * latin1() const noexcept
QLatin1String(const QByteArray &s) noexcept
constexpr const_iterator cend() const noexcept
const char value_type
constexpr QLatin1String(const char *f, const char *l)
QByteArray toUtf8() const
constexpr QLatin1Char operator[](qsizetype i) const
qlonglong toLongLong(bool *ok=nullptr, int base=10) const
constexpr QLatin1String(QByteArrayView s) noexcept
value_type & reference
constexpr const char * constData() const noexcept
constexpr QLatin1StringView & slice(qsizetype pos)
short toShort(bool *ok=nullptr, int base=10) const
constexpr QLatin1StringView right(qsizetype n) const
const_reverse_iterator crend() const noexcept
uint toUInt(bool *ok=nullptr, int base=10) const
float toFloat(bool *ok=nullptr) const
qsizetype lastIndexOf(QStringView s, qsizetype from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
static constexpr qsizetype maxSize() noexcept
QString arg(Args &&...args) const
constexpr QLatin1Char last() const
constexpr bool isEmpty() const noexcept
constexpr qsizetype max_size() const noexcept
constexpr QLatin1String(const char *s) noexcept
constexpr QLatin1StringView left(qsizetype n) const
constexpr auto tokenize(Needle &&needle, Flags...flags) const noexcept(noexcept(qTokenize(std::declval< const QLatin1StringView & >(), std::forward< Needle >(needle), flags...))) -> decltype(qTokenize(*this, std::forward< Needle >(needle), flags...))
bool contains(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr void chop(qsizetype n)
constexpr const_iterator begin() const noexcept
constexpr const_iterator end() const noexcept
constexpr QLatin1StringView chopped(qsizetype n) const
constexpr bool endsWith(QChar c) const noexcept
constexpr QLatin1StringView first(qsizetype n) const
constexpr const char * data() const noexcept
constexpr QLatin1StringView sliced(qsizetype pos, qsizetype n) const
constexpr QLatin1StringView sliced(qsizetype pos) const
int toInt(bool *ok=nullptr, int base=10) const
constexpr qsizetype length() const noexcept
bool startsWith(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr bool empty() const noexcept
reference const_reference
constexpr const char * constEnd() const noexcept
value_type * iterator
constexpr QLatin1Char front() const
qsizetype count(QStringView str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
qsizetype lastIndexOf(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr QLatin1Char first() const
\inmodule QtCore
Definition qstringview.h:77
constexpr QLatin1StringView operator""_L1(const char *str, size_t size) noexcept
Definition qcompare.h:76
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
Q_DECLARE_TYPEINFO(QLatin1String, Q_RELOCATABLE_TYPE)
Qt::strong_ordering compareThreeWay(const QByteArrayView &lhs, const QChar &rhs) noexcept
Definition qstring.cpp:6795