45 #include <QtCore/qalgorithms.h> 46 #include <QtCore/qdatastream.h> 47 #include <QtCore/qlist.h> 48 #include <QtCore/qregexp.h> 49 #include <QtCore/qstring.h> 50 #include <QtCore/qstringmatcher.h> 51 #ifdef QT_INCLUDE_COMPAT 52 #include <Qt3Support/q3valuelist.h> 73 #ifdef Q_COMPILER_INITIALIZER_LISTS 78 inline int removeDuplicates();
80 inline QString join(
const QString &sep)
const;
90 { append(str);
return *
this; }
92 { *
this +=
l;
return *
this; }
96 inline QStringList &replaceInStrings(
const QRegExp &rx,
const QString &after);
97 inline int indexOf(
const QRegExp &rx,
int from = 0)
const;
98 inline int lastIndexOf(
const QRegExp &rx,
int from = -1)
const;
99 inline int indexOf(QRegExp &rx,
int from = 0)
const;
100 inline int lastIndexOf(QRegExp &rx,
int from = -1)
const;
102 #if !defined(Q_NO_USING_KEYWORD) 106 inline int indexOf(
const QString &str,
int from = 0)
const 108 inline int lastIndexOf(
const QString &str,
int from = -1)
const 112 static inline QT3_SUPPORT
QStringList split(
const QString &sep,
const QString &str,
bool allowEmptyEntries =
false);
113 static inline QT3_SUPPORT
QStringList split(
const QChar &sep,
const QString &str,
bool allowEmptyEntries =
false);
114 inline QT3_SUPPORT
QStringList grep(
const QString &str,
bool cs =
true)
const 118 static inline QT3_SUPPORT
QStringList split(
const QRegExp &sep,
const QString &str,
bool allowEmptyEntries =
false);
119 inline QT3_SUPPORT
QStringList grep(
const QRegExp &rx)
const {
return filter(rx); }
120 inline QT3_SUPPORT
QStringList &gres(
const QRegExp &rx,
const QString &after)
121 {
return replaceInStrings(rx, after); }
123 inline QT3_SUPPORT
QStringList &gres(
const QString &before,
const QString &after,
bool cs =
true)
242 #endif // QT_NO_REGEXP 244 #endif // QT3_SUPPORT 247 #ifndef QT_NO_DATASTREAM 254 return operator<<(out, static_cast<const QList<QString> &>(list));
256 #endif // QT_NO_DATASTREAM 262 #endif // QSTRINGLIST_H void Q_CORE_EXPORT QStringList_sort(QStringList *that)
QStringList filter(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns a list of all the strings containing the substring str.
int Q_CORE_EXPORT QStringList_indexOf(const QStringList *that, const QRegExp &rx, int from)
#define QT_END_NAMESPACE
This macro expands to.
int removeDuplicates()
This function removes duplicate entries from a list.
The QRegExp class provides pattern matching using regular expressions.
QBool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs)
QStringList & replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs=Qt::CaseSensitive)
Returns a string list where every string has had the before text replaced with the after text whereve...
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after, Qt::CaseSensitivity cs)
The QString class provides a Unicode character string.
QStringList(const QStringList &l)
Constructs a copy of the other string list.
The QChar class provides a 16-bit Unicode character.
iterator Iterator
Qt-style synonym for QList::iterator.
QDataStream & operator<<(QDataStream &out, const QStringList &list)
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str, Qt::CaseSensitivity cs)
QStringList(const QString &i)
Constructs a string list that contains the given string, str.
int Q_CORE_EXPORT QStringList_removeDuplicates(QStringList *that)
QMutableListIterator< QString > QMutableStringListIterator
int indexOf(const QRegExp &rx, int from=0) const
Returns the index position of the first exact match of rx in the list, searching forward from index p...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void sort()
Sorts the list of strings in ascending order (case sensitively).
static bool isEmpty(const char *str)
int lastIndexOf(const T &t, int from=-1) const
Returns the index position of the last occurrence of value in the list, searching backward from index...
static void sort(T *array, int count, LessThan lessThan)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QStringList()
Constructs an empty string list.
QString Q_CORE_EXPORT QStringList_join(const QStringList *that, const QString &sep)
The QStringList class provides a list of strings.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static void split(QT_FT_Vector *b)
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
QStringList(const QList< QString > &l)
Constructs a copy of other.
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
QStringList operator+(const QStringList &other) const
Returns a string list that is the concatenation of this string list with the other string list...
int lastIndexOf(const QRegExp &rx, int from=-1) const
Returns the index position of the last exact match of rx in the list, searching backward from index p...
QStringList & operator<<(const QStringList &l)
Appends the other string list to the string list and returns a reference to the latter string list...
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
QStringList & operator<<(const QString &str)
Appends the given string, str, to this string list and returns a reference to the string list...
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
QListIterator< QString > QStringListIterator
int Q_CORE_EXPORT QStringList_lastIndexOf(const QStringList *that, const QRegExp &rx, int from)
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
The QDataStream class provides serialization of binary data to a QIODevice.
static const KeyPair *const end
QDataStream & operator>>(QDataStream &in, QStringList &list)
The QList class is a template class that provides lists.