46 #include "unicode/uversion.h" 47 #include "unicode/ucol.h" 51 typedef UCollator *(*Ptr_ucol_open)(
const char *loc, UErrorCode *
status);
53 typedef UCollationResult (*
Ptr_ucol_strcoll)(
const UCollator *coll,
const UChar *source, int32_t sourceLength,
const UChar *target, int32_t targetLength);
54 typedef int32_t (*
Ptr_u_strToCase)(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
const char *locale, UErrorCode *pErrorCode);
73 #define STRINGIFY2(x) #x 74 #define STRINGIFY(x) STRINGIFY2(x) 108 qWarning(
"Unable to find symbols in icui18n");
134 qWarning(
"Unable to find symbols in icuuc");
148 UErrorCode icuStatus = U_ZERO_ERROR;
152 qWarning(
"Unable to open locale %s in ICU, error code %d",
qPrintable(localeString), icuStatus);
169 reinterpret_cast<const UChar *>(target), int32_t(targetLength));
184 UErrorCode
status = U_ZERO_ERROR;
186 int32_t size = caseFunc(reinterpret_cast<UChar *>(result.data()), result.size(),
187 reinterpret_cast<const UChar *
>(str.
constData()), str.
size(),
190 if (U_FAILURE(status))
193 if (size < result.size()) {
195 }
else if (size > result.size()) {
199 status = U_ZERO_ERROR;
200 size = caseFunc(reinterpret_cast<UChar *>(result.data()), result.size(),
201 reinterpret_cast<const UChar *
>(str.
constData()), str.
size(),
204 if (U_FAILURE(status))
208 if (size != result.size())
bool qt_u_strToLower(const QString &str, QString *out, const QLocale &locale)
static Ptr_ucol_open ptr_ucol_open
#define QT_END_NAMESPACE
This macro expands to.
static Ptr_u_strToCase ptr_u_strToLower
static UCollator * icuCollator
static Ptr_ucol_close ptr_ucol_close
static LibLoadStatus status
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
The QString class provides a Unicode character string.
The QChar class provides a 16-bit Unicode character.
static bool qt_u_strToCase(const QString &str, QString *out, const QLocale &locale, Ptr_u_strToCase caseFunc)
#define QT_BEGIN_NAMESPACE
This macro expands to.
int size() const
Returns the number of characters in this string.
bool qt_ucol_strcoll(const QChar *source, int sourceLength, const QChar *target, int targetLength, int *result)
Q_CORE_EXPORT void qWarning(const char *,...)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
bool qt_initIcu(const QString &localeString)
UCollator *(* Ptr_ucol_open)(const char *loc, UErrorCode *status)
const char * constData() const
Returns a pointer to the data stored in the byte array.
void(* Ptr_ucol_close)(UCollator *coll)
UCollationResult(* Ptr_ucol_strcoll)(const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
bool load()
Loads the library and returns true if the library was loaded successfully; otherwise returns false...
static Ptr_ucol_strcoll ptr_ucol_strcoll
int32_t(* Ptr_u_strToCase)(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode)
void setLoadHints(LoadHints hints)
bool qt_u_strToUpper(const QString &str, QString *out, const QLocale &locale)
#define qPrintable(string)
const QChar * constData() const
Returns a pointer to the data stored in the QString.
static Ptr_u_strToCase ptr_u_strToUpper
QString errorString() const
Returns a text string with the description of the last error that occurred.
QString bcp47Name() const
Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this loc...
The QLibrary class loads shared libraries at runtime.