44 #ifndef QT_NO_SYSTEMLOCALE 51 #if !defined(QWS) && defined(Q_OS_MAC) 52 # include "private/qcore_mac_p.h" 53 # include <CoreFoundation/CoreFoundation.h> 56 #include "qplatformdefs.h" 73 #include "private/qnumeric_p.h" 74 #include "private/qsystemlibrary_p.h" 78 #if defined(Q_OS_SYMBIAN) 79 void qt_symbianUpdateSystemPrivate();
82 #ifndef QT_NO_SYSTEMLOCALE 106 if (len != 2 && len != 3)
112 if (uc1 ==
'n' && uc2 ==
'o' && uc3 == 0)
116 for (; *c != 0; c += 3) {
117 if (uc1 == c[0] && uc2 == c[1] && uc3 == c[2])
138 if (c0 == c[0] && c1 == c[1] && c2 == c[2] && c3 == c[3])
147 if (len != 2 && len != 3)
154 for (; *c != 0; c += 3) {
155 if (uc1 == c[0] && uc2 == c[1] && uc3 == c[2])
213 const unsigned char *
script =
217 char len = (lang[2] != 0 ? 3 : 2) + (script ? 4+1 : 0) + (country ? (country[2] != 0 ? 3 : 2)+1 : 0);
226 *uc++ =
ushort(script[0]);
227 *uc++ =
ushort(script[1]);
228 *uc++ =
ushort(script[2]);
229 *uc++ =
ushort(script[3]);
233 *uc++ =
ushort(country[0]);
234 *uc++ =
ushort(country[1]);
236 *uc++ =
ushort(country[2]);
243 const unsigned language_id =
language;
244 const unsigned script_id =
script;
245 const unsigned country_id =
country;
289 for (; i < l && size < 8; ++i, ++size) {
304 const int length = name.
length();
306 lang = script = cntry =
QString();
309 enum ParserState {
NoState, LangState, ScriptState, CountryState };
310 ParserState state = LangState;
311 for (
int i = 0; i < length && state !=
NoState; ) {
332 if (value.
length() == 4 && scripts.
indexOf(value) % 4 == 0) {
335 state = CountryState;
349 qWarning(
"QLocale: This should never happen");
393 if (i == format.
size())
402 while (i < format.
size()) {
404 if (i + 1 < format.
size() && format.
at(i + 1).
unicode() ==
'\'') {
415 if (i < format.
size())
425 while (j < s.
size() && s.
at(j) ==
c)
433 #ifndef QT_NO_SYSTEMLOCALE 448 _systemLocale =
this;
451 system_lp->m_language_id = 0;
463 if (_systemLocale ==
this) {
467 system_lp->m_language_id = 0;
482 system_lp = globalLocalePrivate();
489 #if defined(Q_OS_SYMBIAN) 490 qt_symbianUpdateSystemPrivate();
495 system_lp->m_language_id = res.
toInt();
500 system_lp->m_country_id = res.
toInt();
505 system_lp->m_script_id = res.
toInt();
537 #ifndef QT_NO_SYSTEMLOCALE 539 if (!system_lp || system_lp->m_language_id == 0)
557 static const ushort separator =
';';
558 while (index && size > 0) {
559 while (*data != separator)
566 while (size > 0 && *end != separator)
579 #ifndef QT_NO_DATASTREAM 593 #endif // QT_NO_DATASTREAM 600 #ifndef QT_NO_SYSTEMLOCALE 601 Q_ASSERT(index <= locale_data_size);
602 if (index == locale_data_size)
613 #ifndef QT_NO_SYSTEMLOCALE 615 || (p != 0 && p == system_lp));
618 Q_ASSERT(p >= locale_data && p - locale_data < locale_data_size);
828 #ifndef QT_NO_SYSTEMLOCALE 841 return QChar(
d()->m_quotation_start) % str %
QChar(
d()->m_quotation_end);
843 return QChar(
d()->m_alternate_quotation_start) % str %
QChar(
d()->m_alternate_quotation_end);
857 #ifndef QT_NO_SYSTEMLOCALE 867 const int size = list.
size();
870 }
else if (size == 2) {
872 return format.
arg(list.
at(0), list.
at(1));
873 }
else if (size > 2) {
878 for (
int i = 2; i < size - 1; ++i)
879 result = formatMid.
arg(result, list.
at(i));
880 result = formatEnd.
arg(result, list.
at(size - 1));
907 default_lp = locale.
d();
937 return Script(
d()->m_script_id);
965 const QLocalePrivate *dd =
d();
990 result.resize(data - begin);
1080 if (i < SHRT_MIN || i > SHRT_MAX) {
1108 if (i > USHRT_MAX) {
1136 if (i < INT_MIN || i >
INT_MAX) {
1242 #define QT_MAX_FLOAT 3.4028234663852886e+38 1340 #ifndef QT_NO_SYSTEMLOCALE 1357 while (i < format.
size()) {
1373 #if defined(Q_OS_WINCE) 1374 TIME_ZONE_INFORMATION
info;
1375 DWORD res = GetTimeZoneInformation(&info);
1376 if (res == TIME_ZONE_ID_UNKNOWN)
1379 #elif defined(Q_OS_WIN) 1381 # if defined(_MSC_VER) && _MSC_VER >= 1400 1382 size_t returnSize = 0;
1383 char timeZoneName[512];
1384 if (_get_tzname(&returnSize, timeZoneName, 512, 1))
1390 #elif defined(Q_OS_VXWORKS) 1441 #ifndef QT_NO_SYSTEMLOCALE 1453 return toString(dateTime, format_str);
1467 #ifndef QT_NO_SYSTEMLOCALE 1497 #ifndef QT_NO_SYSTEMLOCALE 1537 #ifndef QT_NO_SYSTEMLOCALE 1577 #ifndef QT_NO_SYSTEMLOCALE 1605 #ifndef QT_NO_DATESTRING 1626 #ifndef QT_NO_DATESTRING 1648 #ifndef QT_NO_DATESTRING 1669 #ifndef QT_NO_DATESTRING 1673 #ifndef QT_BOOTSTRAPPED 1703 #ifndef QT_NO_DATESTRING 1707 #ifndef QT_BOOTSTRAPPED 1737 #ifndef QT_NO_DATESTRING 1740 #ifndef QT_BOOTSTRAPPED 1850 return c >=
'A' && c <=
'Z';
1855 if (c >=
'A' && c <=
'Z')
1856 return c -
'A' +
'a';
1948 result.
reserve(locale_data_size);
1981 if (language ==
C) {
1989 result << static_cast<Country>(d->
countryId());
2009 if (month < 1 || month > 12)
2012 #ifndef QT_NO_SYSTEMLOCALE 2058 if (month < 1 || month > 12)
2061 #ifndef QT_NO_SYSTEMLOCALE 2108 if (day < 1 || day > 7)
2111 #ifndef QT_NO_SYSTEMLOCALE 2160 if (day < 1 || day > 7)
2163 #ifndef QT_NO_SYSTEMLOCALE 2194 return dayName(day == 0 ? 7 : day, type);
2208 #ifndef QT_NO_SYSTEMLOCALE 2212 return static_cast<Qt::DayOfWeek>(res.
toUInt());
2239 #ifndef QT_NO_SYSTEMLOCALE 2250 if ((weekendEnd >= weekendStart && (day < weekendStart || day > weekendEnd)) ||
2251 (weekendEnd < weekendStart && (day > weekendEnd && day < weekendStart)))
2252 weekdays << static_cast<Qt::DayOfWeek>(day);
2267 #ifndef QT_NO_SYSTEMLOCALE 2355 #ifndef QT_NO_SYSTEMLOCALE 2378 #ifndef QT_NO_SYSTEMLOCALE 2397 enum { AM, PM } am_pm = AM;
2398 int hour12 = time ? time->
hour() : -1;
2403 }
else if (hour12 < 12) {
2405 }
else if (hour12 == 12) {
2416 while (i < format.
size()) {
2431 else if (repeat >= 2)
2436 result.
append(longLongToString(date->
year()));
2439 result.
append(longLongToString(date->
year() % 100, -1, 10, 2,
2451 repeat =
qMin(repeat, 4);
2470 repeat =
qMin(repeat, 4);
2473 result.
append(longLongToString(date->
day()));
2491 if (!used && time) {
2495 repeat =
qMin(repeat, 2);
2496 const int hour = format_am_pm ? hour12 : time->
hour();
2500 result.
append(longLongToString(hour));
2510 repeat =
qMin(repeat, 2);
2513 result.
append(longLongToString(time->
hour()));
2523 repeat =
qMin(repeat, 2);
2536 repeat =
qMin(repeat, 2);
2576 result.
append(longLongToString(time->
msec()));
2606 unsigned flags)
const 2610 d, precision, form, width, flags);
2621 if (precision == -1)
2626 bool negative =
false;
2627 bool special_number =
false;
2633 special_number =
true;
2637 special_number =
true;
2641 if (!special_number) {
2645 #ifdef QT_QLOCALE_USES_FCVT 2647 if (form == DFDecimal) {
2651 if (form == DFExponent)
2653 else if (form == DFSignificantDigits && pr == 0)
2658 if (digits.
length() > 0) {
2659 int last_nonzero_idx = digits.
length() - 1;
2660 while (last_nonzero_idx > 0
2663 digits.
truncate(last_nonzero_idx + 1);
2670 if (form == DFDecimal)
2682 if (form == DFExponent)
2696 #endif // QT_QLOCALE_USES_FCVT 2700 for (
int i = 0; i < digits.
length(); ++i)
2701 reinterpret_cast<ushort *>(digits.
data())[i] += z;
2704 bool always_show_decpt = (flags & Alternate || flags & ForcePoint);
2707 num_str =
exponentForm(_zero, decimal, exponential, group, plus, minus,
2715 always_show_decpt, flags & ThousandsGroup);
2718 case DFSignificantDigits: {
2722 if (decpt != digits.
length() && (decpt <= -4 || decpt > precision))
2723 num_str =
exponentForm(_zero, decimal, exponential, group, plus, minus,
2724 digits, decpt, precision, mode,
2728 digits, decpt, precision, mode,
2729 always_show_decpt, flags & ThousandsGroup);
2734 negative = sign != 0 && !
isZero(d);
2741 && !special_number) {
2742 int num_pad_chars = width - num_str.
length();
2749 for (
int i = 0; i < num_pad_chars; ++i)
2768 int base,
int width,
2769 unsigned flags)
const 2772 l, precision, base, width, flags);
2778 int base,
int width,
2781 bool precision_not_specified =
false;
2782 if (precision == -1) {
2783 precision_not_specified =
true;
2787 bool negative = l < 0;
2790 flags &= ~AlwaysShowSign;
2791 flags &= ~BlankBeforePositive;
2797 num_str =
qlltoa(l, base, zero);
2799 num_str =
qulltoa(l, base, zero);
2801 uint cnt_thousand_sep = 0;
2802 if (flags & ThousandsGroup && base == 10) {
2803 for (
int i = num_str.
length() - 3; i > 0; i -= 3) {
2804 num_str.
insert(i, group);
2809 for (
int i = num_str.
length(); i < precision; ++i)
2812 if ((flags & Alternate || flags & ShowBase)
2819 bool zero_padded = flags & ZeroPadded
2820 && !(flags & LeftAdjusted)
2821 && precision_not_specified;
2824 int num_pad_chars = width - num_str.
length();
2828 || flags & AlwaysShowSign
2829 || flags & BlankBeforePositive)
2833 if (base == 16 && (flags & Alternate || flags & ShowBase))
2836 else if (base == 2 && (flags & Alternate || flags & ShowBase))
2839 for (
int i = 0; i < num_pad_chars; ++i)
2843 if (flags & CapitalEorX)
2846 if (base == 16 && (flags & Alternate || flags & ShowBase))
2848 if (base == 2 && (flags & Alternate || flags & ShowBase))
2854 else if (flags & AlwaysShowSign)
2856 else if (flags & BlankBeforePositive)
2863 int base,
int width,
2864 unsigned flags)
const 2867 l, precision, base, width, flags);
2873 int base,
int width,
2876 bool precision_not_specified =
false;
2877 if (precision == -1) {
2878 precision_not_specified =
true;
2884 uint cnt_thousand_sep = 0;
2885 if (flags & ThousandsGroup && base == 10) {
2886 for (
int i = num_str.
length() - 3; i > 0; i -=3) {
2887 num_str.
insert(i, group);
2892 for (
int i = num_str.
length(); i < precision; ++i)
2895 if ((flags & Alternate || flags & ShowBase)
2902 bool zero_padded = flags & ZeroPadded
2903 && !(flags & LeftAdjusted)
2904 && precision_not_specified;
2907 int num_pad_chars = width - num_str.
length();
2910 if (base == 16 && flags & Alternate)
2913 else if (base == 2 && flags & Alternate)
2916 for (
int i = 0; i < num_pad_chars; ++i)
2920 if (flags & CapitalEorX)
2923 if (base == 16 && (flags & Alternate || flags & ShowBase))
2925 else if (base == 2 && (flags & Alternate || flags & ShowBase))
2929 if (flags & AlwaysShowSign)
2931 else if (flags & BlankBeforePositive)
2954 while (idx < l && uc[idx].isSpace())
2960 const QChar &in = uc[idx];
2962 char out = digitToCLocale(in);
2983 for (; idx <
l; ++idx) {
2984 if (!uc[idx].isSpace())
2991 if (group_sep_mode == ParseGroupSeparators
3000 int decDigits)
const 3005 const bool scientific = numMode == DoubleScientificMode;
3006 bool lastWasE =
false;
3007 bool lastWasDigit =
false;
3009 int decPointCnt = 0;
3011 int decDigitCnt = 0;
3013 for (
int i = 0; i < str.
length(); ++i) {
3014 char c = digitToCLocale(str.
at(i));
3016 if (c >=
'0' && c <=
'9') {
3017 if (numMode != IntegerMode) {
3019 if (dec && decDigits != -1 && decDigits < ++decDigitCnt)
3022 lastWasDigit =
true;
3026 if (numMode == IntegerMode) {
3031 if (++decPointCnt > 1)
3038 #endif // On second thoughts, it shall be Valid. 3049 if (i != 0 && !lastWasE)
3061 if (!lastWasDigit || decPointCnt > 0)
3081 lastWasDigit =
false;
3084 lastWasE = c ==
'e';
3096 if (!numberToCLocale(group().unicode() == 0xa0 ? number.
trimmed() : number,
3097 group_sep_mode, &buff)) {
3102 return bytearrayToDouble(buff.
constData(), ok);
3109 if (!numberToCLocale(group().unicode() == 0xa0 ? number.
trimmed() : number,
3110 group_sep_mode, &buff)) {
3123 if (!numberToCLocale(group().unicode() == 0xa0 ? number.
trimmed() : number,
3124 group_sep_mode, &buff)) {
3153 if (
qstrcmp(num,
"-inf") == 0)
3158 double d =
qstrtod(num, &endptr, &_ok);
3166 *overflow = *endptr !=
'\0';
3170 if (*endptr !=
'\0') {
3204 if (overflow != 0) {
3207 *overflow = *endptr !=
'\0';
3212 if (*endptr !=
'\0') {
3234 if (!_ok || *endptr !=
'\0') {
3269 #ifndef QT_NO_SYSTEMLOCALE 3288 const QLocalePrivate *
d = this->
d();
3289 for (; len < 3; ++len)
3311 #ifndef QT_NO_SYSTEMLOCALE 3319 const QLocalePrivate *
d = this->
d();
3332 return format.
arg(str, sym);
3341 #ifndef QT_NO_SYSTEMLOCALE 3349 const QLocalePrivate *
d = this->
d();
3357 return format.
arg(str, sym);
3366 #ifndef QT_NO_SYSTEMLOCALE 3374 const QLocalePrivate *
d = this->
d();
3388 return format.
arg(str, sym);
3412 #ifndef QT_NO_SYSTEMLOCALE 3438 #ifndef QT_NO_SYSTEMLOCALE 3461 #ifndef QT_NO_SYSTEMLOCALE The QVariant class acts like a union for the most common Qt data types.
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int dayOfWeek() const
Returns the weekday (1 = Monday to 7 = Sunday) for this date.
static void updateSystemPrivate()
quint16 m_standalone_long_month_names_idx
const T * constData() const
QChar positiveSign() const
Returns the positive sign character of this locale.
virtual ~QSystemLocale()
Deletes the object.
quint16 m_standalone_long_month_names_size
Qt::LayoutDirection textDirection() const
Returns the text direction of the language.
bool qt_u_strToLower(const QString &str, QString *out, const QLocale &locale)
#define QT_MAX_FLOAT
Returns the float represented by the localized string s, or 0.0 if the conversion failed...
quint16 m_narrow_month_names_idx
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
bool numberToCLocale(const QString &num, GroupSeparatorMode group_sep_mode, CharBuff *result) const
Language language() const
Returns the language of this locale.
static qint64 bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow=0)
static mach_timebase_info_data_t info
qint64 stringToLongLong(const QString &num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static QList< QLocale > matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Country country)
Returns a list of valid locale objects that match the given language, script and country.
QString scriptCode() const
#define QT_END_NAMESPACE
This macro expands to.
static const QSystemLocale * systemLocale()
const QChar at(int i) const
Returns the character at the given index position in the string.
quint16 countryId() const
QList< Qt::DayOfWeek > weekdays() const
Returns a list of days that are considered weekdays according to the current locale.
bool isValid() const
Returns true if this date is valid; otherwise returns false.
quint16 m_standalone_narrow_day_names_size
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
bool isNull() const
Returns true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false...
static QString countryToString(Country country)
Returns a QString containing the name of country.
QString timeFormat(FormatType format=LongFormat) const
Returns the time format used for the current locale.
static const unsigned char script_code_list[]
QByteArray & append(char c)
Appends the character ch to this byte array.
static const QLocalePrivate * systemPrivate()
quint16 m_standalone_narrow_day_names_idx
QDateTime toDateTime(const QString &string, FormatType format=LongFormat) const
Parses the date/time string given in string and returns the time.
QString createSeparatedList(const QStringList &strl) const
Returns a string that represents a join of a given list of strings with a separator defined by the lo...
QString monthName(int, FormatType format=LongFormat) const
Returns the localized name of month, in the format specified by type.
uint toUInt(const QString &s, bool *ok=0, int base=0) const
Returns the unsigned int represented by the localized string s, using base base.
The QByteArray class provides an array of bytes.
QChar exponential() const
Returns the exponential character of this locale.
static const QLocalePrivate * defaultPrivate()
int length() const
Returns the number of characters in this string.
QString & prepend(QChar c)
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
quint16 m_short_day_names_idx
bool parseFormat(const QString &format)
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
static QLocale::Language codeToLanguage(const QString &code)
QChar zeroDigit() const
Returns the zero digit character of this locale.
quint16 m_short_month_names_size
quint16 m_narrow_month_names_size
quint16 m_standalone_short_month_names_size
QSystemLocale()
Constructs a QSystemLocale object.
quint16 languageId() const
static bool qt_is_nan(double d)
int day() const
Returns the day of the month (1 to 31) of this date.
bool isValid() const
Returns true if both the date and the time are valid; otherwise returns false.
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
quint16 m_standalone_long_day_names_idx
static const QLocalePrivate * dataPointerHelper(quint16 index)
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int msec() const
Returns the millisecond part (0 to 999) of the time.
static const ushort pm_data[]
bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QString &cntry)
quint16 m_long_time_format_idx
static const QLocalePrivate * findLocale(const QString &name)
static QList< Country > countriesForLanguage(Language lang)
Returns the list of countries that have entires for language in Qt's locale database.
QString name() const
Returns the language and country of this locale as a string of the form "language_country", where language is a lowercase, two-letter ISO 639 language code, and country is an uppercase, two- or three-letter ISO 3166 country code.
static const ushort currency_symbol_data[]
static double bytearrayToDouble(const char *num, bool *ok, bool *overflow=0)
quint16 m_short_date_format_size
The QString class provides a Unicode character string.
static const char language_name_list[]
static const unsigned char country_code_list[]
void setNumberOptions(NumberOptions options)
Sets the options related to number conversions for this QLocale instance.
The QChar class provides a 16-bit Unicode character.
QChar * data()
Returns a pointer to the data stored in the QString.
static QString fromRawData(const QChar *, int size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
QString toString(qlonglong i) const
Returns a localized string representation of i.
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
NumberOptions numberOptions() const
Returns the options related to number conversions for this QLocale instance.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
quint16 m_short_day_names_size
static QLocale system()
Returns a QLocale object initialized to the system locale.
static const ushort currency_display_name_data[]
quint16 m_standalone_narrow_month_names_size
static QString doubleToString(const QChar zero, const QChar plus, const QChar minus, const QChar exponent, const QChar group, const QChar decimal, double d, int precision, DoubleForm form, int width, unsigned flags)
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
QLocale & operator=(const QLocale &other)
Assigns other to this QLocale object and returns a reference to this QLocale object.
QStringList uiLanguages() const
Returns an ordered list of locale names for translation purposes in preference order.
static QString getLocaleData(const ushort *data, int size)
static void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Script &script, QLocale::Country &cntry)
static const ushort am_data[]
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
static QString unsLongLongToString(const QChar zero, const QChar group, const QChar plus, quint64 l, int precision, int base, int width, unsigned flags)
static const unsigned char language_code_list[]
void append(const T &t)
Inserts value at the end of the list.
int qt_repeatCount(const QString &s, int i)
The QTime class provides clock time functions.
QLocale::Language language
static QString longLongToString(const QChar zero, const QChar group, const QChar plus, const QChar minus, qint64 l, int precision, int base, int width, unsigned flags)
#define QT_BEGIN_NAMESPACE
This macro expands to.
quint64 stringToUnsLongLong(const QString &num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const
qlonglong toULongLong(const QString &s, bool *ok=0, int base=0) const
Returns the unsigned long long int represented by the localized string s, using base base...
quint16 m_standalone_short_day_names_size
static const ushort months_data[]
QString nativeLanguageName() const
Returns a native name of the language for the locale.
QLocale()
Constructs a QLocale object initialized with the default locale.
static QString getLocaleListData(const ushort *data, int size, int index)
QTime toTime(const QString &string, FormatType=LongFormat) const
Parses the time string given in string and returns the time.
QChar decimalPoint() const
Returns the decimal point character of this locale.
void truncate(int pos)
Truncates the string at the given position index.
QString qt_readEscapedFormatString(const QString &format, int *idx)
static bool timeFormatContainsAP(const QString &format)
static const int ImperialMeasurementSystemsCount
QString languageCode() const
double stringToDouble(const QString &num, bool *ok, GroupSeparatorMode group_sep_mode) const
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
QString dateTimeFormat(FormatType format=LongFormat) const
Returns the date time format used for the current locale.
QString quoteString(const QString &str, QuotationStyle style=StandardQuotation) const
Returns str quoted according to the current locale using the given quotation style.
QString toUpper(const QString &str) const
Returns an uppercase copy of str.
QChar groupSeparator() const
Returns the group separator character of this locale.
int size() const
Returns the number of characters in this string.
QString pmText() const
Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hou...
const QChar * unicode() const
Returns a '\0'-terminated Unicode representation of the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString scriptToString(Script script)
Returns a QString containing the name of script.
quint16 m_standalone_long_day_names_size
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
quint8 m_currency_negative_format_size
The QStringList class provides a list of strings.
static QString timeZone()
static const ushort currency_format_data[]
quint16 m_standalone_short_day_names_idx
short toShort(const QString &s, bool *ok=0, int base=0) const
Returns the short int represented by the localized string s, using base base.
QString toCurrencyString(qlonglong, const QString &symbol=QString()) const
Returns a localized string representation of value as a currency.
Q_CORE_EXPORT void qWarning(const char *,...)
int second() const
Returns the second part (0 to 59) of the time.
static const QLocalePrivate * findLocale(QLocale::Language language, QLocale::Script script, QLocale::Country country)
static const char * data(const QByteArray &arr)
QDataStream & operator<<(QDataStream &ds, const QLocale &l)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QChar fromLatin1(char c)
Converts the Latin-1 character c to its equivalent QChar.
static quint64 bytearrayToUnsLongLong(const char *num, int base, bool *ok)
static const quint16 country_name_index[]
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
quint16 m_long_time_format_size
QChar percent() const
Returns the percent character of this locale.
QString nativeCountryName() const
Returns a native name of the country for the locale.
int minute() const
Returns the minute part (0 to 59) of the time.
QDate toDate(const QString &string, FormatType=LongFormat) const
Parses the date string given in string and returns the date.
static uint default_number_options
QString toLower(const QString &str) const
Returns a lowercase copy of str.
quint16 m_standalone_narrow_month_names_idx
static QSystemLocale * _systemLocale
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
quint16 m_currency_symbol_idx
bool qt_initIcu(const QString &localeString)
quint16 m_narrow_day_names_size
static const char script_name_list[]
quint16 m_standalone_short_month_names_idx
static void setDefault(const QLocale &locale)
Sets the global default locale to locale.
QChar negativeSign() const
Returns the negative sign character of this locale.
quint8 m_currency_negative_format_idx
CurrencySymbolFormat
Specifies the format of the currency symbol.
static const ushort standalone_months_data[]
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
The QStringRef class provides a thin wrapper around QString substrings.
quint8 m_currency_format_idx
float toFloat(const QString &s, bool *ok=0) const
static const CountryLanguage ImperialMeasurementSystems[]
quint16 m_long_month_names_idx
quint16 m_currency_symbol_size
QString amText() const
Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hou...
QDataStream & operator>>(QDataStream &ds, QLocale &l)
QDate date() const
Returns the date part of the datetime.
QChar exponential() const
bool isNull() const
Returns true if this string is null; otherwise returns false.
quint16 m_short_time_format_idx
static const char country_name_list[]
static quint16 localePrivateIndex(const QLocalePrivate *p)
const QLocalePrivate * d() const
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static QLocale c()
Returns a QLocale object initialized to the "C" locale.
static char qToLower(char c)
quint16 m_narrow_day_names_idx
QString & append(QChar c)
static const ushort list_pattern_part_data[]
The QDateTime class provides date and time functions.
qlonglong toLongLong(const QString &s, bool *ok=0, int base=0) const
Returns the long long int represented by the localized string s, using base base. ...
double toDouble(const QString &s, bool *ok=0) const
Returns the double represented by the localized string s, or 0.0 if the conversion failed...
static QLocale::Script codeToScript(const QString &code)
static const ushort endonyms_data[]
quint16 m_long_date_format_idx
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
quint16 m_long_day_names_idx
static bool parse_locale_tag(const QString &input, int &i, QString *result, const QString &separators)
static QLocalePrivate * system_lp
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
int size() const
Returns the number of items in the list.
QString standaloneMonthName(int, FormatType format=LongFormat) const
Returns the localized name of month that is used as a standalone text, in the format specified by typ...
static const quint16 script_name_index[]
QString dateTimeToString(const QString &format, const QDate *date, const QTime *time, const QLocale *q) const
virtual QVariant query(QueryType type, QVariant in) const
Script script() const
Returns the script of this locale.
char toLatin1() const
Returns the Latin-1 character equivalent to the QChar, or 0.
virtual QLocale fallbackLocale() const
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
static QLocale::Country codeToCountry(const QString &code)
bool qt_u_strToUpper(const QString &str, QString *out, const QLocale &locale)
quint8 m_currency_format_size
static const QLocalePrivate * default_lp
static bool qt_is_inf(double d)
static const ushort days_data[]
Q_CORE_EXPORT QTextStream & scientific(QTextStream &s)
bool validateChars(const QString &str, NumberMode numMode, QByteArray *buff, int decDigits=-1) const
int year() const
Returns the year of this date.
static QSystemLocale * QSystemLocale_globalSystemLocale()
QString dayName(int, FormatType format=LongFormat) const
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on)...
static const QLocalePrivate locale_data[]
QString currencySymbol(CurrencySymbolFormat=CurrencySymbol) const
Returns a currency symbol according to the format.
int qstrcmp(const QByteArray &str1, const char *str2)
QTime time() const
Returns the time part of the datetime.
The QDataStream class provides serialization of binary data to a QIODevice.
Qt::DayOfWeek firstDayOfWeek() const
Returns the first day of the week according to the current locale.
static const ushort time_format_data[]
quint16 m_long_day_names_size
Country country() const
Returns the country of this locale.
int toInt(const QString &s, bool *ok=0, int base=0) const
Returns the int represented by the localized string s, using base base.
quint16 m_currency_digits
ushort toUShort(const QString &s, bool *ok=0, int base=0) const
Returns the unsigned short int represented by the localized string s, using base base.
quint16 m_short_date_format_idx
T value() const
Returns the stored value converted to the template type T.
QString dateFormat(FormatType format=LongFormat) const
Returns the date format used for the current locale.
quint16 m_currency_display_name_idx
void reserve(int size)
Attempts to allocate memory for at least size bytes.
bool fromString(const QString &text, QDate *date, QTime *time) const
static const KeyPair *const end
static QString languageToString(Language language)
Returns a QString containing the name of language.
QLocale::MeasurementSystem measurementSystem() const
static const quint16 language_name_index[]
QString & insert(int i, QChar c)
quint16 m_first_day_of_week
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
char m_currency_iso_code[3]
quint16 m_long_month_names_size
quint16 m_currency_display_name_size
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
MeasurementSystem measurementSystem() const
Returns the measurement system for the locale.
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
quint16 m_long_date_format_size
quint16 m_short_time_format_size
static const ushort date_format_data[]
static const quint16 locale_index[]
void clear()
Clears the contents of the byte array and makes it empty.
static const int locale_data_size
static bool qIsUpper(char c)
void reserve(int size)
Reserve space for alloc elements.
QString bcp47Name() const
Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this loc...
bool isValid() const
Returns true if the time is valid; otherwise returns false.
int hour() const
Returns the hour part (0 to 23) of the time.
The QList class is a template class that provides lists.
QString bcp47Name() const
QString standaloneDayName(int, FormatType format=LongFormat) const
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on) tha...
quint16 m_short_month_names_idx
QString countryCode() const