9#include <QtCore/private/qcore_mac_p.h>
11#include <CoreFoundation/CoreFoundation.h>
12#include <CoreFoundation/CFLocale.h>
35 qWarning(
"Couldn't initialize the locale (%d)",
int(status));
39 options |= kUCCollateCaseInsensitiveMask;
41 options |= kUCCollateDigitsAsNumberMask | kUCCollateDigitsOverrideMask;
43 options |= kUCCollatePunctuationSignificantMask;
45 status = UCCreateCollator(localeRef, 0, options, &
collator);
47 qWarning(
"Couldn't initialize the collator (%d)",
int(status));
62 return s2.size() ? -1 : 0;
74 reinterpret_cast<const UniChar *
>(
s1.data()),
s1.size(),
75 reinterpret_cast<const UniChar *
>(
s2.data()),
s2.size(),
80 return result < 0 ? -1 : 1;
89 qWarning(
"QCollator doesn't support sort keys for the C locale on Darwin");
93 auto text =
reinterpret_cast<const UniChar *
>(
string.constData());
98 ret.size(), &actualSize,
ret.data());
100 ret.resize(actualSize + 1);
101 if (status == kUCOutputBufferTooSmall) {
103 ret.size(), &actualSize,
ret.data());
104 Q_ASSERT(status != kUCOutputBufferTooSmall);
117 UCCompareCollationKeys(
d->
m_key.data(),
d->
m_key.size(),
118 key.d->m_key.data(),
key.d->m_key.size(),
Qt::CaseSensitivity caseSensitivity
QExplicitlySharedDataPointer< QCollatorSortKeyPrivate > d
int compare(const QCollatorSortKey &key) const
Compares this key to otherKey, which must have been created by the same QCollator's sortKey() as this...
QCollatorSortKey sortKey(const QString &string) const
Returns a sortKey for string.
int compare(const QString &s1, const QString &s2) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Qt::CaseSensitivity caseSensitivity() const
Returns case sensitivity of the collator.
T * data() const noexcept
Returns a pointer to the shared data object.
static const QLocalePrivate * get(const QLocale &l)
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLfixed GLfixed GLint GLint order