QtPrivate Namespace Reference


Functions

void QStringList_sort (QStringList *that)
QStringList QStringList_filter (const QStringList *that, const QString &str, Qt::CaseSensitivity cs)
QBool QStringList_contains (const QStringList *that, const QString &str, Qt::CaseSensitivity cs)
QStringList QStringList_filter (const QStringList *that, const QRegExp &rx)
void QStringList_replaceInStrings (QStringList *that, const QString &before, const QString &after, Qt::CaseSensitivity cs)
void QStringList_replaceInStrings (QStringList *that, const QRegExp &rx, const QString &after)
QString QStringList_join (const QStringList *that, const QString &sep)
int QStringList_indexOf (const QStringList *that, const QRegExp &rx, int from)
int QStringList_lastIndexOf (const QStringList *that, const QRegExp &rx, int from)


Function Documentation

QBool Q_CORE_EXPORT QtPrivate::QStringList_contains ( const QStringList that,
const QString str,
Qt::CaseSensitivity  cs 
)

Definition at line 336 of file qstringlist.cpp.

References QList< T >::at(), i, QStringMatcher::indexIn(), QString::length(), and QList< T >::size().

Referenced by QStringList::contains().

00338 {
00339     QStringMatcher matcher(str, cs);
00340     for (int i = 0; i < that->size(); ++i) {
00341         QString string(that->at(i));
00342         if (string.length() == str.length() && matcher.indexIn(string) == 0)
00343             return QBool(true);
00344     }
00345     return QBool(false);
00346 }

Here is the call graph for this function:

QStringList Q_CORE_EXPORT QtPrivate::QStringList_filter ( const QStringList that,
const QRegExp rx 
)

Definition at line 357 of file qstringlist.cpp.

References QList< T >::at(), QString::contains(), i, and QList< T >::size().

00358 {
00359     QStringList res;
00360     for (int i = 0; i < that->size(); ++i)
00361         if (that->at(i).contains(rx))
00362             res << that->at(i);
00363     return res;
00364 }

Here is the call graph for this function:

QStringList Q_CORE_EXPORT QtPrivate::QStringList_filter ( const QStringList that,
const QString str,
Qt::CaseSensitivity  cs 
)

Definition at line 315 of file qstringlist.cpp.

References QList< T >::at(), i, QStringMatcher::indexIn(), and QList< T >::size().

Referenced by QStringList::filter().

00317 {
00318     QStringMatcher matcher(str, cs);
00319     QStringList res;
00320     for (int i = 0; i < that->size(); ++i)
00321         if (matcher.indexIn(that->at(i)) != -1)
00322             res << that->at(i);
00323     return res;
00324 }

Here is the call graph for this function:

int Q_CORE_EXPORT QtPrivate::QStringList_indexOf ( const QStringList that,
const QRegExp rx,
int  from 
)

Definition at line 558 of file qstringlist.cpp.

References QList< T >::at(), QRegExp::exactMatch(), i, qMax(), and QList< T >::size().

Referenced by QStringList::indexOf().

00559 {
00560    if (from < 0)
00561        from = qMax(from + that->size(), 0);
00562    for (int i = from; i < that->size(); ++i) {
00563         if (rx.exactMatch(that->at(i)))
00564             return i;
00565     }
00566     return -1;
00567 }

Here is the call graph for this function:

QString Q_CORE_EXPORT QtPrivate::QStringList_join ( const QStringList that,
const QString sep 
)

Definition at line 440 of file qstringlist.cpp.

References QList< T >::at(), i, and QList< T >::size().

Referenced by QStringList::join().

00441 {
00442     QString res;
00443     for (int i = 0; i < that->size(); ++i) {
00444         if (i)
00445             res += sep;
00446         res += that->at(i);
00447     }
00448     return res;
00449 }

Here is the call graph for this function:

int Q_CORE_EXPORT QtPrivate::QStringList_lastIndexOf ( const QStringList that,
const QRegExp rx,
int  from 
)

Definition at line 579 of file qstringlist.cpp.

References QList< T >::at(), QRegExp::exactMatch(), i, and QList< T >::size().

Referenced by QStringList::lastIndexOf().

00580 {
00581     if (from < 0)
00582         from += that->size();
00583     else if (from >= that->size())
00584         from = that->size() - 1;
00585     for (int i = from; i >= 0; --i) {
00586         if (rx.exactMatch(that->at(i)))
00587             return i;
00588         }
00589     return -1;
00590 }

Here is the call graph for this function:

void Q_CORE_EXPORT QtPrivate::QStringList_replaceInStrings ( QStringList that,
const QRegExp rx,
const QString after 
)

Definition at line 424 of file qstringlist.cpp.

References i, and QList< T >::size().

00425 {
00426     for (int i = 0; i < that->size(); ++i)
00427         (*that)[i].replace(rx, after);
00428 }

Here is the call graph for this function:

void Q_CORE_EXPORT QtPrivate::QStringList_replaceInStrings ( QStringList that,
const QString before,
const QString after,
Qt::CaseSensitivity  cs 
)

Definition at line 385 of file qstringlist.cpp.

References i, and QList< T >::size().

Referenced by QStringList::replaceInStrings().

00387 {
00388     for (int i = 0; i < that->size(); ++i)
00389         (*that)[i].replace(before, after, cs);
00390 }

Here is the call graph for this function:

void Q_CORE_EXPORT QtPrivate::QStringList_sort ( QStringList that  ) 

Definition at line 228 of file qstringlist.cpp.

References qSort().

Referenced by QStringList::sort().

00229 {
00230     qSort(*that);
00231 }

Here is the call graph for this function:


Generated on Thu Mar 15 20:51:48 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1