summaryrefslogtreecommitdiffstats
path: root/src/tools/tqstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tqstring.cpp')
-rw-r--r--src/tools/tqstring.cpp270
1 files changed, 135 insertions, 135 deletions
diff --git a/src/tools/tqstring.cpp b/src/tools/tqstring.cpp
index cec2ca61a..625884c7d 100644
--- a/src/tools/tqstring.cpp
+++ b/src/tools/tqstring.cpp
@@ -248,7 +248,7 @@ static inline bool format(TQChar::Decomposition tag, TQString & str,
unsigned int l = index + len;
unsigned int r = index;
- bool left = FALSE, right = FALSE;
+ bool left = false, right = false;
left = ((l < str.length()) &&
((str[(int)l].joining() == TQChar::Dual) ||
@@ -278,13 +278,13 @@ TQStringData::TQStringData() : TQShared(),
unicode(0),
ascii(0),
len(0),
- issimpletext(TRUE),
+ issimpletext(true),
maxl(0),
- islatin1(FALSE),
- security_unpaged(FALSE),
+ islatin1(false),
+ security_unpaged(false),
cString(0) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
- mutex = new TQMutex(FALSE);
+ mutex = new TQMutex(false);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
ref();
}
@@ -293,13 +293,13 @@ TQStringData::TQStringData(TQChar *u, uint l, uint m) : TQShared(),
unicode(u),
ascii(0),
len(l),
- issimpletext(FALSE),
+ issimpletext(false),
maxl(m),
- islatin1(FALSE),
- security_unpaged(FALSE),
+ islatin1(false),
+ security_unpaged(false),
cString(0) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
- mutex = new TQMutex(FALSE);
+ mutex = new TQMutex(false);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
}
@@ -335,7 +335,7 @@ void TQStringData::setDirty() {
delete cString;
cString = 0;
}
- issimpletext = FALSE;
+ issimpletext = false;
}
/*
@@ -1047,13 +1047,13 @@ TQString &TQString::operator=( const char *str )
/*!
\fn bool TQString::isNull() const
- Returns TRUE if the string is null; otherwise returns FALSE. A
+ Returns true if the string is null; otherwise returns false. A
null string is always empty.
\code
TQString a; // a.unicode() == 0, a.length() == 0
- a.isNull(); // TRUE, because a.unicode() == 0
- a.isEmpty(); // TRUE, because a.length() == 0
+ a.isNull(); // true, because a.unicode() == 0
+ a.isEmpty(); // true, because a.length() == 0
\endcode
\sa isEmpty(), length()
@@ -1062,17 +1062,17 @@ TQString &TQString::operator=( const char *str )
/*!
\fn bool TQString::isEmpty() const
- Returns TRUE if the string is empty, i.e. if length() == 0;
- otherwise returns FALSE. Null strings are also empty.
+ Returns true if the string is empty, i.e. if length() == 0;
+ otherwise returns false. Null strings are also empty.
\code
TQString a( "" );
- a.isEmpty(); // TRUE
- a.isNull(); // FALSE
+ a.isEmpty(); // true
+ a.isNull(); // false
TQString b;
- b.isEmpty(); // TRUE
- b.isNull(); // TRUE
+ b.isEmpty(); // true
+ b.isNull(); // true
\endcode
\sa isNull(), length()
@@ -1282,9 +1282,9 @@ static ArgEscapeData findArgEscapes(const TQString &s)
if (c == uc_end || ++c == uc_end)
break;
- bool locale_arg = FALSE;
+ bool locale_arg = false;
if (c->unicode() == 'L') {
- locale_arg = TRUE;
+ locale_arg = true;
if (++c == uc_end)
break;
}
@@ -1356,9 +1356,9 @@ static TQString replaceArgEscapes(const TQString &s, const ArgEscapeData &d, int
const TQChar *escape_start = c++;
- bool locale_arg = FALSE;
+ bool locale_arg = false;
if (c->unicode() == 'L') {
- locale_arg = TRUE;
+ locale_arg = true;
++c;
}
@@ -1883,7 +1883,7 @@ TQString &TQString::vsprintf( const char* cformat, va_list ap )
// Parse flag characters
unsigned flags = 0;
- bool no_more_flags = FALSE;
+ bool no_more_flags = false;
do {
switch (*c) {
case '#': flags |= TQLocalePrivate::Alternate; break;
@@ -1892,7 +1892,7 @@ TQString &TQString::vsprintf( const char* cformat, va_list ap )
case ' ': flags |= TQLocalePrivate::BlankBeforePositive; break;
case '+': flags |= TQLocalePrivate::AlwaysShowSign; break;
case '\'': flags |= TQLocalePrivate::ThousandsGroup; break;
- default: no_more_flags = TRUE; break;
+ default: no_more_flags = true; break;
}
if (!no_more_flags)
@@ -2225,7 +2225,7 @@ TQString& TQString::fill( TQChar c, int len )
last character; if -2, at the next to last character and so on.
(See findRev() for searching backwards.)
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
Returns the position of \a c or -1 if \a c could not be found.
@@ -2362,7 +2362,7 @@ static int bm_find( const TQString &str, int index, const TQString &pattern, uin
last character, if it is -2, at the next to last character and so
on. (See findRev() for searching backwards.)
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
Returns the position of \a str or -1 if \a str could not be found.
@@ -2469,7 +2469,7 @@ int TQString::find( const TQString& str, int index, bool cs ) const
Returns the position of \a c or -1 if \a c could not be found.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
\code
@@ -2512,7 +2512,7 @@ int TQString::findRev( TQChar c, int index, bool cs ) const
Returns the position of \a str or -1 if \a str could not be found.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
\code
@@ -2689,7 +2689,7 @@ int TQString::findRev( const TQString& str, int index, bool cs ) const
TQString TQString::section( const TQString &sep, int start, int end, int flags ) const
{
- TQStringList sections = TQStringList::split(sep, *this, TRUE);
+ TQStringList sections = TQStringList::split(sep, *this, true);
if(sections.isEmpty())
return TQString();
if(!(flags & SectionSkipEmpty)) {
@@ -2794,7 +2794,7 @@ TQString TQString::section( const TQRegExp &reg, int start, int end, int flags )
sep.setCaseSensitive(!(flags & SectionCaseInsensitiveSeps));
TQPtrList<section_chunk> l;
- l.setAutoDelete(TRUE);
+ l.setAutoDelete(true);
int n = length(), m = 0, last_m = 0, last = 0, last_len = 0;
while ( ( m = sep.search( *this, m ) ) != -1 ) {
@@ -2856,12 +2856,12 @@ TQString TQString::section( const TQRegExp &reg, int start, int end, int flags )
Returns the number of times the character \a c occurs in the
string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
\code
TQString string( "Trolltech and TQt" );
- int n = string.contains( 't', FALSE );
+ int n = string.contains( 't', false );
// n == 3
\endcode
*/
@@ -2895,7 +2895,7 @@ int TQString::contains( TQChar c, bool cs ) const
Returns the number of times the string \a str occurs in the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
*/
int TQString::contains( const char* str, bool cs ) const
@@ -2916,7 +2916,7 @@ int TQString::contains( const char* str, bool cs ) const
Find character \a c starting from position \a index.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
*/
@@ -2928,7 +2928,7 @@ int TQString::contains( const char* str, bool cs ) const
Find character \a c starting from position \a index and working
backwards.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
*/
@@ -2937,7 +2937,7 @@ int TQString::contains( const char* str, bool cs ) const
Returns the number of times \a str occurs in the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
This function counts overlapping strings, so in the example below,
@@ -2989,7 +2989,7 @@ TQString TQString::left( uint len ) const
} else if ( len >= length() ) {
return *this;
} else {
- TQString s( len, TRUE );
+ TQString s( len, true );
memcpy( s.d->unicode, d->unicode, len * sizeof(TQChar) );
s.d->len = len;
return s;
@@ -3021,7 +3021,7 @@ TQString TQString::right( uint len ) const
uint l = length();
if ( len >= l )
return *this;
- TQString s( len, TRUE );
+ TQString s( len, true );
memcpy( s.d->unicode, d->unicode+(l-len), len*sizeof(TQChar) );
s.d->len = len;
return s;
@@ -3057,7 +3057,7 @@ TQString TQString::mid( uint index, uint len ) const
if ( index == 0 && len == slen )
return *this;
const TQChar *p = unicode()+index;
- TQString s( len, TRUE );
+ TQString s( len, true );
memcpy( s.d->unicode, p, len * sizeof(TQChar) );
s.d->len = len;
return s;
@@ -3068,10 +3068,10 @@ TQString TQString::mid( uint index, uint len ) const
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
+ If \a truncate is false and the length of the string is more than
\a width, then the returned string is a copy of the string.
- If \a truncate is TRUE and the length of the string is more than
+ If \a truncate is true and the length of the string is more than
\a width, then any characters in a copy of the string after length
\a width are removed, and the copy is returned.
@@ -3108,10 +3108,10 @@ TQString TQString::leftJustify( uint width, TQChar fill, bool truncate ) const
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
+ If \a truncate is false and the length of the string is more than
\a width, then the returned string is a copy of the string.
- If \a truncate is TRUE and the length of the string is more than
+ If \a truncate is true and the length of the string is more than
\a width, then the resulting string is truncated at position \a
width.
@@ -3216,7 +3216,7 @@ TQString TQString::upper() const
the end.
Whitespace means any character for which TQChar::isSpace() returns
- TRUE. This includes Unicode characters with decimal values 9
+ true. This includes Unicode characters with decimal values 9
(TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR) and 32 (Space), and may
also include other Unicode characters.
@@ -3248,7 +3248,7 @@ TQString TQString::stripWhiteSpace() const
if ( l <= 0 )
return TQString::fromLatin1("");
- TQString result( l, TRUE );
+ TQString result( l, true );
memcpy( result.d->unicode, &s[start], sizeof(TQChar)*l );
result.d->len = l;
return result;
@@ -3261,7 +3261,7 @@ TQString TQString::stripWhiteSpace() const
replaced with a single space.
Whitespace means any character for which TQChar::isSpace() returns
- TRUE. This includes Unicode characters with decimal values 9
+ true. This includes Unicode characters with decimal values 9
(TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR), and 32 (Space).
\code
@@ -3585,7 +3585,7 @@ TQString &TQString::remove( TQChar c )
Removes every occurrence of \a str in the string. Returns a
reference to the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
This is the same as replace(\a str, "", \a cs).
@@ -3605,7 +3605,7 @@ TQString &TQString::remove( const TQString & str, bool cs )
TQString &TQString::remove( const TQString & str )
{
- return remove( str, TRUE );
+ return remove( str, true );
}
/*! \overload
@@ -3653,7 +3653,7 @@ TQString &TQString::remove( const TQRegExp & rx )
*/
TQString &TQString::remove( const char *str )
{
- return remove( TQString::fromAscii(str), TRUE );
+ return remove( TQString::fromAscii(str), true );
}
/*!
@@ -3737,7 +3737,7 @@ TQString &TQString::replace( uint index, uint len, const TQChar* s, uint slen )
Replaces every occurrence of the character \a c in the string
with \a after. Returns a reference to the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
Example:
@@ -3754,7 +3754,7 @@ TQString &TQString::replace( TQChar c, const TQString & after, bool cs )
TQString &TQString::replace( TQChar c, const TQString & after )
{
- return replace( TQString( c ), after, TRUE );
+ return replace( TQString( c ), after, true );
}
/*! \overload
@@ -3763,7 +3763,7 @@ TQString &TQString::replace( TQChar c, const TQString & after )
Replaces every occurrence of the character \a c in the string
with \a after. Returns a reference to the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
*/
@@ -3772,7 +3772,7 @@ TQString &TQString::replace( TQChar c, const TQString & after )
Replaces every occurrence of the string \a before in the string
with the string \a after. Returns a reference to the string.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
Example:
@@ -3883,7 +3883,7 @@ TQString &TQString::replace( const TQString & before, const TQString & after,
TQString &TQString::replace( const TQString & before, const TQString & after )
{
- return replace( before, after, TRUE );
+ return replace( before, after, true );
}
#ifndef TQT_NO_REGEXP_CAPTURE
@@ -4102,7 +4102,7 @@ int TQString::findRev( const TQRegExp &rx, int index ) const
\code
TQString str = "banana and panama";
- TQRegExp rxp = TQRegExp( "a[nm]a", TRUE, FALSE );
+ TQRegExp rxp = TQRegExp( "a[nm]a", true, false );
int i = str.contains( rxp ); // i == 4
\endcode
@@ -4140,7 +4140,7 @@ int TQString::contains( const TQRegExp &rx ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4155,7 +4155,7 @@ long TQString::toLong( bool *ok, int base ) const
TQ_LLONG v = toLongLong( ok, base );
if ( v < LONG_MIN || v > LONG_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return long(v);
@@ -4176,7 +4176,7 @@ long TQString::toLong( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4200,14 +4200,14 @@ TQ_LLONG TQString::toLongLong( bool *ok, int base ) const
TQ_LLONG result = def_locale.d->stringToLongLong(*this, base, &my_ok, TQLocalePrivate::FailOnGroupSeparators);
if (my_ok) {
if (ok != 0)
- *ok = TRUE;
+ *ok = true;
return result;
}
// If the default was not "C", try the "C" locale
if (def_locale.language() == TQLocale::C) {
if (ok != 0)
- *ok = FALSE;
+ *ok = false;
return 0;
}
@@ -4230,7 +4230,7 @@ TQ_LLONG TQString::toLongLong( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4245,7 +4245,7 @@ ulong TQString::toULong( bool *ok, int base ) const
TQ_ULLONG v = toULongLong( ok, base );
if ( v > ULONG_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return ulong(v);
@@ -4266,7 +4266,7 @@ ulong TQString::toULong( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4290,14 +4290,14 @@ TQ_ULLONG TQString::toULongLong( bool *ok, int base ) const
TQ_ULLONG result = def_locale.d->stringToUnsLongLong(*this, base, &my_ok, TQLocalePrivate::FailOnGroupSeparators);
if (my_ok) {
if (ok != 0)
- *ok = TRUE;
+ *ok = true;
return result;
}
// If the default was not "C", try the "C" locale
if (def_locale.language() == TQLocale::C) {
if (ok != 0)
- *ok = FALSE;
+ *ok = false;
return 0;
}
@@ -4321,7 +4321,7 @@ TQ_ULLONG TQString::toULongLong( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4337,7 +4337,7 @@ short TQString::toShort( bool *ok, int base ) const
TQ_LLONG v = toLongLong( ok, base );
if ( v < SHRT_MIN || v > SHRT_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return (short)v;
@@ -4359,7 +4359,7 @@ short TQString::toShort( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4374,7 +4374,7 @@ ushort TQString::toUShort( bool *ok, int base ) const
TQ_ULLONG v = toULongLong( ok, base );
if ( v > USHRT_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return (ushort)v;
@@ -4397,13 +4397,13 @@ ushort TQString::toUShort( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
\code
TQString str( "FF" );
bool ok;
- int hex = str.toInt( &ok, 16 ); // hex == 255, ok == TRUE
- int dec = str.toInt( &ok, 10 ); // dec == 0, ok == FALSE
+ int hex = str.toInt( &ok, 16 ); // hex == 255, ok == true
+ int dec = str.toInt( &ok, 10 ); // dec == 0, ok == false
\endcode
Leading and trailing whitespace is ignored by this function.
@@ -4419,7 +4419,7 @@ int TQString::toInt( bool *ok, int base ) const
TQ_LLONG v = toLongLong( ok, base );
if ( v < INT_MIN || v > INT_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return (int)v;
@@ -4440,7 +4440,7 @@ int TQString::toInt( bool *ok, int base ) const
Returns 0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
Leading and trailing whitespace is ignored by this function.
@@ -4455,7 +4455,7 @@ uint TQString::toUInt( bool *ok, int base ) const
TQ_ULLONG v = toULongLong( ok, base );
if ( v > UINT_MAX ) {
if ( ok )
- *ok = FALSE;
+ *ok = false;
v = 0;
}
return (uint)v;
@@ -4465,7 +4465,7 @@ uint TQString::toUInt( bool *ok, int base ) const
Returns the string converted to a \c double value.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
\code
TQString string( "1234.56" );
@@ -4533,7 +4533,7 @@ double TQString::toDouble( bool *ok ) const
if (length() > 0 && unicode()[length() - 1].isSpace()) {
TQString tmp = stripWhiteSpace();
if (ok != 0)
- *ok = FALSE;
+ *ok = false;
return tmp.toDouble();
}
@@ -4543,14 +4543,14 @@ double TQString::toDouble( bool *ok ) const
double result = def_locale.d->stringToDouble(*this, &my_ok, TQLocalePrivate::FailOnGroupSeparators);
if (my_ok) {
if (ok != 0)
- *ok = TRUE;
+ *ok = true;
return result;
}
// If the default was not "C", try the "C" locale
if (def_locale.language() == TQLocale::C) {
if (ok != 0)
- *ok = FALSE;
+ *ok = false;
return 0.0;
}
@@ -4564,7 +4564,7 @@ double TQString::toDouble( bool *ok ) const
Returns 0.0 if the conversion fails.
If \a ok is not 0: if a conversion error occurs, \a *ok is set to
- FALSE; otherwise \a *ok is set to TRUE.
+ false; otherwise \a *ok is set to true.
For information on how string-to-number functions in TQString handle
localized input, see toDouble().
@@ -4584,11 +4584,11 @@ float TQString::toFloat( bool *ok ) const
double d = toDouble(&myOk);
if (!myOk || d > QT_MAX_FLOAT || d < -QT_MAX_FLOAT) {
if (ok != 0)
- *ok = FALSE;
+ *ok = false;
return 0.0;
}
if (ok != 0)
- *ok = TRUE;
+ *ok = true;
return (float) d;
}
@@ -4915,7 +4915,7 @@ void TQString::setExpand( uint index, TQChar c )
/*!
\fn bool TQString::operator!() const
- Returns TRUE if this is a null string; otherwise returns FALSE.
+ Returns true if this is a null string; otherwise returns false.
\code
TQString name = getName();
@@ -5142,7 +5142,7 @@ const char* TQString::latin1() const
}
delete [] d->ascii;
d->ascii = unicodeToLatin1( d->unicode, d->len, d->security_unpaged );
- d->islatin1 = TRUE;
+ d->islatin1 = true;
}
return d->ascii;
}
@@ -5181,7 +5181,7 @@ const char* TQString::ascii() const
} else {
d->ascii = 0;
}
- d->islatin1 = FALSE;
+ d->islatin1 = false;
}
return d->ascii;
}
@@ -5441,7 +5441,7 @@ TQString TQString::fromLatin1( const char* chars, int len )
len = -1;
}
uc = internalLatin1ToUnicode( chars, &l, len );
- TQString ret( new TQStringData(uc, l, l), TRUE );
+ TQString ret( new TQStringData(uc, l, l), true );
return ret;
}
@@ -5609,7 +5609,7 @@ TQString TQString::fromUcs2( const unsigned short *str )
length++;
TQChar* uc = QT_ALLOC_QCHAR_VEC( length );
memcpy( uc, str, length*sizeof(TQChar) );
- TQString ret( new TQStringData( uc, length, length ), TRUE );
+ TQString ret( new TQStringData( uc, length, length ), true );
return ret;
}
}
@@ -5885,12 +5885,12 @@ void TQString::checkSimpleText() const
ushort uc = p->unicode();
// sort out regions of complex text formatting
if ( uc > 0x058f && ( uc < 0x1100 || uc > 0xfb0f ) ) {
- d->issimpletext = FALSE;
+ d->issimpletext = false;
return;
}
p++;
}
- d->issimpletext = TRUE;
+ d->issimpletext = true;
}
/*! \fn bool TQString::simpleText() const
@@ -5909,18 +5909,18 @@ bool TQString::isRightToLeft() const
case TQChar::DirL:
case TQChar::DirLRO:
case TQChar::DirLRE:
- return FALSE;
+ return false;
case TQChar::DirR:
case TQChar::DirAL:
case TQChar::DirRLO:
case TQChar::DirRLE:
- return TRUE;
+ return true;
default:
break;
}
++p;
}
- return FALSE;
+ return false;
}
@@ -6031,7 +6031,7 @@ int TQString::localeAwareCompare( const TQString& s ) const
bool operator==( const TQString &s1, const TQString &s2 )
{
if ( s1.unicode() == s2.unicode() )
- return TRUE;
+ return true;
return (s1.length() == s2.length()) && s1.isNull() == s2.isNull() &&
(memcmp((char*)s1.unicode(),(char*)s2.unicode(),
s1.length()*sizeof(TQChar)) == 0 );
@@ -6062,7 +6062,7 @@ bool operator==( const TQString &s1, const char *s2 )
const TQChar *uc = s1.unicode();
while ( len ) {
if ( !(*s2) || uc->unicode() != (uchar) *s2 )
- return FALSE;
+ return false;
++uc;
++s2;
--len;
@@ -6113,7 +6113,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) == 0.
@@ -6127,7 +6127,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) == 0.
@@ -6141,7 +6141,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) == 0.
@@ -6154,7 +6154,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is not equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is not equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) != 0.
@@ -6168,7 +6168,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is not equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is not equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) != 0.
@@ -6182,7 +6182,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is not equal to \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is not equal to \a s2; otherwise returns false.
Note that a null string is not equal to a not-null empty string.
Equivalent to compare(\a s1, \a s2) != 0.
@@ -6195,7 +6195,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is lexically less than \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is lexically less than \a s2; otherwise returns false.
The comparison is case sensitive.
Equivalent to compare(\a s1, \a s2) \< 0.
@@ -6207,7 +6207,7 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is lexically less than \a s2; otherwise returns FALSE.
+ Returns true if \a s1 is lexically less than \a s2; otherwise returns false.
The comparison is case sensitive.
Equivalent to compare(\a s1, \a s2) \< 0.
@@ -6218,8 +6218,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is lexically less than or equal to \a s2;
- otherwise returns FALSE.
+ Returns true if \a s1 is lexically less than or equal to \a s2;
+ otherwise returns false.
The comparison is case sensitive.
Note that a null string is not equal to a not-null empty string.
@@ -6234,8 +6234,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is lexically less than or equal to \a s2;
- otherwise returns FALSE.
+ Returns true if \a s1 is lexically less than or equal to \a s2;
+ otherwise returns false.
The comparison is case sensitive.
Note that a null string is not equal to a not-null empty string.
@@ -6249,8 +6249,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is lexically greater than \a s2; otherwise
- returns FALSE.
+ Returns true if \a s1 is lexically greater than \a s2; otherwise
+ returns false.
The comparison is case sensitive.
Equivalent to compare(\a s1, \a s2) \> 0.
@@ -6262,8 +6262,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is lexically greater than \a s2; otherwise
- returns FALSE.
+ Returns true if \a s1 is lexically greater than \a s2; otherwise
+ returns false.
The comparison is case sensitive.
Equivalent to compare(\a s1, \a s2) \> 0.
@@ -6274,8 +6274,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\relates TQString
- Returns TRUE if \a s1 is lexically greater than or equal to \a s2;
- otherwise returns FALSE.
+ Returns true if \a s1 is lexically greater than or equal to \a s2;
+ otherwise returns false.
The comparison is case sensitive.
Note that a null string is not equal to a not-null empty string.
@@ -6290,8 +6290,8 @@ bool operator>=( const char *s1, const TQString &s2 )
\overload
\relates TQString
- Returns TRUE if \a s1 is lexically greater than or equal to \a s2;
- otherwise returns FALSE.
+ Returns true if \a s1 is lexically greater than or equal to \a s2;
+ otherwise returns false.
The comparison is case sensitive.
Note that a null string is not equal to a not-null empty string.
@@ -6493,7 +6493,7 @@ TQDataStream &operator>>( TQDataStream &s, TQString &str )
guarantee that \a unicode will not be deleted or modified.
*/
TQConstString::TQConstString( const TQChar* unicode, uint length ) :
- TQString( new TQStringData( (TQChar*)unicode, length, length ), TRUE )
+ TQString( new TQStringData( (TQChar*)unicode, length, length ), true )
{
}
@@ -6530,16 +6530,16 @@ TQConstString::~TQConstString()
*/
/*!
- Returns TRUE if the string starts with \a s; otherwise returns
- FALSE.
+ Returns true if the string starts with \a s; otherwise returns
+ false.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
\code
TQString str( "Bananas" );
- str.startsWith( "Ban" ); // returns TRUE
- str.startsWith( "Car" ); // returns FALSE
+ str.startsWith( "Ban" ); // returns true
+ str.startsWith( "Car" ); // returns false
\endcode
\sa endsWith()
@@ -6549,34 +6549,34 @@ bool TQString::startsWith( const TQString& s, bool cs ) const
if ( isNull() )
return s.isNull();
if ( s.length() > length() )
- return FALSE;
+ return false;
if ( cs ) {
return memcmp((char*)d->unicode, (char*)s.d->unicode, s.length()*sizeof(TQChar)) == 0;
} else {
for ( int i = 0; i < (int) s.length(); i++ ) {
if ( ::lower(d->unicode[i]) != ::lower(s.d->unicode[i]) )
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
bool TQString::startsWith( const TQString& s ) const
{
- return startsWith( s, TRUE );
+ return startsWith( s, true );
}
/*!
- Returns TRUE if the string ends with \a s; otherwise returns
- FALSE.
+ Returns true if the string ends with \a s; otherwise returns
+ false.
- If \a cs is TRUE (the default), the search is case sensitive;
+ If \a cs is true (the default), the search is case sensitive;
otherwise the search is case insensitive.
\code
TQString str( "Bananas" );
- str.endsWith( "anas" ); // returns TRUE
- str.endsWith( "pple" ); // returns FALSE
+ str.endsWith( "anas" ); // returns true
+ str.endsWith( "pple" ); // returns false
\endcode
\sa startsWith()
@@ -6587,21 +6587,21 @@ bool TQString::endsWith( const TQString& s, bool cs ) const
return s.isNull();
int pos = length() - s.length();
if ( pos < 0 )
- return FALSE;
+ return false;
if ( cs ) {
return memcmp((char*)&d->unicode[pos], (char*)s.d->unicode, s.length()*sizeof(TQChar)) == 0;
} else {
for ( int i = 0; i < (int) s.length(); i++ ) {
if ( ::lower(d->unicode[pos + i]) != ::lower(s.d->unicode[i]) )
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
bool TQString::endsWith( const TQString& s ) const
{
- return endsWith( s, TRUE );
+ return endsWith( s, true );
}
/*! \fn void TQString::detach()
@@ -6619,7 +6619,7 @@ bool TQString::endsWith( const TQString& s ) const
\obsolete
Returns a static Windows TCHAR* from a TQString, adding NUL if \a
- addnul is TRUE.
+ addnul is true.
The lifetime of the return value is until the next call to this function,
or until the last copy of str is deleted, whatever comes first.