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
qstringlist.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#include <qstringlist.h>
6#if QT_CONFIG(regularexpression)
7# include <qregularexpression.h>
8#endif
9#include <private/qduplicatetracker_p.h>
10#include <QtCore/qlatin1stringmatcher.h>
11
12#include <algorithm>
14
15/*! \typedef QStringListIterator
16 \relates QStringList
17
18 The QStringListIterator type definition provides a Java-style const
19 iterator for QStringList.
20
21 QStringList provides both \l{Java-style iterators} and
22 \l{STL-style iterators}. The Java-style const iterator is simply
23 a type definition for QListIterator<QString>.
24
25 \sa QMutableStringListIterator, QStringList::const_iterator
26*/
27
28/*! \typedef QMutableStringListIterator
29 \relates QStringList
30
31 The QStringListIterator type definition provides a Java-style
32 non-const iterator for QStringList.
33
34 QStringList provides both \l{Java-style iterators} and
35 \l{STL-style iterators}. The Java-style non-const iterator is
36 simply a type definition for QMutableListIterator<QString>.
37
38 \sa QStringListIterator, QStringList::iterator
39*/
40
41/*!
42 \class QStringList
43 \inmodule QtCore
44 \meta qdoc-suppress-inheritance true
45 \brief The QStringList class provides a list of strings.
46
47 \ingroup tools
48 \ingroup shared
49 \ingroup string-processing
50
51 \reentrant
52
53 QStringList is actually just a QList<QString>. Like QList, QStringList is
54 \l{implicitly shared}. It provides fast index-based access as well as fast
55 insertions and removals. Passing string lists as value parameters is both
56 fast and safe.
57
58 All of QList's functionality also applies to QStringList. For example, you
59 can use isEmpty() to test whether the list is empty, and you can call
60 functions like append(), prepend(), insert(), replace(), removeAll(),
61 removeAt(), removeFirst(), removeLast(), and removeOne() to modify a
62 QStringList. In addition, QStringList provides a few convenience
63 functions that make handling lists of strings easier.
64
65 \section1 Initializing
66
67 The default constructor creates an empty list. You can use the
68 initializer-list constructor to create a list with elements:
69
70 \snippet qstringlist/main.cpp 0a
71
72 \section1 Adding Strings
73
74 Strings can be added to a list using the \l
75 {QList::insert()}{insert()}, \l
76 {QList::append()}{append()}, \l
77 {QList::operator+=()}{operator+=()} and \l
78 {operator<<()} functions.
79
80 \l{operator<<()} can be used to
81 conveniently add multiple elements to a list:
82
83 \snippet qstringlist/main.cpp 0b
84
85 \section1 Iterating Over the Strings
86
87 See \l {Iterating over Containers}.
88
89 \section1 Manipulating the Strings
90
91 QStringList provides several functions allowing you to manipulate
92 the contents of a list. You can concatenate all the strings in a
93 string list into a single string (with an optional separator)
94 using the join() function. For example:
95
96 \snippet qstringlist/main.cpp 4
97
98 The argument to join can be a single character or a string.
99
100 To break up a string into a string list, use the QString::split()
101 function:
102
103 \snippet qstringlist/main.cpp 6
104
105 The argument to split can be a single character, a string or a
106 QRegularExpression.
107
108 In addition, the \l {QStringList::operator+()}{operator+()}
109 function allows you to concatenate two string lists into one. To
110 sort a string list, use the sort() function.
111
112 QString list also provides the filter() function which lets you
113 to extract a new list which contains only those strings which
114 contain a particular substring (or match a particular regular
115 expression):
116
117 \snippet qstringlist/main.cpp 7
118
119 The contains() function tells you whether the list contains a
120 given string, while the indexOf() function returns the index of
121 the first occurrence of the given string. The lastIndexOf()
122 function on the other hand, returns the index of the last
123 occurrence of the string.
124
125 Finally, the replaceInStrings() function calls QString::replace()
126 on each string in the string list in turn. For example:
127
128 \snippet qstringlist/main.cpp 8
129
130 \sa QString
131*/
132
133/*!
134 \fn QStringList::QStringList(const QString &str)
135
136 Constructs a string list that contains the given string, \a
137 str. Longer lists are easily created like this:
138
139 \snippet qstringlist/main.cpp 9
140
141 \sa append()
142*/
143
144/*!
145 \fn QStringList::QStringList(const QList<QString> &other)
146
147 Constructs a copy of \a other.
148
149 This operation takes \l{constant time}, because QStringList is
150 \l{implicitly shared}. This makes returning a QStringList from a
151 function very fast. If a shared instance is modified, it will be
152 copied (copy-on-write), and that takes \l{linear time}.
153
154 \sa operator=()
155*/
156
157/*!
158 \fn QStringList::QStringList(QList<QString> &&other)
159 \overload
160 \since 5.4
161
162 Move-constructs from QList<QString>.
163
164 After a successful construction, \a other will be empty.
165*/
166
167/*!
168 \fn QStringList &QStringList::operator=(const QList<QString> &other)
169 \since 5.4
170
171 Copy assignment operator from QList<QString>. Assigns the \a other
172 list of strings to this string list.
173
174 After the operation, \a other and \c *this will be equal.
175*/
176
177/*!
178 \fn QStringList &QStringList::operator=(QList<QString> &&other)
179 \overload
180 \since 5.4
181
182 Move assignment operator from QList<QString>. Moves the \a other
183 list of strings to this string list.
184
185 After the operation, \a other will be empty.
186*/
187
188/*!
189 \fn void QStringList::sort(Qt::CaseSensitivity cs)
190
191 Sorts the list of strings in ascending order.
192
193//! [comparison-case-sensitivity]
194 If \a cs is \l Qt::CaseSensitive (the default), the string comparison
195 is case sensitive; otherwise the comparison is case insensitive.
196//! [comparison-case-sensitivity]
197
198 Sorting is performed using the STL's std::sort() algorithm,
199 which averages \l{linear-logarithmic time}, i.e. O(\e{n} log \e{n}).
200
201 If you want to sort your strings in an arbitrary order, consider
202 using the QMap class. For example, you could use a QMap<QString,
203 QString> to create a case-insensitive ordering (e.g. with the keys
204 being lower-case versions of the strings, and the values being the
205 strings), or a QMap<int, QString> to sort the strings by some
206 integer index.
207*/
208
209void QtPrivate::QStringList_sort(QStringList *that, Qt::CaseSensitivity cs)
210{
211 if (cs == Qt::CaseSensitive) {
212 std::sort(that->begin(), that->end());
213 } else {
214 auto CISCompare = [](const auto &s1, const auto &s2) {
215 return s1.compare(s2, Qt::CaseInsensitive) < 0;
216 };
217 std::sort(that->begin(), that->end(), CISCompare);
218 }
219}
220
221
222/*!
223 \fn QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
224
225 Returns a list of all the strings containing the substring \a str.
226
227 \include qstringlist.cpp comparison-case-sensitivity
228
229 \snippet qstringlist/main.cpp 5
230 \snippet qstringlist/main.cpp 10
231
232 This is equivalent to
233
234 \snippet qstringlist/main.cpp 11
235 \snippet qstringlist/main.cpp 12
236
237 \sa contains()
238*/
239
240template <typename String>
241static QStringList filter_helper(const QStringList &that, const String &needle, Qt::CaseSensitivity cs)
242{
243 QStringList res;
244 for (const auto &s : that) {
245 if (s.contains(needle, cs))
246 res.append(s);
247 }
248 return res;
249}
250
251/*!
252 \fn QStringList QStringList::filter(QStringView str, Qt::CaseSensitivity cs) const
253 \overload
254 \since 5.14
255*/
256QStringList QtPrivate::QStringList_filter(const QStringList *that, QStringView str,
257 Qt::CaseSensitivity cs)
258{
259 return filter_helper(*that, str, cs);
260}
261
262/*!
263 \fn QStringList QStringList::filter(const QStringMatcher &matcher) const
264 \since 6.7
265 \overload
266
267 Returns a list of all the strings matched by \a matcher (i.e. for which
268 \c matcher.indexIn() returns an index >= 0).
269
270 Using a QStringMatcher may be faster when searching in large lists and/or
271 in lists with long strings (the best way to find out is benchmarking).
272
273 For example:
274 \snippet qstringlist/main.cpp 18
275
276 \sa contains(), filter(const QLatin1StringMatcher &)
277*/
278
279/*!
280 \fn QStringList QStringList::filter(const QLatin1StringMatcher &matcher) const
281 \since 6.9
282
283 Returns a list of all the strings matched by \a matcher (i.e. for which
284 \c matcher.indexIn() returns an index >= 0).
285
286 Using QLatin1StringMatcher may be faster when searching in large
287 lists and/or in lists with long strings (the best way to find out is
288 benchmarking).
289
290 For example:
291 \snippet qstringlist/main.cpp 19
292
293 \sa contains(), filter(const QStringMatcher &)
294*/
295QStringList QtPrivate::QStringList_filter(const QStringList &that, const QStringMatcher &matcher)
296{
297 QStringList res;
298 for (const auto &s : that) {
299 if (matcher.indexIn(s) != -1)
300 res.append(s);
301 }
302 return res;
303}
304
305QStringList QtPrivate::QStringList_filter(const QStringList &that, const QLatin1StringMatcher &matcher)
306{
307 QStringList res;
308 for (const auto &s : that) {
309 if (matcher.indexIn(s) != -1)
310 res.append(s);
311 }
312 return res;
313}
314
315/*!
316 \fn QStringList QStringList::filter(QLatin1StringView str, Qt::CaseSensitivity cs) const
317 \since 6.7
318 \overload
319*/
320
321QStringList QtPrivate::QStringList_filter(const QStringList &that, QLatin1StringView needle,
322 Qt::CaseSensitivity cs)
323{
324 return filter_helper(that, needle, cs);
325}
326
327template<typename T>
328static bool stringList_contains(const QStringList &stringList, const T &str, Qt::CaseSensitivity cs)
329{
330 for (const auto &string : stringList) {
331 if (string.size() == str.size() && string.compare(str, cs) == 0)
332 return true;
333 }
334 return false;
335}
336
337
338/*!
339 \fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
340
341 Returns \c true if the list contains the string \a str; otherwise
342 returns \c false.
343
344 \include qstringlist.cpp comparison-case-sensitivity
345
346 \sa indexOf(), lastIndexOf(), QString::contains()
347 */
348
349/*!
350 \fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
351 \overload
352 \since 5.12
353
354 Returns \c true if the list contains the string \a str; otherwise
355 returns \c false.
356
357 \include qstringlist.cpp comparison-case-sensitivity
358 */
359bool QtPrivate::QStringList_contains(const QStringList *that, QStringView str,
360 Qt::CaseSensitivity cs)
361{
362 return stringList_contains(*that, str, cs);
363}
364
365/*!
366 \fn bool QStringList::contains(QLatin1StringView str, Qt::CaseSensitivity cs) const
367 \overload
368 \since 5.10
369
370 Returns \c true if the list contains the Latin-1 string viewed by \a str; otherwise
371 returns \c false.
372
373 \include qstringlist.cpp comparison-case-sensitivity
374
375 \sa indexOf(), lastIndexOf(), QString::contains()
376 */
377bool QtPrivate::QStringList_contains(const QStringList *that, QLatin1StringView str,
378 Qt::CaseSensitivity cs)
379{
380 return stringList_contains(*that, str, cs);
381}
382
383
384#if QT_CONFIG(regularexpression)
385/*!
386 \fn QStringList QStringList::filter(const QRegularExpression &re) const
387 \overload
388 \since 5.0
389
390 Returns a list of all the strings that match the regular
391 expression \a re.
392*/
393QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegularExpression &re)
394{
395 QStringList res;
396 for (const auto &str : *that) {
397 if (str.contains(re))
398 res.append(str);
399 }
400 return res;
401}
402#endif // QT_CONFIG(regularexpression)
403
404/*!
405 \fn QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
406
407 Returns a string list where every string has had the \a before
408 text replaced with the \a after text wherever the \a before text
409 is found.
410
411 \note If you use an empty \a before argument, the \a after argument will be
412 inserted \e {before and after} each character of the string.
413
414 \include qstringlist.cpp comparison-case-sensitivity
415
416 For example:
417
418 \snippet qstringlist/main.cpp 5
419 \snippet qstringlist/main.cpp 13
420
421 \sa QString::replace()
422*/
423
424/*!
425 \fn QStringList &QStringList::replaceInStrings(QStringView before, const QString &after, Qt::CaseSensitivity cs)
426 \overload
427 \since 5.14
428*/
429
430/*!
431 \fn QStringList &QStringList::replaceInStrings(const QString &before, QStringView after, Qt::CaseSensitivity cs)
432 \overload
433 \since 5.14
434*/
435
436/*!
437 \fn QStringList &QStringList::replaceInStrings(QStringView before, QStringView after, Qt::CaseSensitivity cs)
438 \overload
439 \since 5.14
440*/
441void QtPrivate::QStringList_replaceInStrings(QStringList *that, QStringView before,
442 QStringView after, Qt::CaseSensitivity cs)
443{
444 // Before potentially detaching "that" list, check if any string contains "before"
445 qsizetype i = -1;
446 for (qsizetype j = 0; j < that->size(); ++j) {
447 if (that->at(j).contains(before, cs)) {
448 i = j;
449 break;
450 }
451 }
452 if (i == -1)
453 return;
454
455 for (; i < that->size(); ++i)
456 (*that)[i].replace(before.data(), before.size(), after.data(), after.size(), cs);
457}
458
459#if QT_CONFIG(regularexpression)
460/*!
461 \fn QStringList &QStringList::replaceInStrings(const QRegularExpression &re, const QString &after)
462 \overload
463 \since 5.0
464
465 Replaces every occurrence of the regular expression \a re, in each of the
466 string lists's strings, with \a after. Returns a reference to the string
467 list.
468
469 For example:
470
471 \snippet qstringlist/main.cpp 5
472 \snippet qstringlist/main.cpp 16
473
474 For regular expressions that contain capturing groups,
475 occurrences of \b{\\1}, \b{\\2}, ..., in \a after are
476 replaced with the string captured by the corresponding capturing group.
477
478 For example:
479
480 \snippet qstringlist/main.cpp 5
481 \snippet qstringlist/main.cpp 17
482*/
483void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegularExpression &re,
484 const QString &after)
485{
486 // Before potentially detaching "that" list, check if any string contains "before"
487 qsizetype i = -1;
488 for (qsizetype j = 0; j < that->size(); ++j) {
489 if (that->at(j).contains(re)) {
490 i = j;
491 break;
492 }
493 }
494 if (i == -1)
495 return;
496
497 for (; i < that->size(); ++i)
498 (*that)[i].replace(re, after);
499}
500#endif // QT_CONFIG(regularexpression)
501
502static qsizetype accumulatedSize(const QStringList &list, qsizetype seplen)
503{
504 qsizetype result = 0;
505 if (!list.isEmpty()) {
506 for (const auto &e : list)
507 result += e.size() + seplen;
508 result -= seplen;
509 }
510 return result;
511}
512
513/*!
514 \fn QString QStringList::join(const QString &separator) const
515
516 Joins all the string list's strings into a single string with each
517 element separated by the given \a separator (which can be an
518 empty string).
519
520 \sa QString::split()
521*/
522
523/*!
524 \fn QString QStringList::join(QChar separator) const
525 \since 5.0
526 \overload join()
527*/
528QString QtPrivate::QStringList_join(const QStringList *that, const QChar *sep, qsizetype seplen)
529{
530 const qsizetype totalLength = accumulatedSize(*that, seplen);
531 const qsizetype size = that->size();
532
533 QString res;
534 if (totalLength == 0)
535 return res;
536 res.reserve(totalLength);
537 for (qsizetype i = 0; i < size; ++i) {
538 if (i)
539 res.append(sep, seplen);
540 res += that->at(i);
541 }
542 return res;
543}
544
545/*!
546 \fn QString QStringList::join(QLatin1StringView separator) const
547 \since 5.8
548 \overload join()
549*/
550QString QtPrivate::QStringList_join(const QStringList &list, QLatin1StringView sep)
551{
552 QString result;
553 if (!list.isEmpty()) {
554 result.reserve(accumulatedSize(list, sep.size()));
555 const auto end = list.end();
556 auto it = list.begin();
557 result += *it;
558 while (++it != end) {
559 result += sep;
560 result += *it;
561 }
562 }
563 return result;
564}
565
566/*!
567 \fn QString QStringList::join(QStringView separator) const
568 \overload
569 \since 5.14
570*/
571QString QtPrivate::QStringList_join(const QStringList *that, QStringView sep)
572{
573 return QStringList_join(that, sep.data(), sep.size());
574}
575
576/*!
577 \fn QStringList QStringList::operator+(const QStringList &other) const
578
579 Returns a string list that is the concatenation of this string
580 list with the \a other string list.
581
582 \sa append()
583*/
584
585/*!
586 \fn QStringList &QStringList::operator<<(const QString &str)
587
588 Appends the given string, \a str, to this string list and returns
589 a reference to the string list.
590
591 \sa append()
592*/
593
594/*!
595 \fn QStringList &QStringList::operator<<(const QStringList &other)
596
597 \overload
598
599 Appends the \a other string list to the string list and returns a reference to
600 the latter string list.
601*/
602
603/*!
604 \fn QStringList &QStringList::operator<<(const QList<QString> &other)
605 \since 5.4
606
607 \overload
608
609 Appends the \a other string list to the string list and returns a reference to
610 the latter string list.
611*/
612
613/*!
614 \fn qsizetype QStringList::indexOf(const QString &str, qsizetype from, Qt::CaseSensitivity cs) const
615 \fn qsizetype QStringList::indexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const
616 \fn qsizetype QStringList::indexOf(QLatin1StringView str, qsizetype from, Qt::CaseSensitivity cs) const
617
618 Returns the index position of the first match of \a str in the list,
619 searching forward from index position \a from. Returns -1 if no item
620 matched.
621
622 \include qstringlist.cpp comparison-case-sensitivity
623
624//! [overloading-base-class-methods]
625 \note The \a cs parameter was added in Qt 6.7, i.e. these methods now overload
626 the methods inherited from the base class. Prior to that these methods only
627 had two parameters. This change is source compatible and existing code should
628 continue to work.
629//! [overloading-base-class-methods]
630
631 \sa lastIndexOf()
632*/
633
634template <typename String>
635qsizetype indexOf_helper(const QStringList &that, String needle, qsizetype from,
636 Qt::CaseSensitivity cs)
637{
638 if (from < 0) // Historical behavior
639 from = qMax(from + that.size(), 0);
640
641 if (from >= that.size())
642 return -1;
643
644 for (qsizetype i = from; i < that.size(); ++i) {
645 if (needle.compare(that.at(i), cs) == 0)
646 return i;
647 }
648 return -1;
649}
650
651qsizetype QtPrivate::QStringList_indexOf(const QStringList &that, QStringView needle,
652 qsizetype from, Qt::CaseSensitivity cs)
653{
654 return indexOf_helper(that, needle, from, cs);
655}
656
657qsizetype QtPrivate::QStringList_indexOf(const QStringList &that, QLatin1StringView needle,
658 qsizetype from, Qt::CaseSensitivity cs)
659{
660 return indexOf_helper(that, needle, from, cs);
661}
662
663/*!
664 \fn qsizetype QStringList::lastIndexOf(const QString &str, qsizetype from, Qt::CaseSensitivity cs) const
665 \fn qsizetype QStringList::lastIndexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const
666 \fn qsizetype QStringList::lastIndexOf(QLatin1StringView str, qsizetype from, Qt::CaseSensitivity cs) const
667
668 Returns the index position of the last match of \a str in the list,
669 searching backward from index position \a from. If \a from is -1 (the
670 default), the search starts at the last item. Returns -1 if no item
671 matched.
672
673 \include qstringlist.cpp comparison-case-sensitivity
674
675 \include qstringlist.cpp overloading-base-class-methods
676
677 \sa indexOf()
678*/
679
680template <typename String>
681qsizetype lastIndexof_helper(const QStringList &that, String needle, qsizetype from,
682 Qt::CaseSensitivity cs)
683{
684 if (from < 0)
685 from += that.size();
686 else if (from >= that.size())
687 from = that.size() - 1;
688
689 for (qsizetype i = from; i >= 0; --i) {
690 if (needle.compare(that.at(i), cs) == 0)
691 return i;
692 }
693
694 return -1;
695}
696
697qsizetype QtPrivate::QStringList_lastIndexOf(const QStringList &that, QLatin1StringView needle,
698 qsizetype from, Qt::CaseSensitivity cs)
699{
700 return lastIndexof_helper(that, needle, from, cs);
701}
702
703qsizetype QtPrivate::QStringList_lastIndexOf(const QStringList &that, QStringView needle,
704 qsizetype from, Qt::CaseSensitivity cs)
705{
706 return lastIndexof_helper(that, needle, from, cs);
707}
708
709#if QT_CONFIG(regularexpression)
710/*!
711 \fn qsizetype QStringList::indexOf(const QRegularExpression &re, qsizetype from) const
712 \overload
713 \since 5.0
714
715 Returns the index position of the first exact match of \a re in
716 the list, searching forward from index position \a from. Returns
717 -1 if no item matched.
718
719 \sa lastIndexOf()
720*/
721qsizetype QtPrivate::QStringList_indexOf(const QStringList *that, const QRegularExpression &re, qsizetype from)
722{
723 if (from < 0)
724 from = qMax(from + that->size(), qsizetype(0));
725
726 QString exactPattern = QRegularExpression::anchoredPattern(re.pattern());
727 QRegularExpression exactRe(exactPattern, re.patternOptions());
728
729 for (qsizetype i = from; i < that->size(); ++i) {
730 QRegularExpressionMatch m = exactRe.match(that->at(i));
731 if (m.hasMatch())
732 return i;
733 }
734 return -1;
735}
736
737/*!
738 \fn qsizetype QStringList::lastIndexOf(const QRegularExpression &re, qsizetype from) const
739 \overload
740 \since 5.0
741
742 Returns the index position of the last exact match of \a re in
743 the list, searching backward from index position \a from. If \a
744 from is -1 (the default), the search starts at the last item.
745 Returns -1 if no item matched.
746
747 \sa indexOf()
748*/
749qsizetype QtPrivate::QStringList_lastIndexOf(const QStringList *that, const QRegularExpression &re, qsizetype from)
750{
751 if (from < 0)
752 from += that->size();
753 else if (from >= that->size())
754 from = that->size() - 1;
755
756 QString exactPattern = QRegularExpression::anchoredPattern(re.pattern());
757 QRegularExpression exactRe(exactPattern, re.patternOptions());
758
759 for (qsizetype i = from; i >= 0; --i) {
760 QRegularExpressionMatch m = exactRe.match(that->at(i));
761 if (m.hasMatch())
762 return i;
763 }
764 return -1;
765}
766#endif // QT_CONFIG(regularexpression)
767
768/*!
769 \fn qsizetype QStringList::removeDuplicates()
770
771 \since 4.5
772
773 This function removes duplicate entries from a list.
774 The entries do not have to be sorted. They will retain their
775 original order.
776
777 Returns the number of removed entries.
778*/
779qsizetype QtPrivate::QStringList_removeDuplicates(QStringList *that)
780{
781 QDuplicateTracker<QString> seen(that->size());
782 return that->removeIf([&](const QString &s) { return seen.hasSeen(s); });
783}
784
785QT_END_NAMESPACE
QT_BEGIN_NAMESPACEQStringListIterator
The QStringListIterator type definition provides a Java-style const iterator for QStringList.
qsizetype indexOf_helper(const QStringList &that, String needle, qsizetype from, Qt::CaseSensitivity cs)
static QStringList filter_helper(const QStringList &that, const String &needle, Qt::CaseSensitivity cs)
qsizetype lastIndexof_helper(const QStringList &that, String needle, qsizetype from, Qt::CaseSensitivity cs)
static bool stringList_contains(const QStringList &stringList, const T &str, Qt::CaseSensitivity cs)
static qsizetype accumulatedSize(const QStringList &list, qsizetype seplen)