summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlocale_p.h')
-rw-r--r--src/corelib/tools/qlocale_p.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index c2c1488966..1902e4e5af 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -126,6 +126,16 @@ private:
};
#endif
+#ifdef QT_USE_ICU
+namespace QIcu {
+ QString toUpper(const QByteArray &localeId, const QString &str, bool *ok);
+ QString toLower(const QByteArray &localeId, const QString &str, bool *ok);
+
+ bool strcoll(const QByteArray &localeID, const QChar *source, int sourceLength, const QChar *target, int targetLength, int *result);
+}
+#endif
+
+
struct QLocaleData
{
public:
@@ -178,7 +188,17 @@ public:
class Q_CORE_EXPORT QLocalePrivate : public QSharedData
{
public:
- QLocalePrivate() : m_index(0), m_numberOptions(0), m_data(0) {}
+ QLocalePrivate(int index, int numberOptions = 0)
+ : m_index(index), m_numberOptions(numberOptions)
+ {
+ m_data = dataPointerForIndex(index);
+ m_localeID = bcp47Name().toLatin1();
+ m_localeID.replace('-','_');
+ }
+
+ ~QLocalePrivate()
+ {
+ }
QChar decimal() const { return QChar(m_data->m_decimal); }
QChar group() const { return QChar(m_data->m_group); }
@@ -203,6 +223,7 @@ public:
static QLocale::Country codeToCountry(const QString &code);
static void getLangAndCountry(const QString &name, QLocale::Language &lang,
QLocale::Script &script, QLocale::Country &cntry);
+ static const QLocaleData *dataPointerForIndex(quint16 index);
QLocale::MeasurementSystem measurementSystem() const;
@@ -285,11 +306,11 @@ public:
QString dateTimeToString(const QString &format, const QDate *date, const QTime *time,
const QLocale *q) const;
-private:
friend class QLocale;
quint16 m_index;
quint16 m_numberOptions;
const QLocaleData *m_data;
+ QByteArray m_localeID;
};
inline char QLocalePrivate::digitToCLocale(QChar in) const