diff options
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 85 |
1 files changed, 77 insertions, 8 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 5cbad2554c..accdb83608 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -81,9 +81,6 @@ #ifdef Q_OS_WIN # include <qt_windows.h> -# ifdef Q_OS_WINCE -# include <winnls.h> -# endif #endif #ifdef truncate @@ -5518,7 +5515,7 @@ int QString::localeAwareCompare(const QString &other) const return localeAwareCompare_helper(constData(), length(), other.constData(), other.length()); } -#if defined(QT_USE_ICU) && !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE) && !defined (Q_OS_MAC) +#if defined(QT_USE_ICU) && !defined(Q_OS_WIN32) && !defined(Q_OS_DARWIN) Q_GLOBAL_STATIC(QThreadStorage<QCollator>, defaultCollator) #endif @@ -5533,12 +5530,12 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, if (length1 == 0 || length2 == 0) return ucstrcmp(data1, length1, data2, length2); -#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) -#ifndef Q_OS_WINRT +#if defined(Q_OS_WIN) +# ifndef Q_OS_WINRT int res = CompareString(GetUserDefaultLCID(), 0, (wchar_t*)data1, length1, (wchar_t*)data2, length2); -#else +# else int res = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, (LPCWSTR)data1, length1, (LPCWSTR)data2, length2, NULL, NULL, 0); -#endif +# endif switch (res) { case CSTR_LESS_THAN: @@ -8324,6 +8321,78 @@ QString &QString::setRawData(const QChar *unicode, int size) Returns the size of the Latin-1 string stored in this object. */ +/*! \fn QLatin1Char QLatin1String::at(int pos) const + \since 5.8 + + Returns the character at position \a pos in this object. + + \note This function performs no error checking. + The behavior is undefined when \a pos < 0 or \a pos ≥ size(). + + \sa operator[]() +*/ + +/*! \fn QLatin1Char QLatin1String::operator[](int pos) const + \since 5.8 + + Returns the character at position \a pos in this object. + + \note This function performs no error checking. + The behavior is undefined when \a pos < 0 or \a pos ≥ size(). + + \sa at() +*/ + +/*! \fn QLatin1String QLatin1String::mid(int start) const + \since 5.8 + + Returns the substring starting at position \a start in this object, + and extending to the end of the string. + + \note This function performs no error checking. + The behavior is undefined when \a start < 0 or \a start > size(). + + \sa left(), right() +*/ + +/*! \fn QLatin1String QLatin1String::mid(int start, int length) const + \since 5.8 + \overload + + Returns the substring of length \a length starting at position + \a start in this object. + + \note This function performs no error checking. + The behavior is undefined when \a start < 0, \length < 0, + or \a start + \a length > size(). + + \sa left(), right() +*/ + +/*! \fn QLatin1String QLatin1String::left(int length) const + \since 5.8 + + Returns the substring of length \a length starting at position + 0 in this object. + + \note This function performs no error checking. + The behavior is undefined when \length < 0 or \a length > size(). + + \sa mid(), right() +*/ + +/*! \fn QLatin1String QLatin1String::right(int length) const + \since 5.8 + + Returns the substring of length \a length starting at position + size() - \a length in this object. + + \note This function performs no error checking. + The behavior is undefined when \length < 0 or \a length > size(). + + \sa mid(), left() +*/ + /*! \fn bool QLatin1String::operator==(const QString &other) const Returns \c true if this string is equal to string \a other; |