diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/src/tools/tqstring.cpp')
-rw-r--r-- | experimental/tqtinterface/qt4/src/tools/tqstring.cpp | 294 |
1 files changed, 147 insertions, 147 deletions
diff --git a/experimental/tqtinterface/qt4/src/tools/tqstring.cpp b/experimental/tqtinterface/qt4/src/tools/tqstring.cpp index 9c31fcc0f..c57b53967 100644 --- a/experimental/tqtinterface/qt4/src/tools/tqstring.cpp +++ b/experimental/tqtinterface/qt4/src/tools/tqstring.cpp @@ -86,7 +86,7 @@ // static QHash<void *, QByteArray> *asciiCache = 0; TQT_STATIC_CONST_IMPL TQChar TQChar::null; -TQT_STATIC_CONST_IMPL TQChar TQChar::tqreplacement((ushort)0xfffd); +TQT_STATIC_CONST_IMPL TQChar TQChar::replacement((ushort)0xfffd); TQT_STATIC_CONST_IMPL TQChar TQChar::byteOrderMark((ushort)0xfeff); TQT_STATIC_CONST_IMPL TQChar TQChar::byteOrderSwapped((ushort)0xfffe); TQT_STATIC_CONST_IMPL TQChar TQChar::nbsp((ushort)0x00a0); @@ -610,10 +610,10 @@ struct ArgEscapeData uint locale_occurrences; // number of occurences of the lowest escape // sequence number which contain 'L' uint escape_len; // total length of escape sequences which will - // be tqreplaced + // be replaced }; -static ArgEscapeData tqfindArgEscapes(const TQString &s) +static ArgEscapeData findArgEscapes(const TQString &s) { const TQChar *uc_begin = s.tqunicode(); const TQChar *uc_end = uc_begin + s.length(); @@ -658,7 +658,7 @@ static ArgEscapeData tqfindArgEscapes(const TQString &s) #if TQT_VERSION < 0x040000 // ### remove preprocessor in TQt 4.0 - /* Since in TQt < 4.0 only the first instance is tqreplaced, + /* Since in TQt < 4.0 only the first instance is replaced, escape_len should hold the length of only the first escape sequence */ if (d.occurrences == 0) @@ -677,7 +677,7 @@ static ArgEscapeData tqfindArgEscapes(const TQString &s) return d; } -static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, int field_width, +static TQString replaceArgEscapes(const TQString &s, const ArgEscapeData &d, int field_width, const TQString &arg, const TQString &larg) { const TQChar *uc_begin = s.tqunicode(); @@ -766,7 +766,7 @@ static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, i } /*! - This function will return a string that tqreplaces the lowest + This function will return a string that replaces the lowest numbered occurrence of \c %1, \c %2, ..., \c %9 with \a a. The \a fieldWidth value specifies the minimum amount of space that @@ -796,7 +796,7 @@ static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, i */ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::tqarg(): Argument missing: %s, %s", latin1(), @@ -804,7 +804,7 @@ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const return *this; } - return tqreplaceArgEscapes(*this, d, fieldWidth, a, a); + return replaceArgEscapes(*this, d, fieldWidth, a, a); } /*! @@ -813,8 +813,8 @@ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const \overload This is the same as str.tqarg(\a a1).tqarg(\a a2), except that - the strings are tqreplaced in one pass. This can make a difference - if \a a1 tqcontains e.g. \c{%1}: + the strings are replaced in one pass. This can make a difference + if \a a1 contains e.g. \c{%1}: \code TQString str( "%1 %2" ); @@ -832,7 +832,7 @@ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const \overload This is the same as calling str.tqarg(\a a1).tqarg(\a a2).tqarg(\a a3), - except that the strings are tqreplaced in one pass. + except that the strings are replaced in one pass. */ /*! @@ -842,7 +842,7 @@ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const This is the same as calling str.tqarg(\a a1).tqarg(\a a2).tqarg(\a a3).tqarg(\a a4), - except that the strings are tqreplaced in one pass. + except that the strings are replaced in one pass. */ /*! @@ -857,7 +857,7 @@ TQString TQString::tqarg( const TQString& a, int fieldWidth ) const be between 2 and 36. The '%' can be followed by an 'L', in which case the sequence is - tqreplaced with a localized representation of \a a. The conversion + replaced with a localized representation of \a a. The conversion uses the default locale. The default locale is determined from the system's locale settings at application startup. It can be changed using TQLocale::setDefault(). The 'L' flag is ignored if \a base is @@ -903,7 +903,7 @@ TQString TQString::tqarg( ulong a, int fieldWidth, int base ) const */ TQString TQString::tqarg( TQ_LLONG a, int fieldWidth, int base ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::tqarg(): Argument missing: %s, %lld", latin1(), @@ -921,7 +921,7 @@ TQString TQString::tqarg( TQ_LLONG a, int fieldWidth, int base ) const locale_arg = locale.d->longLongToString(a, -1, base, -1, TQLocalePrivate::ThousandsGroup); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } /*! @@ -933,7 +933,7 @@ TQString TQString::tqarg( TQ_LLONG a, int fieldWidth, int base ) const */ TQString TQString::tqarg( TQ_ULLONG a, int fieldWidth, int base ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::tqarg(): Argument missing: %s, %llu", latin1(), @@ -951,7 +951,7 @@ TQString TQString::tqarg( TQ_ULLONG a, int fieldWidth, int base ) const locale_arg = locale.d->unsLongLongToString(a, -1, base, -1, TQLocalePrivate::ThousandsGroup); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } /*! @@ -1049,7 +1049,7 @@ TQString TQString::tqarg( TQChar a, int fieldWidth ) const */ TQString TQString::tqarg( double a, int fieldWidth, char fmt, int prec ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::tqarg(): Argument missing: %s, %g", latin1(), @@ -1094,7 +1094,7 @@ TQString TQString::tqarg( double a, int fieldWidth, char fmt, int prec ) const locale_arg = locale.d->doubleToString(a, prec, form, -1, flags); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } TQString TQString::tqmultiArg( int numArgs, const TQString& a1, const TQString& a2, const TQString& a3, const TQString& a4 ) const @@ -1267,7 +1267,7 @@ TQString TQString::setUnicodeCodes( const ushort* tqunicode_as_ushorts, uint len double d = TQString( "1,234,567.89" ).toDouble(&ok); // ok == false \endcode - \warning If the string tqcontains trailing whitespace this function + \warning If the string contains trailing whitespace this function will fail, and set \a *ok to false if \a ok is not 0. Leading whitespace is ignored. @@ -1317,7 +1317,7 @@ double TQString::toDouble( bool *ok ) const For information on how string-to-number functions in TQString handle localized input, see toDouble(). - \warning If the string tqcontains trailing whitespace this function + \warning If the string contains trailing whitespace this function will fail, settings \a *ok to false if \a ok is not 0. Leading whitespace is ignored. @@ -2345,8 +2345,8 @@ void TQString::compose() // joining info is only needed for Arabic if (format(ligature.tag(), *this, index, len)) { //printf("using ligature 0x%x, len=%d\n",code,len); - // tqreplace letter - composed.tqreplace(cindex, len, TQChar(head)); + // replace letter + composed.replace(cindex, len, TQChar(head)); index += len-1; // we continue searching in case we have a final // form because medial ones are preferred. @@ -2541,11 +2541,11 @@ char* TQString::tqunicodeToLatin1(const TQChar *uc, uint l) check for a non-null string rather than \c{if ( !str )}; see \l operator!() for an explanation. - Note that if you tqfind that you are mixing usage of \l TQCString, + Note that if you find that you are mixing usage of \l TQCString, TQString, and \l TQByteArray, this causes lots of unnecessary copying and might indicate that the true nature of the data you are dealing with is uncertain. If the data is '\0'-terminated 8-bit - data, use \l TQCString; if it is unterminated (i.e. tqcontains '\0's) + data, use \l TQCString; if it is unterminated (i.e. contains '\0's) 8-bit data, use \l TQByteArray; if it is text, use TQString. Lists of strings are handled by the TQStringList class. You can @@ -2618,7 +2618,7 @@ char* TQString::tqunicodeToLatin1(const TQChar *uc, uint l) \value ExactMatch The target and search strings must match exactly. \value BeginsWith The target string begins with the search string. \value EndsWith The target string ends with the search string. - \value Contains The target string tqcontains the search string. + \value Contains The target string contains the search string. If you OR these flags together (excluding \c CaseSensitive), the search criteria be applied in the following order: \c ExactMatch, @@ -2632,7 +2632,7 @@ char* TQString::tqunicodeToLatin1(const TQChar *uc, uint l) TQ_EXPORT TQStringData *TQString::shared_null = 0; TQT_STATIC_CONST_IMPL TQString TQString::null; TQT_STATIC_CONST_IMPL TQChar TQChar::null; -TQT_STATIC_CONST_IMPL TQChar TQChar::tqreplacement((ushort)0xfffd); +TQT_STATIC_CONST_IMPL TQChar TQChar::replacement((ushort)0xfffd); TQT_STATIC_CONST_IMPL TQChar TQChar::byteOrderMark((ushort)0xfeff); TQT_STATIC_CONST_IMPL TQChar TQChar::byteOrderSwapped((ushort)0xfffe); TQT_STATIC_CONST_IMPL TQChar TQChar::nbsp((ushort)0x00a0); @@ -3005,7 +3005,7 @@ void TQString::truncate( uint newLen ) /*! Ensures that at least \a newLen characters are allocated to the string, and sets the length of the string to \a newLen. Any new - space allocated tqcontains arbitrary data. + space allocated contains arbitrary data. \sa reserve(), truncate() */ @@ -3121,10 +3121,10 @@ struct ArgEscapeData uint locale_occurrences; // number of occurences of the lowest escape // sequence number which contain 'L' uint escape_len; // total length of escape sequences which will - // be tqreplaced + // be replaced }; -static ArgEscapeData tqfindArgEscapes(const TQString &s) +static ArgEscapeData findArgEscapes(const TQString &s) { const TQChar *uc_begin = s.tqunicode(); const TQChar *uc_end = uc_begin + s.length(); @@ -3169,7 +3169,7 @@ static ArgEscapeData tqfindArgEscapes(const TQString &s) #if TQT_VERSION < 0x040000 // ### remove preprocessor in TQt 4.0 - /* Since in TQt < 4.0 only the first instance is tqreplaced, + /* Since in TQt < 4.0 only the first instance is replaced, escape_len should hold the length of only the first escape sequence */ if (d.occurrences == 0) @@ -3188,7 +3188,7 @@ static ArgEscapeData tqfindArgEscapes(const TQString &s) return d; } -static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, int field_width, +static TQString replaceArgEscapes(const TQString &s, const ArgEscapeData &d, int field_width, const TQString &arg, const TQString &larg) { const TQChar *uc_begin = s.tqunicode(); @@ -3275,7 +3275,7 @@ static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, i } /*! - This function will return a string that tqreplaces the lowest + This function will return a string that replaces the lowest numbered occurrence of \c %1, \c %2, ..., \c %9 with \a a. The \a fieldWidth value specifies the minimum amount of space that @@ -3305,7 +3305,7 @@ static TQString tqreplaceArgEscapes(const TQString &s, const ArgEscapeData &d, i */ TQString TQString::arg( const TQString& a, int fieldWidth ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::arg(): Argument missing: %s, %s", latin1(), @@ -3313,7 +3313,7 @@ TQString TQString::arg( const TQString& a, int fieldWidth ) const return *this; } - return tqreplaceArgEscapes(*this, d, fieldWidth, a, a); + return replaceArgEscapes(*this, d, fieldWidth, a, a); } /*! @@ -3322,8 +3322,8 @@ TQString TQString::arg( const TQString& a, int fieldWidth ) const \overload This is the same as str.arg(\a a1).arg(\a a2), except that - the strings are tqreplaced in one pass. This can make a difference - if \a a1 tqcontains e.g. \c{%1}: + the strings are replaced in one pass. This can make a difference + if \a a1 contains e.g. \c{%1}: \code TQString str( "%1 %2" ); @@ -3341,7 +3341,7 @@ TQString TQString::arg( const TQString& a, int fieldWidth ) const \overload This is the same as calling str.arg(\a a1).arg(\a a2).arg(\a a3), - except that the strings are tqreplaced in one pass. + except that the strings are replaced in one pass. */ /*! @@ -3351,7 +3351,7 @@ TQString TQString::arg( const TQString& a, int fieldWidth ) const This is the same as calling str.arg(\a a1).arg(\a a2).arg(\a a3).arg(\a a4), - except that the strings are tqreplaced in one pass. + except that the strings are replaced in one pass. */ /*! @@ -3366,7 +3366,7 @@ TQString TQString::arg( const TQString& a, int fieldWidth ) const be between 2 and 36. The '%' can be followed by an 'L', in which case the sequence is - tqreplaced with a localized representation of \a a. The conversion + replaced with a localized representation of \a a. The conversion uses the default locale. The default locale is determined from the system's locale settings at application startup. It can be changed using TQLocale::setDefault(). The 'L' flag is ignored if \a base is @@ -3412,7 +3412,7 @@ TQString TQString::arg( ulong a, int fieldWidth, int base ) const */ TQString TQString::arg( TQ_LLONG a, int fieldWidth, int base ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::arg(): Argument missing: %s, %lld", latin1(), @@ -3430,7 +3430,7 @@ TQString TQString::arg( TQ_LLONG a, int fieldWidth, int base ) const locale_arg = locale.d->longLongToString(a, -1, base, -1, TQLocalePrivate::ThousandsGroup); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } /*! @@ -3442,7 +3442,7 @@ TQString TQString::arg( TQ_LLONG a, int fieldWidth, int base ) const */ TQString TQString::arg( TQ_ULLONG a, int fieldWidth, int base ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::arg(): Argument missing: %s, %llu", latin1(), @@ -3460,7 +3460,7 @@ TQString TQString::arg( TQ_ULLONG a, int fieldWidth, int base ) const locale_arg = locale.d->unsLongLongToString(a, -1, base, -1, TQLocalePrivate::ThousandsGroup); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } /*! @@ -3558,7 +3558,7 @@ TQString TQString::arg( TQChar a, int fieldWidth ) const */ TQString TQString::arg( double a, int fieldWidth, char fmt, int prec ) const { - ArgEscapeData d = tqfindArgEscapes(*this); + ArgEscapeData d = findArgEscapes(*this); if (d.occurrences == 0) { qWarning( "TQString::arg(): Argument missing: %s, %g", latin1(), @@ -3603,7 +3603,7 @@ TQString TQString::arg( double a, int fieldWidth, char fmt, int prec ) const locale_arg = locale.d->doubleToString(a, prec, form, -1, flags); } - return tqreplaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); + return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg); } TQString TQString::multiArg( int numArgs, const TQString& a1, const TQString& a2, @@ -3685,9 +3685,9 @@ TQString TQString::multiArg( int numArgs, const TQString& a1, const TQString& a2 \endcode For \link TQObject::tr() translations,\endlink especially if the - strings tqcontains more than one escape sequence, you should + strings contains more than one escape sequence, you should consider using the arg() function instead. This allows the order - of the tqreplacements to be controlled by the translator, and has + of the replacements to be controlled by the translator, and has Unicode support. The %lc escape sequence expects a tqunicode character of type ushort @@ -3770,7 +3770,7 @@ TQString &TQString::sprintf( const char* cformat, ... ) width_str.append(*c++); // can't be negative - started with a digit - // tqcontains at least one digit + // contains at least one digit width = width_str.toInt(); } else if (*c == '*') { @@ -3795,7 +3795,7 @@ TQString &TQString::sprintf( const char* cformat, ... ) precision_str.append(*c++); // can't be negative - started with a digit - // tqcontains at least one digit + // contains at least one digit precision = precision_str.toInt(); } else if (*c == '*') { @@ -4080,7 +4080,7 @@ TQString& TQString::fill( TQChar c, int len ) Finds the first occurrence of the character \a c, starting at position \a index. If \a index is -1, the search starts at the last character; if -2, at the next to last character and so on. - (See tqfindRev() for searching backwards.) + (See findRev() for searching backwards.) If \a cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive. @@ -4088,7 +4088,7 @@ TQString& TQString::fill( TQChar c, int len ) Returns the position of \a c or -1 if \a c could not be found. */ -int TQString::tqfind( TQChar c, int index, bool cs ) const +int TQString::find( TQChar c, int index, bool cs ) const { const uint l = length(); if ( index < 0 ) @@ -4144,7 +4144,7 @@ static void bm_init_skiptable( const TQString &pattern, uint *skiptable, bool cs } } -static int bm_tqfind( const TQString &str, int index, const TQString &pattern, uint *skiptable, bool cs ) +static int bm_find( const TQString &str, int index, const TQString &pattern, uint *skiptable, bool cs ) { const uint l = str.length(); if ( pattern.isEmpty() ) @@ -4217,7 +4217,7 @@ static int bm_tqfind( const TQString &str, int index, const TQString &pattern, u Finds the first occurrence of the string \a str, starting at position \a index. If \a index is -1, the search starts at the last character, if it is -2, at the next to last character and so - on. (See tqfindRev() for searching backwards.) + on. (See findRev() for searching backwards.) If \a cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive. @@ -4225,7 +4225,7 @@ static int bm_tqfind( const TQString &str, int index, const TQString &pattern, u Returns the position of \a str or -1 if \a str could not be found. */ -int TQString::tqfind( const TQString& str, int index, bool cs ) const +int TQString::find( const TQString& str, int index, bool cs ) const { const uint l = length(); const uint sl = str.length(); @@ -4240,7 +4240,7 @@ int TQString::tqfind( const TQString& str, int index, bool cs ) const #if defined(TQ_OS_MACX) && defined(TQT_MACOSX_VERSION) && TQT_MACOSX_VERSION >= 0x1020 if ( sl == 1 ) - return tqfind( *str.tqunicode(), index, cs ); + return find( *str.tqunicode(), index, cs ); #endif // we use the Boyer-Moore algorithm in cases where the overhead @@ -4249,7 +4249,7 @@ int TQString::tqfind( const TQString& str, int index, bool cs ) const if ( l > 500 && sl > 5 ) { uint skiptable[0x100]; bm_init_skiptable( str, skiptable, cs ); - return bm_tqfind( *this, index, str, skiptable, cs ); + return bm_find( *this, index, str, skiptable, cs ); } /* @@ -4303,17 +4303,17 @@ int TQString::tqfind( const TQString& str, int index, bool cs ) const } /*! - \fn int TQString::tqfindRev( const char* str, int index ) const + \fn int TQString::findRev( const char* str, int index ) const - Equivalent to tqfindRev(TQString(\a str), \a index). + Equivalent to findRev(TQString(\a str), \a index). */ /*! - \fn int TQString::tqfind( const char* str, int index ) const + \fn int TQString::find( const char* str, int index ) const \overload - Equivalent to tqfind(TQString(\a str), \a index). + Equivalent to find(TQString(\a str), \a index). */ /*! @@ -4331,14 +4331,14 @@ int TQString::tqfind( const TQString& str, int index, bool cs ) const \code TQString string( "bananas" ); - int i = string.tqfindRev( 'a' ); // i == 5 + int i = string.findRev( 'a' ); // i == 5 \endcode */ -int TQString::tqfindRev( TQChar c, int index, bool cs ) const +int TQString::findRev( TQChar c, int index, bool cs ) const { #if defined(TQ_OS_MACX) && defined(TQT_MACOSX_VERSION) && TQT_MACOSX_VERSION < 0x1020 - return tqfindRev( TQString( c ), index, cs ); + return findRev( TQString( c ), index, cs ); #else const uint l = length(); if ( index < 0 ) @@ -4374,14 +4374,14 @@ int TQString::tqfindRev( TQChar c, int index, bool cs ) const \code TQString string("bananas"); - int i = string.tqfindRev( "ana" ); // i == 3 + int i = string.findRev( "ana" ); // i == 3 \endcode */ -int TQString::tqfindRev( const TQString& str, int index, bool cs ) const +int TQString::findRev( const TQString& str, int index, bool cs ) const { /* - See TQString::tqfind() for explanations. + See TQString::find() for explanations. */ const uint l = length(); if ( index < 0 ) @@ -4395,7 +4395,7 @@ int TQString::tqfindRev( const TQString& str, int index, bool cs ) const #if defined(TQ_OS_MACX) && defined(TQT_MACOSX_VERSION) && TQT_MACOSX_VERSION >= 0x1020 if ( sl == 1 ) - return tqfindRev( *str.tqunicode(), index, cs ); + return findRev( *str.tqunicode(), index, cs ); #endif const TQChar* needle = str.tqunicode(); @@ -4718,12 +4718,12 @@ TQString TQString::section( const TQRegExp ®, int start, int end, int flags ) \code TQString string( "Trolltech and TQt" ); - int n = string.tqcontains( 't', FALSE ); + int n = string.contains( 't', FALSE ); // n == 3 \endcode */ -int TQString::tqcontains( TQChar c, bool cs ) const +int TQString::contains( TQChar c, bool cs ) const { int count = 0; const TQChar *uc = tqunicode(); @@ -4755,19 +4755,19 @@ int TQString::tqcontains( TQChar c, bool cs ) const If \a cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive. */ -int TQString::tqcontains( const char* str, bool cs ) const +int TQString::contains( const char* str, bool cs ) const { - return tqcontains( TQString(str), cs ); + return contains( TQString(str), cs ); } /*! - \fn int TQString::tqcontains( char c, bool cs ) const + \fn int TQString::contains( char c, bool cs ) const \overload */ /*! - \fn int TQString::tqfind( char c, int index, bool cs ) const + \fn int TQString::find( char c, int index, bool cs ) const \overload @@ -4778,7 +4778,7 @@ int TQString::tqcontains( const char* str, bool cs ) const */ /*! - \fn int TQString::tqfindRev( char c, int index, bool cs ) const + \fn int TQString::findRev( char c, int index, bool cs ) const \overload @@ -4802,13 +4802,13 @@ int TQString::tqcontains( const char* str, bool cs ) const \code TQString str( "bananas" ); - int i = str.tqcontains( "ana" ); // i == 2 + int i = str.contains( "ana" ); // i == 2 \endcode - \sa tqfindRev() + \sa findRev() */ -int TQString::tqcontains( const TQString &str, bool cs ) const +int TQString::contains( const TQString &str, bool cs ) const { if ( isNull() ) return 0; @@ -4817,13 +4817,13 @@ int TQString::tqcontains( const TQString &str, bool cs ) const bm_init_skiptable( str, skiptable, cs ); int i = -1; // use boyer-moore for the ultimate speed experience - while ( ( i = bm_tqfind( *this, i + 1, str, skiptable, cs ) ) != -1 ) + while ( ( i = bm_find( *this, i + 1, str, skiptable, cs ) ) != -1 ) count++; return count; } /*! - Returns a substring that tqcontains the \a len leftmost characters + Returns a substring that contains the \a len leftmost characters of the string. The whole string is returned if \a len exceeds the length of the @@ -4854,7 +4854,7 @@ TQString TQString::left( uint len ) const } /*! - Returns a string that tqcontains the \a len rightmost characters of + Returns a string that contains the \a len rightmost characters of the string. If \a len is greater than the length of the string then the whole @@ -4886,7 +4886,7 @@ TQString TQString::right( uint len ) const } /*! - Returns a string that tqcontains the \a len characters of this + Returns a string that contains the \a len characters of this string, starting at position \a index. Returns a null string if the string is empty or \a index is out of @@ -4922,7 +4922,7 @@ TQString TQString::mid( uint index, uint len ) const } /*! - Returns a string of length \a width that tqcontains this string + Returns a string of length \a width that contains this string padded by the \a fill character. If \a truncate is FALSE and the length of the string is more than @@ -4962,7 +4962,7 @@ TQString TQString::leftJustify( uint width, TQChar fill, bool truncate ) const } /*! - Returns a string of length \a width that tqcontains the \a fill + Returns a string of length \a width that contains the \a fill character followed by the string. If \a truncate is FALSE and the length of the string is more than @@ -5115,7 +5115,7 @@ TQString TQString::stripWhiteSpace() const /*! Returns a string that has whitespace removed from the start and the end, and which has each sequence of internal whitespace - tqreplaced with a single space. + replaced with a single space. Whitespace means any character for which TQChar::isSpace() returns TRUE. This includes Unicode characters with decimal values 9 @@ -5170,7 +5170,7 @@ TQString TQString::simplifyWhiteSpace() const // str == "I don't like fish" \endcode - \sa remove(), tqreplace() + \sa remove(), replace() */ TQString &TQString::insert( uint index, const TQString &s ) @@ -5388,7 +5388,7 @@ TQString &TQString::prepend( const char *s ) string.remove( 1, 4 ); // string == "Meal" \endcode - \sa insert(), tqreplace() + \sa insert(), replace() */ TQString &TQString::remove( uint index, uint len ) @@ -5412,7 +5412,7 @@ TQString &TQString::remove( uint index, uint len ) Removes every occurrence of the character \a c in the string. Returns a reference to the string. - This is the same as tqreplace(\a c, ""). + This is the same as replace(\a c, ""). */ TQString &TQString::remove( TQChar c ) { @@ -5434,7 +5434,7 @@ TQString &TQString::remove( TQChar c ) Removes every occurrence of the character \a c in the string. Returns a reference to the string. - This is the same as tqreplace(\a c, ""). + This is the same as replace(\a c, ""). */ /*! \overload @@ -5445,7 +5445,7 @@ TQString &TQString::remove( TQChar c ) If \a cs is TRUE (the default), the search is case sensitive; otherwise the search is case insensitive. - This is the same as tqreplace(\a str, "", \a cs). + This is the same as replace(\a str, "", \a cs). */ TQString &TQString::remove( const TQString & str, bool cs ) { @@ -5454,7 +5454,7 @@ TQString &TQString::remove( const TQString & str, bool cs ) real_detach(); } else { int index = 0; - while ( (index = tqfind(str, index, cs)) != -1 ) + while ( (index = find(str, index, cs)) != -1 ) remove( index, str.length() ); } return *this; @@ -5470,7 +5470,7 @@ TQString &TQString::remove( const TQString & str ) Replaces every occurrence of \a c1 with the char \a c2. Returns a reference to the string. */ -TQString &TQString::tqreplace( TQChar c1, TQChar c2 ) +TQString &TQString::replace( TQChar c1, TQChar c2 ) { if ( isEmpty() ) return *this; @@ -5492,12 +5492,12 @@ TQString &TQString::tqreplace( TQChar c1, TQChar c2 ) Removes every occurrence of the regular expression \a rx in the string. Returns a reference to the string. - This is the same as tqreplace(\a rx, ""). + This is the same as replace(\a rx, ""). */ TQString &TQString::remove( const TQRegExp & rx ) { - return tqreplace( rx, TQString::null ); + return replace( rx, TQString::null ); } #endif @@ -5525,7 +5525,7 @@ TQString &TQString::remove( const char *str ) \code TQString string( "Say yes!" ); - string = string.tqreplace( 4, 3, "NO" ); + string = string.replace( 4, 3, "NO" ); // string == "Say NO!" \endcode @@ -5538,24 +5538,24 @@ TQString &TQString::remove( const char *str ) \sa insert(), remove() */ -TQString &TQString::tqreplace( uint index, uint len, const TQString &s ) +TQString &TQString::replace( uint index, uint len, const TQString &s ) { - return tqreplace( index, len, s.tqunicode(), s.length() ); + return replace( index, len, s.tqunicode(), s.length() ); } /*! \overload - This is the same as tqreplace(\a index, \a len, TQString(\a c)). + This is the same as replace(\a index, \a len, TQString(\a c)). */ -TQString &TQString::tqreplace( uint index, uint len, TQChar c ) +TQString &TQString::replace( uint index, uint len, TQChar c ) { - return tqreplace( index, len, &c, 1 ); + return replace( index, len, &c, 1 ); } /*! \overload - \fn TQString &TQString::tqreplace( uint index, uint len, char c ) + \fn TQString &TQString::replace( uint index, uint len, char c ) - This is the same as tqreplace(\a index, \a len, TQChar(\a c)). + This is the same as replace(\a index, \a len, TQChar(\a c)). */ /*! @@ -5568,19 +5568,19 @@ TQString &TQString::tqreplace( uint index, uint len, TQChar c ) \sa insert(), remove() */ -TQString &TQString::tqreplace( uint index, uint len, const TQChar* s, uint slen ) +TQString &TQString::replace( uint index, uint len, const TQChar* s, uint slen ) { if (index > length()) index = length(); real_detach(); if ( len == slen && index + len <= length() ) { - // Optimized common case: tqreplace without size change + // Optimized common case: replace without size change memcpy( d->tqunicode+index, s, len * sizeof(TQChar) ); } else if ( s >= d->tqunicode && (uint)(s - d->tqunicode) < d->maxl ) { // Part of me - take a copy. TQChar *tmp = TQT_ALLOC_TQCHAR_VEC( slen ); memcpy( tmp, s, slen * sizeof(TQChar) ); - tqreplace( index, len, tmp, slen ); + replace( index, len, tmp, slen ); TQT_DELETE_TQCHAR_VEC( tmp ); } else { remove( index, len ); @@ -5600,22 +5600,22 @@ TQString &TQString::tqreplace( uint index, uint len, const TQChar* s, uint slen Example: \code TQString s = "a,b,c"; - s.tqreplace( TQChar(','), " or " ); + s.replace( TQChar(','), " or " ); // s == "a or b or c" \endcode */ -TQString &TQString::tqreplace( TQChar c, const TQString & after, bool cs ) +TQString &TQString::replace( TQChar c, const TQString & after, bool cs ) { - return tqreplace( TQString( c ), after, cs ); + return replace( TQString( c ), after, cs ); } -TQString &TQString::tqreplace( TQChar c, const TQString & after ) +TQString &TQString::replace( TQChar c, const TQString & after ) { - return tqreplace( TQString( c ), after, TRUE ); + return replace( TQString( c ), after, TRUE ); } /*! \overload - \fn TQString &TQString::tqreplace( char c, const TQString & after, bool cs ) + \fn TQString &TQString::replace( char c, const TQString & after, bool cs ) Replaces every occurrence of the character \a c in the string with \a after. Returns a reference to the string. @@ -5635,11 +5635,11 @@ TQString &TQString::tqreplace( TQChar c, const TQString & after ) Example: \code TQString s = "Greek is Greek"; - s.tqreplace( "Greek", "English" ); + s.replace( "Greek", "English" ); // s == "English is English" \endcode */ -TQString &TQString::tqreplace( const TQString & before, const TQString & after, +TQString &TQString::replace( const TQString & before, const TQString & after, bool cs ) { if ( isEmpty() ) { @@ -5661,7 +5661,7 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after, if ( bl == al ) { if ( bl ) { const TQChar *auc = after.tqunicode(); - while ( (index = bm_tqfind(*this, index, before, skiptable, cs) ) != -1 ) { + while ( (index = bm_find(*this, index, before, skiptable, cs) ) != -1 ) { memcpy( d->tqunicode + index, auc, al * sizeof(TQChar) ); index += bl; } @@ -5671,7 +5671,7 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after, uint to = 0; uint movestart = 0; uint num = 0; - while ( (index = bm_tqfind(*this, index, before, skiptable, cs)) != -1 ) { + while ( (index = bm_find(*this, index, before, skiptable, cs)) != -1 ) { if ( num ) { int msize = index - movestart; if ( msize > 0 ) { @@ -5702,7 +5702,7 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after, uint indices[4096]; uint pos = 0; while ( pos < 4095 ) { - index = bm_tqfind( *this, index, before, skiptable, cs ); + index = bm_find( *this, index, before, skiptable, cs ); if ( index == -1 ) break; indices[pos++] = index; @@ -5714,7 +5714,7 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after, if ( !pos ) break; - // we have a table of tqreplacement positions, use them for fast replacing + // we have a table of replacement positions, use them for fast replacing int adjust = pos*(al-bl); // index has to be adjusted in case we get back into the loop above. if ( index != -1 ) @@ -5738,9 +5738,9 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after, return *this; } -TQString &TQString::tqreplace( const TQString & before, const TQString & after ) +TQString &TQString::replace( const TQString & before, const TQString & after ) { - return tqreplace( before, after, TRUE ); + return replace( before, after, TRUE ); } #ifndef TQT_NO_REGEXP_CAPTURE @@ -5750,24 +5750,24 @@ TQString &TQString::tqreplace( const TQString & before, const TQString & after ) \a after. Returns a reference to the string. For example: \code TQString s = "banana"; - s.tqreplace( TQRegExp("an"), "" ); + s.replace( TQRegExp("an"), "" ); // s == "ba" \endcode 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), cap(2), ... + in \a after are replaced with \a{rx}.cap(1), cap(2), ... \code TQString t = "A <i>bon mot</i>."; - t.tqreplace( TQRegExp("<i>([^<]*)</i>"), "\\emph{\\1}" ); + t.replace( TQRegExp("<i>([^<]*)</i>"), "\\emph{\\1}" ); // t == "A \\emph{bon mot}." \endcode - \sa tqfind(), tqfindRev(), TQRegExp::cap() + \sa find(), findRev(), TQRegExp::cap() */ -TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) +TQString &TQString::replace( const TQRegExp &rx, const TQString &after ) { TQRegExp rx2 = rx; @@ -5823,10 +5823,10 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) TQString after2 = after; for ( j = numBackRefs - 1; j >= 0; j-- ) - after2.tqreplace( capturePositions[j], 2, + after2.replace( capturePositions[j], 2, rx2.cap(captureNumbers[j]) ); - tqreplace( index, rx2.matchedLength(), after2 ); + replace( index, rx2.matchedLength(), after2 ); index += after2.length(); if ( rx2.matchedLength() == 0 ) { @@ -5849,7 +5849,7 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) struct { int pos; int length; - } tqreplacements[2048]; + } replacements[2048]; uint pos = 0; int adjust = 0; @@ -5858,8 +5858,8 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) if ( index == -1 ) break; int ml = rx2.matchedLength(); - tqreplacements[pos].pos = index; - tqreplacements[pos++].length = ml; + replacements[pos].pos = index; + replacements[pos++].length = ml; index += ml; adjust += al - ml; // avoid infinite loop @@ -5868,11 +5868,11 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) } if ( !pos ) break; - tqreplacements[pos].pos = d->len; + replacements[pos].pos = d->len; uint newlen = d->len + adjust; // to continue searching at the right position after we did - // the first round of tqreplacements + // the first round of replacements if ( index != -1 ) index += adjust; TQChar *newuc = TQT_ALLOC_TQCHAR_VEC( newlen + 1 ); @@ -5880,13 +5880,13 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) int copystart = 0; uint i = 0; while ( i < pos ) { - int copyend = tqreplacements[i].pos; + int copyend = replacements[i].pos; int size = copyend - copystart; memcpy( uc, d->tqunicode + copystart, size * sizeof(TQChar) ); uc += size; memcpy( uc, after.tqunicode(), al * sizeof(TQChar) ); uc += al; - copystart = copyend + tqreplacements[i].length; + copystart = copyend + replacements[i].length; i++; } memcpy( uc, d->tqunicode + copystart, @@ -5907,20 +5907,20 @@ TQString &TQString::tqreplace( const TQRegExp &rx, const TQString &after ) Finds the first match of the regular expression \a rx, starting from position \a index. If \a index is -1, the search starts at the last character; if -2, at the next to last character and so - on. (See tqfindRev() for searching backwards.) + on. (See findRev() for searching backwards.) Returns the position of the first match of \a rx or -1 if no match was found. \code TQString string( "bananas" ); - int i = string.tqfind( TQRegExp("an"), 0 ); // i == 1 + int i = string.find( TQRegExp("an"), 0 ); // i == 1 \endcode - \sa tqfindRev() tqreplace() tqcontains() + \sa findRev() replace() contains() */ -int TQString::tqfind( const TQRegExp &rx, int index ) const +int TQString::find( const TQRegExp &rx, int index ) const { return rx.search( *this, index ); } @@ -5931,19 +5931,19 @@ int TQString::tqfind( const TQRegExp &rx, int index ) const Finds the first match of the regexp \a rx, starting at position \a index and searching backwards. If the index is -1, the search starts at the last character, if it is -2, at the next to last - character and so on. (See tqfindRev() for searching backwards.) + character and so on. (See findRev() for searching backwards.) Returns the position of the match or -1 if no match was found. \code TQString string( "bananas" ); - int i = string.tqfindRev( TQRegExp("an") ); // i == 3 + int i = string.findRev( TQRegExp("an") ); // i == 3 \endcode - \sa tqfind() + \sa find() */ -int TQString::tqfindRev( const TQRegExp &rx, int index ) const +int TQString::findRev( const TQRegExp &rx, int index ) const { return rx.searchRev( *this, index ); } @@ -5960,13 +5960,13 @@ int TQString::tqfindRev( const TQRegExp &rx, int index ) const \code TQString str = "banana and panama"; TQRegExp rxp = TQRegExp( "a[nm]a", TRUE, FALSE ); - int i = str.tqcontains( rxp ); // i == 4 + int i = str.contains( rxp ); // i == 4 \endcode - \sa tqfind() tqfindRev() + \sa find() findRev() */ -int TQString::tqcontains( const TQRegExp &rx ) const +int TQString::contains( const TQRegExp &rx ) const { int count = 0; int index = -1; @@ -6376,7 +6376,7 @@ uint TQString::toUInt( bool *ok, int base ) const double d = TQString( "1,234,567.89" ).toDouble(&ok); // ok == false \endcode - \warning If the string tqcontains trailing whitespace this function + \warning If the string contains trailing whitespace this function will fail, and set \a *ok to false if \a ok is not 0. Leading whitespace is ignored. @@ -6426,7 +6426,7 @@ double TQString::toDouble( bool *ok ) const For information on how string-to-number functions in TQString handle localized input, see toDouble(). - \warning If the string tqcontains trailing whitespace this function + \warning If the string contains trailing whitespace this function will fail, settings \a *ok to false if \a ok is not 0. Leading whitespace is ignored. @@ -6975,7 +6975,7 @@ TQString &TQString::operator+=( char c ) /*! Returns a Latin-1 representation of the string. The - returned value is undefined if the string tqcontains non-Latin-1 + returned value is undefined if the string contains non-Latin-1 characters. If you want to convert strings into formats other than Unicode, see the TQTextCodec classes. |