diff options
Diffstat (limited to 'tqtinterface/qt4/src/tools/tqstring.h')
-rw-r--r-- | tqtinterface/qt4/src/tools/tqstring.h | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/tqtinterface/qt4/src/tools/tqstring.h b/tqtinterface/qt4/src/tools/tqstring.h index 91ceb9d..c82af1f 100644 --- a/tqtinterface/qt4/src/tools/tqstring.h +++ b/tqtinterface/qt4/src/tools/tqstring.h @@ -89,7 +89,7 @@ public: ByteOrderSwapped = ByteOrderSwapped, // null = Null, -// tqreplacement = ReplacementCharacter, +// replacement = ReplacementCharacter, // byteOrderMark = ByteOrderMark, // byteOrderSwapped = ByteOrderSwapped, // nbsp = Nbsp, @@ -99,7 +99,7 @@ public: }; TQT_STATIC_CONST TQChar null; - TQT_STATIC_CONST TQChar tqreplacement; + TQT_STATIC_CONST TQChar replacement; TQT_STATIC_CONST TQChar byteOrderMark; TQT_STATIC_CONST TQChar byteOrderSwapped; TQT_STATIC_CONST TQChar nbsp; @@ -169,23 +169,23 @@ public: TQString( const std::string &str ) : QString(str.c_str()) {} #endif - int tqfind( QChar c, int index=0, bool cs=TRUE ) const { return indexOf(c, index, (Qt::CaseSensitivity)cs); } - int tqfind( char c, int index=0, bool cs=TRUE ) const { return indexOf(c, index, (Qt::CaseSensitivity)cs); } - int tqfind( const QString &str, int index=0, bool cs=TRUE ) const { return indexOf(str, index, (Qt::CaseSensitivity)cs); } + int find( QChar c, int index=0, bool cs=TRUE ) const { return indexOf(c, index, (Qt::CaseSensitivity)cs); } + int find( char c, int index=0, bool cs=TRUE ) const { return indexOf(c, index, (Qt::CaseSensitivity)cs); } + int find( const QString &str, int index=0, bool cs=TRUE ) const { return indexOf(str, index, (Qt::CaseSensitivity)cs); } #ifndef TQT_NO_REGEXP - int tqfind( const QRegExp &qr, int index=0 ) const { return indexOf(qr, index); } + int find( const QRegExp &qr, int index=0 ) const { return indexOf(qr, index); } #endif #ifndef TQT_NO_CAST_ASCII - int tqfind( const char* str, int index=0 ) const { return indexOf(str, index); } + int find( const char* str, int index=0 ) const { return indexOf(str, index); } #endif - int tqfindRev( QChar c, int index=-1, bool cs=TRUE) const { return lastIndexOf(c, index, (Qt::CaseSensitivity)cs); } - int tqfindRev( char c, int index=-1, bool cs=TRUE) const { return lastIndexOf(c, index, (Qt::CaseSensitivity)cs); } - int tqfindRev( const QString &str, int index=-1, bool cs=TRUE) const { return lastIndexOf(str, index, (Qt::CaseSensitivity)cs); } + int findRev( QChar c, int index=-1, bool cs=TRUE) const { return lastIndexOf(c, index, (Qt::CaseSensitivity)cs); } + int findRev( char c, int index=-1, bool cs=TRUE) const { return lastIndexOf(c, index, (Qt::CaseSensitivity)cs); } + int findRev( const QString &str, int index=-1, bool cs=TRUE) const { return lastIndexOf(str, index, (Qt::CaseSensitivity)cs); } #ifndef TQT_NO_REGEXP - int tqfindRev( const QRegExp &qr, int index=-1 ) const { return lastIndexOf(qr, index); } + int findRev( const QRegExp &qr, int index=-1 ) const { return lastIndexOf(qr, index); } #endif #ifndef TQT_NO_CAST_ASCII - int tqfindRev( const char* str, int index=-1 ) const { return lastIndexOf(str, index); } + int findRev( const char* str, int index=-1 ) const { return lastIndexOf(str, index); } #endif const char* latin1() const { return latin1_helper(); } @@ -209,53 +209,53 @@ public: inline TQString(const Null &) : QString() {} inline TQString &operator=(const Null &) { *this = TQString(); return *this; } - int tqcontains( QChar c, bool cs=TRUE ) const { return count(c, (Qt::CaseSensitivity)cs); } - int tqcontains( char c, bool cs=TRUE ) const { return tqcontains(TQChar(c), cs); } + int contains( QChar c, bool cs=TRUE ) const { return count(c, (Qt::CaseSensitivity)cs); } + int contains( char c, bool cs=TRUE ) const { return contains(TQChar(c), cs); } #ifndef TQT_NO_CAST_ASCII - int tqcontains( const char* str, bool cs=TRUE ) const { return count(str, (Qt::CaseSensitivity)cs); } + int contains( const char* str, bool cs=TRUE ) const { return count(str, (Qt::CaseSensitivity)cs); } #endif - int tqcontains( const QString &str, bool cs=TRUE ) const { return count(str, (Qt::CaseSensitivity)cs); } + int contains( const QString &str, bool cs=TRUE ) const { return count(str, (Qt::CaseSensitivity)cs); } #ifndef TQT_NO_REGEXP - int tqcontains( const QRegExp &re ) const { return count(re); } + int contains( const QRegExp &re ) const { return count(re); } #endif #ifndef QT_NO_CAST_TO_ASCII inline operator const char *() const { return ascii_helper(); } #endif - inline bool tqstartsWith( const TQString& str ) const { return startsWith(str); } - inline bool tqstartsWith( const TQString& str, bool cs ) const { return startsWith(str, (cs)?Qt::CaseSensitive:Qt::CaseInsensitive); } - inline bool tqendsWith( const TQString& str ) const { return endsWith(str); } - inline bool tqendsWith( const TQString& str, bool cs ) const { return endsWith(str, (cs)?Qt::CaseSensitive:Qt::CaseInsensitive); } + inline bool tqstartsWith( const TQString& str ) const { return QString::startsWith(str); } + inline bool tqstartsWith( const TQString& str, bool cs ) const { return QString::startsWith(str, (cs)?Qt::CaseSensitive:Qt::CaseInsensitive); } + inline bool tqendsWith( const TQString& str ) const { return QString::endsWith(str); } + inline bool tqendsWith( const TQString& str, bool cs ) const { return QString::endsWith(str, (cs)?Qt::CaseSensitive:Qt::CaseInsensitive); } TQCString utf8() const; inline TQChar constref(uint i) const { return tqat(i); } - inline TQString leftJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const { return leftJustified(width, aFill, trunc); } - inline TQString rightJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const { return rightJustified(width, aFill, trunc); } + inline TQString leftJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const { return QString::leftJustified(width, aFill, trunc); } + inline TQString rightJustify(int width, QChar aFill = QLatin1Char(' '), bool trunc=false) const { return QString::rightJustified(width, aFill, trunc); } inline const TQChar* tqunicode() const { if (length() > 0) return static_cast<const TQChar*>(unicode()); else return static_cast<const TQChar*>(QString().unicode()); } TQCString local8Bit() const; - inline TQString tqreplace(int i, int len, QChar after) { return tqreplace( i, len, &after, 1 ); } - inline TQString tqreplace(int i, int len, const QChar *s, int slen) { + inline TQString replace(int i, int len, QChar after) { return QString::replace( i, len, &after, 1 ); } + inline TQString replace(int i, int len, const QChar *s, int slen) { // Mimic the old (undocumented) behavior int newindex = i; if (newindex > length()) newindex = length(); - return replace( newindex, len, s, slen ); + return QString::replace( newindex, len, s, slen ); } - inline TQString tqreplace(int i, int len, const QString &after) { return tqreplace( i, len, TQString(after).tqunicode(), after.length() ); } - inline TQString tqreplace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, after, cs ); } - inline TQString tqreplace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, blen, after, alen, cs ); } - inline TQString tqreplace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, after, cs ); } - inline TQString tqreplace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, after, cs ); } - inline TQString tqreplace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, after, cs ); } - inline TQString tqreplace(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( before, after, cs ); } - inline TQString tqreplace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( c, after, cs ); } - inline TQString tqreplace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return replace( c, after, cs ); } + inline TQString replace(int i, int len, const QString &after) { return QString::replace( i, len, TQString(after).tqunicode(), after.length() ); } + inline TQString replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, after, cs ); } + inline TQString replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, blen, after, alen, cs ); } + inline TQString replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, after, cs ); } + inline TQString replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, after, cs ); } + inline TQString replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, after, cs ); } + inline TQString replace(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( before, after, cs ); } + inline TQString replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( c, after, cs ); } + inline TQString replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive) { return QString::replace( c, after, cs ); } #ifndef QT_NO_REGEXP - inline TQString tqreplace(const QRegExp &rx, const QString &after) { return replace( rx, after ); } + inline TQString replace(const QRegExp &rx, const QString &after) { return QString::replace( rx, after ); } #endif - inline TQString tqreplace(const QString &before, const QString &after, bool cs) { return tqreplace(before, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); } + inline TQString replace(const QString &before, const QString &after, bool cs) { return QString::replace(before, after, cs?Qt::CaseSensitive:Qt::CaseInsensitive); } inline TQString tqsetNum( short a, int base=10 ) { return setNum(a, base); } inline TQString tqsetNum( ushort a, int base=10 ) { return setNum(a, base); } @@ -440,7 +440,7 @@ inline bool operator!=(const TQString &s, TQString::Null) { return !s.isNull(); #ifndef TQT_NO_CAST_ASCII inline TQString &TQString::operator+=( const TQByteArray &s ) { - int pos = s.tqfind( 0 ); + int pos = s.find( 0 ); return operatorPlusEqHelper( s, pos==-1 ? s.size() : pos ); } #endif @@ -646,7 +646,7 @@ public: TQChar( int rc ); TQT_STATIC_CONST TQChar null; // 0000 - TQT_STATIC_CONST TQChar tqreplacement; // FFFD + TQT_STATIC_CONST TQChar replacement; // FFFD TQT_STATIC_CONST TQChar byteOrderMark; // FEFF TQT_STATIC_CONST TQChar byteOrderSwapped; // FFFE TQT_STATIC_CONST TQChar nbsp; // 00A0 @@ -1027,33 +1027,33 @@ public: ; #endif - int tqfind( TQChar c, int index=0, bool cs=TRUE ) const; - int tqfind( char c, int index=0, bool cs=TRUE ) const; - int tqfind( const TQString &str, int index=0, bool cs=TRUE ) const; + int find( TQChar c, int index=0, bool cs=TRUE ) const; + int find( char c, int index=0, bool cs=TRUE ) const; + int find( const TQString &str, int index=0, bool cs=TRUE ) const; #ifndef TQT_NO_REGEXP - int tqfind( const TQRegExp &, int index=0 ) const; + int find( const TQRegExp &, int index=0 ) const; #endif #ifndef TQT_NO_CAST_ASCII - int tqfind( const char* str, int index=0 ) const; + int find( const char* str, int index=0 ) const; #endif - int tqfindRev( TQChar c, int index=-1, bool cs=TRUE) const; - int tqfindRev( char c, int index=-1, bool cs=TRUE) const; - int tqfindRev( const TQString &str, int index=-1, bool cs=TRUE) const; + int findRev( TQChar c, int index=-1, bool cs=TRUE) const; + int findRev( char c, int index=-1, bool cs=TRUE) const; + int findRev( const TQString &str, int index=-1, bool cs=TRUE) const; #ifndef TQT_NO_REGEXP - int tqfindRev( const TQRegExp &, int index=-1 ) const; + int findRev( const TQRegExp &, int index=-1 ) const; #endif #ifndef TQT_NO_CAST_ASCII - int tqfindRev( const char* str, int index=-1 ) const; + int findRev( const char* str, int index=-1 ) const; #endif - int tqcontains( TQChar c, bool cs=TRUE ) const; - int tqcontains( char c, bool cs=TRUE ) const - { return tqcontains(TQChar(c), cs); } + int contains( TQChar c, bool cs=TRUE ) const; + int contains( char c, bool cs=TRUE ) const + { return contains(TQChar(c), cs); } #ifndef TQT_NO_CAST_ASCII - int tqcontains( const char* str, bool cs=TRUE ) const; + int contains( const char* str, bool cs=TRUE ) const; #endif - int tqcontains( const TQString &str, bool cs=TRUE ) const; + int contains( const TQString &str, bool cs=TRUE ) const; #ifndef TQT_NO_REGEXP - int tqcontains( const TQRegExp & ) const; + int contains( const TQRegExp & ) const; #endif enum SectionFlags { @@ -1131,35 +1131,35 @@ public: #ifndef TQT_NO_REGEXP TQString &remove( const TQRegExp & ); #endif - TQString &tqreplace( uint index, uint len, const TQString & ); - TQString &tqreplace( uint index, uint len, const TQChar*, uint clen ); - TQString &tqreplace( uint index, uint len, TQChar ); - TQString &tqreplace( uint index, uint len, char c ) - { return tqreplace( index, len, TQChar(c) ); } + TQString &replace( uint index, uint len, const TQString & ); + TQString &replace( uint index, uint len, const TQChar*, uint clen ); + TQString &replace( uint index, uint len, TQChar ); + TQString &replace( uint index, uint len, char c ) + { return replace( index, len, TQChar(c) ); } #if defined(TQ_TQDOC) - TQString &tqreplace( TQChar c, const TQString & after, bool cs = TRUE ); - TQString &tqreplace( char c, const TQString & after, bool cs = TRUE ); - TQString &tqreplace( const TQString & before, const TQString & after, + TQString &replace( TQChar c, const TQString & after, bool cs = TRUE ); + TQString &replace( char c, const TQString & after, bool cs = TRUE ); + TQString &replace( const TQString & before, const TQString & after, bool cs = TRUE ); #else // ### TQt 4.0: merge these two into one, and remove TQ_TQDOC hack - TQString &tqreplace( TQChar c, const TQString & ); - TQString &tqreplace( TQChar c, const TQString &, bool ); + TQString &replace( TQChar c, const TQString & ); + TQString &replace( TQChar c, const TQString &, bool ); // ### TQt 4.0: merge these two into one, and remove TQ_TQDOC hack - TQString &tqreplace( char c, const TQString & after ) - { return tqreplace( TQChar(c), after, TRUE ); } - TQString &tqreplace( char c, const TQString & after, bool cs ) - { return tqreplace( TQChar(c), after, cs ); } + TQString &replace( char c, const TQString & after ) + { return replace( TQChar(c), after, TRUE ); } + TQString &replace( char c, const TQString & after, bool cs ) + { return replace( TQChar(c), after, cs ); } // ### TQt 4.0: merge these two into one, and remove TQ_TQDOC hack - TQString &tqreplace( const TQString &, const TQString & ); - TQString &tqreplace( const TQString &, const TQString &, bool ); + TQString &replace( const TQString &, const TQString & ); + TQString &replace( const TQString &, const TQString &, bool ); #endif #ifndef TQT_NO_REGEXP_CAPTURE - TQString &tqreplace( const TQRegExp &, const TQString & ); + TQString &replace( const TQRegExp &, const TQString & ); #endif - TQString &tqreplace( TQChar, TQChar ); + TQString &replace( TQChar, TQChar ); short toShort( bool *ok=0, int base=10 ) const; ushort toUShort( bool *ok=0, int base=10 ) const; @@ -1464,7 +1464,7 @@ inline TQString &TQString::insert( uint index, const char *s ) inline TQString &TQString::insert( uint index, const TQByteArray &s ) { - int pos = s.tqfind( 0 ); + int pos = s.find( 0 ); return insertHelper( index, s, pos==-1 ? s.size() : pos ); } #endif @@ -1486,7 +1486,7 @@ inline TQString &TQString::prepend( const TQByteArray & s ) #ifndef TQT_NO_CAST_ASCII inline TQString &TQString::operator+=( const TQByteArray &s ) { - int pos = s.tqfind( 0 ); + int pos = s.find( 0 ); return operatorPlusEqHelper( s, pos==-1 ? s.size() : pos ); } #endif @@ -1562,18 +1562,18 @@ inline TQString TQString::arg( const TQString& a1, const TQString& a2, return multiArg( 4, a1, a2, a3, a4 ); } -inline int TQString::tqfind( char c, int index, bool cs ) const -{ return tqfind(TQChar(c), index, cs); } +inline int TQString::find( char c, int index, bool cs ) const +{ return find(TQChar(c), index, cs); } -inline int TQString::tqfindRev( char c, int index, bool cs ) const -{ return tqfindRev( TQChar(c), index, cs ); } +inline int TQString::findRev( char c, int index, bool cs ) const +{ return findRev( TQChar(c), index, cs ); } #ifndef TQT_NO_CAST_ASCII -inline int TQString::tqfind( const char* str, int index ) const -{ return tqfind(TQString::fromAscii(str), index); } +inline int TQString::find( const char* str, int index ) const +{ return find(TQString::fromAscii(str), index); } -inline int TQString::tqfindRev( const char* str, int index ) const -{ return tqfindRev(TQString::fromAscii(str), index); } +inline int TQString::findRev( const char* str, int index ) const +{ return findRev(TQString::fromAscii(str), index); } #endif |