Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qstringlist.cpp File Reference

(f2e19d37de36a2dd7bea8710d4582414f3fa175b)

#include <qstringlist.h>
#include <qset.h>
#include <private/qduplicatetracker_p.h>
#include <algorithm>
+ Include dependency graph for qstringlist.cpp:

Go to the source code of this file.

Functions

template<typename String >
static QStringList filter_helper (const QStringList &that, const String &needle, Qt::CaseSensitivity cs)
 
template<typename T >
static bool stringList_contains (const QStringList &stringList, const T &str, Qt::CaseSensitivity cs)
 
static qsizetype accumulatedSize (const QStringList &list, qsizetype seplen)
 
template<typename String >
qsizetype indexOf_helper (const QStringList &that, String needle, qsizetype from, Qt::CaseSensitivity cs)
 
template<typename String >
qsizetype lastIndexof_helper (const QStringList &that, String needle, qsizetype from, Qt::CaseSensitivity cs)
 

Function Documentation

◆ accumulatedSize()

static qsizetype accumulatedSize ( const QStringList & list,
qsizetype seplen )
static

Definition at line 473 of file qstringlist.cpp.

References QList< T >::isEmpty(), and list.

Referenced by QtPrivate::QStringList_join(), and QtPrivate::QStringList_join().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filter_helper()

template<typename String >
static QStringList filter_helper ( const QStringList & that,
const String & needle,
Qt::CaseSensitivity cs )
static

Definition at line 241 of file qstringlist.cpp.

Referenced by QtPrivate::QStringList_filter(), and QtPrivate::QStringList_filter().

+ Here is the caller graph for this function:

◆ indexOf_helper()

template<typename String >
qsizetype indexOf_helper ( const QStringList & that,
String needle,
qsizetype from,
Qt::CaseSensitivity cs )
\fn qsizetype QStringList::indexOf(const QString &str, qsizetype from, Qt::CaseSensitivity cs) const
\fn qsizetype QStringList::indexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const
\fn qsizetype QStringList::indexOf(QLatin1StringView str, qsizetype from, Qt::CaseSensitivity cs) const

Returns the index position of the first match of \a str in the list,
searching forward from index position \a from. Returns -1 if no item
matched.

\include qstringlist.cpp comparison-case-sensitivity

! [overloading-base-class-methods]

Note
The cs parameter was added in Qt 6.7, i.e. these methods now overload the methods inherited from the base class. Prior to that these methods only had two parameters. This change is source compatible and existing code should continue to work. ! [overloading-base-class-methods]
\sa lastIndexOf()

Definition at line 606 of file qstringlist.cpp.

References i, and qMax().

Referenced by QtPrivate::QStringList_indexOf(), and QtPrivate::QStringList_indexOf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lastIndexof_helper()

template<typename String >
qsizetype lastIndexof_helper ( const QStringList & that,
String needle,
qsizetype from,
Qt::CaseSensitivity cs )

Definition at line 652 of file qstringlist.cpp.

References i.

Referenced by QtPrivate::QStringList_lastIndexOf(), and QtPrivate::QStringList_lastIndexOf().

+ Here is the caller graph for this function:

◆ stringList_contains()

template<typename T >
static bool stringList_contains ( const QStringList & stringList,
const T & str,
Qt::CaseSensitivity cs )
static

Definition at line 302 of file qstringlist.cpp.

References QString::size(), str, and stringList.

Referenced by QtPrivate::QStringList_contains(), and QtPrivate::QStringList_contains().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: