diff options
author | Timothy Pearson <[email protected]> | 2011-08-09 22:25:47 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-08-09 22:25:47 -0500 |
commit | eaa7ee2e0bbca40ba3173c4304f81957e8964291 (patch) | |
tree | 4f793aa48a5080aedc94ce6e519c3b86708f2b88 /tqtinterface/qt4/src/tools/tqstringlist.cpp | |
parent | 79a9d7a46a20d4a0923bc06fc471fdc2176ef865 (diff) | |
download | experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.tar.gz experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
Diffstat (limited to 'tqtinterface/qt4/src/tools/tqstringlist.cpp')
-rw-r--r-- | tqtinterface/qt4/src/tools/tqstringlist.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tqtinterface/qt4/src/tools/tqstringlist.cpp b/tqtinterface/qt4/src/tools/tqstringlist.cpp index 6a10959..502b5dc 100644 --- a/tqtinterface/qt4/src/tools/tqstringlist.cpp +++ b/tqtinterface/qt4/src/tools/tqstringlist.cpp @@ -105,7 +105,7 @@ \endcode You can sort the list with sort(), and extract a new list which - tqcontains only those strings which contain a particular substring + contains only those strings which contain a particular substring (or match a particular regular expression) using the grep() functions, e.g. \code @@ -230,7 +230,7 @@ TQStringList TQStringList::split( const TQString &sep, const TQString &str, TQStringList lst; int j = 0; - int i = str.tqfind( sep, j ); + int i = str.find( sep, j ); while ( i != -1 ) { if ( i > j && i <= (int)str.length() ) @@ -238,7 +238,7 @@ TQStringList TQStringList::split( const TQString &sep, const TQString &str, else if ( allowEmptyEntries ) lst << TQString::null; j = i + sep.length(); - i = str.tqfind( sep, sep.length() > 0 ? j : j+1 ); + i = str.find( sep, sep.length() > 0 ? j : j+1 ); } int l = str.length() - 1; @@ -316,14 +316,14 @@ TQStringList TQStringList::split( const TQRegExp &sep, const TQString &str, // list == ["Bill Gates", "Bill Clinton"] \endcode - \sa TQString::tqfind() + \sa TQString::find() */ TQStringList TQStringList::grep( const TQString &str, bool cs ) const { TQStringList res; for ( TQStringList::ConstIterator it = begin(); it != end(); ++it ) - if ( (*it).tqcontains(str, cs) ) + if ( (*it).contains(str, cs) ) res << *it; return res; @@ -336,14 +336,14 @@ TQStringList TQStringList::grep( const TQString &str, bool cs ) const Returns a list of all the strings that match the regular expression \a rx. - \sa TQString::tqfind() + \sa TQString::find() */ TQStringList TQStringList::grep( const TQRegExp &rx ) const { TQStringList res; for ( TQStringList::ConstIterator it = begin(); it != end(); ++it ) - if ( (*it).tqfind(rx) != -1 ) + if ( (*it).find(rx) != -1 ) res << *it; return res; @@ -366,14 +366,14 @@ TQStringList TQStringList::grep( const TQRegExp &rx ) const // list == ["olpho", "beto", "gommo", "epsilon"] \endcode - \sa TQString::tqreplace() + \sa TQString::replace() */ TQStringList& TQStringList::gres( const TQString &before, const TQString &after, bool cs ) { TQStringList::Iterator it = begin(); while ( it != end() ) { - (*it).tqreplace( before, after, cs ); + (*it).replace( before, after, cs ); ++it; } return *this; @@ -396,7 +396,7 @@ TQStringList& TQStringList::gres( const TQString &before, const TQString &after, For regexps containing \link tqregexp.html#capturing-text capturing parentheses \endlink, occurrences of <b>\\1</b>, - <b>\\2</b>, ..., in \a after are tqreplaced with \a{rx}.cap(1), + <b>\\2</b>, ..., in \a after are replaced with \a{rx}.cap(1), cap(2), ... Example: @@ -407,13 +407,13 @@ TQStringList& TQStringList::gres( const TQString &before, const TQString &after, // list == ["Bill Clinton", "Bill Gates"] \endcode - \sa TQString::tqreplace() + \sa TQString::replace() */ TQStringList& TQStringList::gres( const TQRegExp &rx, const TQString &after ) { TQStringList::Iterator it = begin(); while ( it != end() ) { - (*it).tqreplace( rx, after ); + (*it).replace( rx, after ); ++it; } return *this; |