Qt 4.8
Public Types | Public Functions | Static Public Functions | Public Variables | List of all members
QLocalePrivate Struct Reference

#include <qlocale_p.h>

Public Types

typedef QVarLengthArray< char, 256 > CharBuff
 
enum  DoubleForm { DFExponent = 0, DFDecimal, DFSignificantDigits, _DFMax = DFSignificantDigits }
 
enum  Flags {
  NoFlags = 0, Alternate = 0x01, ZeroPadded = 0x02, LeftAdjusted = 0x04,
  BlankBeforePositive = 0x08, AlwaysShowSign = 0x10, ThousandsGroup = 0x20, CapitalEorX = 0x40,
  ShowBase = 0x80, UppercaseBase = 0x100, ForcePoint = Alternate
}
 
enum  GroupSeparatorMode { FailOnGroupSeparators, ParseGroupSeparators }
 
enum  NumberMode { IntegerMode, DoubleStandardMode, DoubleScientificMode }
 

Public Functions

QString bcp47Name () const
 
QString countryCode () const
 
quint16 countryId () const
 
QString dateTimeToString (const QString &format, const QDate *date, const QTime *time, const QLocale *q) const
 
QChar decimal () const
 
char digitToCLocale (const QChar &c) const
 
QString doubleToString (double d, int precision=-1, DoubleForm form=DFSignificantDigits, int width=-1, unsigned flags=NoFlags) const
 
QChar exponential () const
 
QChar group () const
 
QString languageCode () const
 
quint16 languageId () const
 
QChar list () const
 
QString longLongToString (qint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
 
QLocale::MeasurementSystem measurementSystem () const
 
QChar minus () const
 
bool numberToCLocale (const QString &num, GroupSeparatorMode group_sep_mode, CharBuff *result) const
 
QChar percent () const
 
QChar plus () const
 
QString scriptCode () const
 
double stringToDouble (const QString &num, bool *ok, GroupSeparatorMode group_sep_mode) const
 
qint64 stringToLongLong (const QString &num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const
 
quint64 stringToUnsLongLong (const QString &num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const
 
QString unsLongLongToString (quint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
 
bool validateChars (const QString &str, NumberMode numMode, QByteArray *buff, int decDigits=-1) const
 
QChar zero () const
 

Static Public Functions

static double bytearrayToDouble (const char *num, bool *ok, bool *overflow=0)
 
static qint64 bytearrayToLongLong (const char *num, int base, bool *ok, bool *overflow=0)
 
static quint64 bytearrayToUnsLongLong (const char *num, int base, bool *ok)
 
static QLocale::Country codeToCountry (const QString &code)
 
static QLocale::Language codeToLanguage (const QString &code)
 
static QLocale::Script codeToScript (const QString &code)
 
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)
 
static const QLocalePrivatefindLocale (QLocale::Language language, QLocale::Script script, QLocale::Country country)
 
static void getLangAndCountry (const QString &name, QLocale::Language &lang, QLocale::Script &script, QLocale::Country &cntry)
 
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)
 
static QString unsLongLongToString (const QChar zero, const QChar group, const QChar plus, quint64 l, int precision, int base, int width, unsigned flags)
 
static void updateSystemPrivate ()
 

Public Variables

quint16 m_alternate_quotation_end
 
quint16 m_alternate_quotation_start
 
quint16 m_am_idx
 
quint16 m_am_size
 
quint16 m_country_endonym_idx
 
quint16 m_country_endonym_size
 
quint16 m_country_id
 
quint16 m_currency_digits: 2
 
quint16 m_currency_display_name_idx
 
quint16 m_currency_display_name_size
 
quint8 m_currency_format_idx
 
quint8 m_currency_format_size
 
char m_currency_iso_code [3]
 
quint8 m_currency_negative_format_idx
 
quint8 m_currency_negative_format_size
 
quint16 m_currency_rounding: 3
 
quint16 m_currency_symbol_idx
 
quint16 m_currency_symbol_size
 
quint16 m_decimal
 
quint16 m_exponential
 
quint16 m_first_day_of_week: 3
 
quint16 m_group
 
quint16 m_language_endonym_idx
 
quint16 m_language_endonym_size
 
quint16 m_language_id
 
quint16 m_list
 
quint16 m_list_pattern_part_end_idx
 
quint16 m_list_pattern_part_end_size
 
quint16 m_list_pattern_part_mid_idx
 
quint16 m_list_pattern_part_mid_size
 
quint16 m_list_pattern_part_start_idx
 
quint16 m_list_pattern_part_start_size
 
quint16 m_list_pattern_part_two_idx
 
quint16 m_list_pattern_part_two_size
 
quint16 m_long_date_format_idx
 
quint16 m_long_date_format_size
 
quint16 m_long_day_names_idx
 
quint16 m_long_day_names_size
 
quint16 m_long_month_names_idx
 
quint16 m_long_month_names_size
 
quint16 m_long_time_format_idx
 
quint16 m_long_time_format_size
 
quint16 m_minus
 
quint16 m_narrow_day_names_idx
 
quint16 m_narrow_day_names_size
 
quint16 m_narrow_month_names_idx
 
quint16 m_narrow_month_names_size
 
quint16 m_percent
 
quint16 m_plus
 
quint16 m_pm_idx
 
quint16 m_pm_size
 
quint16 m_quotation_end
 
quint16 m_quotation_start
 
quint16 m_script_id
 
quint16 m_short_date_format_idx
 
quint16 m_short_date_format_size
 
quint16 m_short_day_names_idx
 
quint16 m_short_day_names_size
 
quint16 m_short_month_names_idx
 
quint16 m_short_month_names_size
 
quint16 m_short_time_format_idx
 
quint16 m_short_time_format_size
 
quint16 m_standalone_long_day_names_idx
 
quint16 m_standalone_long_day_names_size
 
quint16 m_standalone_long_month_names_idx
 
quint16 m_standalone_long_month_names_size
 
quint16 m_standalone_narrow_day_names_idx
 
quint16 m_standalone_narrow_day_names_size
 
quint16 m_standalone_narrow_month_names_idx
 
quint16 m_standalone_narrow_month_names_size
 
quint16 m_standalone_short_day_names_idx
 
quint16 m_standalone_short_day_names_size
 
quint16 m_standalone_short_month_names_idx
 
quint16 m_standalone_short_month_names_size
 
quint16 m_weekend_end: 3
 
quint16 m_weekend_start: 3
 
quint16 m_zero
 

Detailed Description

Definition at line 68 of file qlocale_p.h.

Typedefs

◆ CharBuff

Definition at line 166 of file qlocale_p.h.

Enumerations

◆ DoubleForm

Enumerator
DFExponent 
DFDecimal 
DFSignificantDigits 
_DFMax 

Definition at line 101 of file qlocale_p.h.

◆ Flags

Enumerator
NoFlags 
Alternate 
ZeroPadded 
LeftAdjusted 
BlankBeforePositive 
AlwaysShowSign 
ThousandsGroup 
CapitalEorX 
ShowBase 
UppercaseBase 
ForcePoint 

Definition at line 108 of file qlocale_p.h.

◆ GroupSeparatorMode

Enumerator
FailOnGroupSeparators 
ParseGroupSeparators 

Definition at line 123 of file qlocale_p.h.

◆ NumberMode

Enumerator
IntegerMode 
DoubleStandardMode 
DoubleScientificMode 

Definition at line 174 of file qlocale_p.h.

Functions

◆ bcp47Name()

QString QLocalePrivate::bcp47Name ( ) const

Definition at line 206 of file qlocale.cpp.

Referenced by QLocale::bcp47Name().

207 {
209  return QString();
210  if (m_language_id == QLocale::C)
211  return QLatin1String("C");
212  const unsigned char *lang = language_code_list + 3*(uint(m_language_id));
213  const unsigned char *script =
215  const unsigned char *country =
217  char len = (lang[2] != 0 ? 3 : 2) + (script ? 4+1 : 0) + (country ? (country[2] != 0 ? 3 : 2)+1 : 0);
219  QChar *uc = name.data();
220  *uc++ = ushort(lang[0]);
221  *uc++ = ushort(lang[1]);
222  if (lang[2] != 0)
223  *uc++ = ushort(lang[2]);
224  if (script) {
225  *uc++ = QLatin1Char('-');
226  *uc++ = ushort(script[0]);
227  *uc++ = ushort(script[1]);
228  *uc++ = ushort(script[2]);
229  *uc++ = ushort(script[3]);
230  }
231  if (country) {
232  *uc++ = QLatin1Char('-');
233  *uc++ = ushort(country[0]);
234  *uc++ = ushort(country[1]);
235  if (country[2] != 0)
236  *uc++ = ushort(country[2]);
237  }
238  return name;
239 }
quint16 m_language_id
Definition: qlocale_p.h:180
quint16 m_country_id
Definition: qlocale_p.h:180
static const unsigned char script_code_list[]
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const unsigned char country_code_list[]
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
static const unsigned char language_code_list[]
const char * name
unsigned int uint
Definition: qglobal.h:996
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
unsigned short ushort
Definition: qglobal.h:995
quint16 m_script_id
Definition: qlocale_p.h:180
QLocale::Country country
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ bytearrayToDouble()

double QLocalePrivate::bytearrayToDouble ( const char *  num,
bool *  ok,
bool *  overflow = 0 
)
static

Definition at line 3134 of file qlocale.cpp.

Referenced by QByteArray::toDouble(), and QDoubleValidatorPrivate::validateWithLocale().

3135 {
3136  if (ok != 0)
3137  *ok = true;
3138  if (overflow != 0)
3139  *overflow = false;
3140 
3141  if (*num == '\0') {
3142  if (ok != 0)
3143  *ok = false;
3144  return 0.0;
3145  }
3146 
3147  if (qstrcmp(num, "nan") == 0)
3148  return qt_snan();
3149 
3150  if (qstrcmp(num, "+inf") == 0 || qstrcmp(num, "inf") == 0)
3151  return qt_inf();
3152 
3153  if (qstrcmp(num, "-inf") == 0)
3154  return -qt_inf();
3155 
3156  bool _ok;
3157  const char *endptr;
3158  double d = qstrtod(num, &endptr, &_ok);
3159 
3160  if (!_ok) {
3161  // the only way strtod can fail with *endptr != '\0' on a non-empty
3162  // input string is overflow
3163  if (ok != 0)
3164  *ok = false;
3165  if (overflow != 0)
3166  *overflow = *endptr != '\0';
3167  return 0.0;
3168  }
3169 
3170  if (*endptr != '\0') {
3171  // we stopped at a non-digit character after converting some digits
3172  if (ok != 0)
3173  *ok = false;
3174  if (overflow != 0)
3175  *overflow = false;
3176  return 0.0;
3177  }
3178 
3179  if (ok != 0)
3180  *ok = true;
3181  if (overflow != 0)
3182  *overflow = false;
3183  return d;
3184 }
double d
Definition: qnumeric_p.h:62
Q_CORE_EXPORT double qstrtod(const char *s00, const char **se, bool *ok)
static double qt_snan()
Definition: qnumeric_p.h:80
static double qt_inf()
Definition: qnumeric_p.h:65
int qstrcmp(const QByteArray &str1, const char *str2)
Definition: qbytearray.cpp:336

◆ bytearrayToLongLong()

qlonglong QLocalePrivate::bytearrayToLongLong ( const char *  num,
int  base,
bool *  ok,
bool *  overflow = 0 
)
static

Definition at line 3186 of file qlocale.cpp.

Referenced by QIntValidator::fixup(), QByteArray::toLongLong(), and QIntValidator::validate().

3187 {
3188  bool _ok;
3189  const char *endptr;
3190 
3191  if (*num == '\0') {
3192  if (ok != 0)
3193  *ok = false;
3194  if (overflow != 0)
3195  *overflow = false;
3196  return 0;
3197  }
3198 
3199  qlonglong l = qstrtoll(num, &endptr, base, &_ok);
3200 
3201  if (!_ok) {
3202  if (ok != 0)
3203  *ok = false;
3204  if (overflow != 0) {
3205  // the only way qstrtoll can fail with *endptr != '\0' on a non-empty
3206  // input string is overflow
3207  *overflow = *endptr != '\0';
3208  }
3209  return 0;
3210  }
3211 
3212  if (*endptr != '\0') {
3213  // we stopped at a non-digit character after converting some digits
3214  if (ok != 0)
3215  *ok = false;
3216  if (overflow != 0)
3217  *overflow = false;
3218  return 0;
3219  }
3220 
3221  if (ok != 0)
3222  *ok = true;
3223  if (overflow != 0)
3224  *overflow = false;
3225  return l;
3226 }
static const uint base
Definition: qurl.cpp:268
qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok)
QFactoryLoader * l
qint64 qlonglong
Definition: qglobal.h:951

◆ bytearrayToUnsLongLong()

qulonglong QLocalePrivate::bytearrayToUnsLongLong ( const char *  num,
int  base,
bool *  ok 
)
static

Definition at line 3228 of file qlocale.cpp.

Referenced by QByteArray::toULongLong().

3229 {
3230  bool _ok;
3231  const char *endptr;
3232  qulonglong l = qstrtoull(num, &endptr, base, &_ok);
3233 
3234  if (!_ok || *endptr != '\0') {
3235  if (ok != 0)
3236  *ok = false;
3237  return 0;
3238  }
3239 
3240  if (ok != 0)
3241  *ok = true;
3242  return l;
3243 }
static const uint base
Definition: qurl.cpp:268
QFactoryLoader * l
qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok)
quint64 qulonglong
Definition: qglobal.h:952

◆ codeToCountry()

QLocale::Country QLocalePrivate::codeToCountry ( const QString code)
static

Definition at line 144 of file qlocale.cpp.

Referenced by getLangAndCountry().

145 {
146  int len = code.length();
147  if (len != 2 && len != 3)
148  return QLocale::AnyCountry;
149  ushort uc1 = len-- > 0 ? code[0].toUpper().unicode() : 0;
150  ushort uc2 = len-- > 0 ? code[1].toUpper().unicode() : 0;
151  ushort uc3 = len-- > 0 ? code[2].toUpper().unicode() : 0;
152 
153  const unsigned char *c = country_code_list;
154  for (; *c != 0; c += 3) {
155  if (uc1 == c[0] && uc2 == c[1] && uc3 == c[2])
156  return QLocale::Country((c - country_code_list)/3);
157  }
158 
159  return QLocale::AnyCountry;
160 }
unsigned char c[8]
Definition: qnumeric_p.h:62
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
static const unsigned char country_code_list[]
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
unsigned short ushort
Definition: qglobal.h:995

◆ codeToLanguage()

QLocale::Language QLocalePrivate::codeToLanguage ( const QString code)
static

Definition at line 103 of file qlocale.cpp.

Referenced by getLangAndCountry().

104 {
105  int len = code.length();
106  if (len != 2 && len != 3)
107  return QLocale::C;
108  ushort uc1 = len-- > 0 ? code[0].toLower().unicode() : 0;
109  ushort uc2 = len-- > 0 ? code[1].toLower().unicode() : 0;
110  ushort uc3 = len-- > 0 ? code[2].toLower().unicode() : 0;
111 
112  if (uc1 == 'n' && uc2 == 'o' && uc3 == 0)
113  uc2 = 'b';
114 
115  const unsigned char *c = language_code_list;
116  for (; *c != 0; c += 3) {
117  if (uc1 == c[0] && uc2 == c[1] && uc3 == c[2])
118  return QLocale::Language((c - language_code_list)/3);
119  }
120 
121  return QLocale::C;
122 }
unsigned char c[8]
Definition: qnumeric_p.h:62
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
static const unsigned char language_code_list[]
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
Language
Definition: qlocale.h:148
unsigned short ushort
Definition: qglobal.h:995
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389

◆ codeToScript()

QLocale::Script QLocalePrivate::codeToScript ( const QString code)
static

Definition at line 124 of file qlocale.cpp.

Referenced by getLangAndCountry().

125 {
126  int len = code.length();
127  if (len != 4)
128  return QLocale::AnyScript;
129 
130  // script is titlecased in our data
131  unsigned char c0 = code.at(0).toUpper().toLatin1();
132  unsigned char c1 = code.at(1).toLower().toLatin1();
133  unsigned char c2 = code.at(2).toLower().toLatin1();
134  unsigned char c3 = code.at(3).toLower().toLatin1();
135 
136  const unsigned char *c = script_code_list;
137  for (int i = 0; i < QLocale::LastScript; ++i, c += 4) {
138  if (c0 == c[0] && c1 == c[1] && c2 == c[2] && c3 == c[3])
139  return QLocale::Script(i);
140  }
141  return QLocale::AnyScript;
142 }
unsigned char c[8]
Definition: qnumeric_p.h:62
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
static const unsigned char script_code_list[]
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1287
char toLatin1() const
Returns the Latin-1 character equivalent to the QChar, or 0.
Definition: qchar.h:376
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1239

◆ countryCode()

QString QLocalePrivate::countryCode ( ) const

Definition at line 189 of file qlocale.cpp.

190 {
192  return QString();
193 
194  const unsigned char *c = country_code_list + 3*(uint(m_country_id));
195 
196  QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
197 
198  code[0] = ushort(c[0]);
199  code[1] = ushort(c[1]);
200  if (c[2] != 0)
201  code[2] = ushort(c[2]);
202 
203  return code;
204 }
unsigned char c[8]
Definition: qnumeric_p.h:62
quint16 m_country_id
Definition: qlocale_p.h:180
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const unsigned char country_code_list[]
unsigned int uint
Definition: qglobal.h:996
unsigned short ushort
Definition: qglobal.h:995

◆ countryId()

quint16 QLocalePrivate::countryId ( ) const
inline

Definition at line 81 of file qlocale_p.h.

Referenced by QLocale::countriesForLanguage().

81 { return m_country_id; }
quint16 m_country_id
Definition: qlocale_p.h:180

◆ dateTimeToString()

QString QLocalePrivate::dateTimeToString ( const QString format,
const QDate date,
const QTime time,
const QLocale q 
) const

Definition at line 2389 of file qlocale.cpp.

Referenced by QLocale::toString().

2391 {
2392  Q_ASSERT(date || time);
2393  if ((date && !date->isValid()) || (time && !time->isValid()))
2394  return QString();
2395  const bool format_am_pm = time && timeFormatContainsAP(format);
2396 
2397  enum { AM, PM } am_pm = AM;
2398  int hour12 = time ? time->hour() : -1;
2399  if (time) {
2400  if (hour12 == 0) {
2401  am_pm = AM;
2402  hour12 = 12;
2403  } else if (hour12 < 12) {
2404  am_pm = AM;
2405  } else if (hour12 == 12) {
2406  am_pm = PM;
2407  } else {
2408  am_pm = PM;
2409  hour12 -= 12;
2410  }
2411  }
2412 
2413  QString result;
2414 
2415  int i = 0;
2416  while (i < format.size()) {
2417  if (format.at(i).unicode() == '\'') {
2418  result.append(qt_readEscapedFormatString(format, &i));
2419  continue;
2420  }
2421 
2422  const QChar c = format.at(i);
2423  int repeat = qt_repeatCount(format, i);
2424  bool used = false;
2425  if (date) {
2426  switch (c.unicode()) {
2427  case 'y':
2428  used = true;
2429  if (repeat >= 4)
2430  repeat = 4;
2431  else if (repeat >= 2)
2432  repeat = 2;
2433 
2434  switch (repeat) {
2435  case 4:
2436  result.append(longLongToString(date->year()));
2437  break;
2438  case 2:
2439  result.append(longLongToString(date->year() % 100, -1, 10, 2,
2441  break;
2442  default:
2443  repeat = 1;
2444  result.append(c);
2445  break;
2446  }
2447  break;
2448 
2449  case 'M':
2450  used = true;
2451  repeat = qMin(repeat, 4);
2452  switch (repeat) {
2453  case 1:
2454  result.append(longLongToString(date->month()));
2455  break;
2456  case 2:
2457  result.append(longLongToString(date->month(), -1, 10, 2, QLocalePrivate::ZeroPadded));
2458  break;
2459  case 3:
2460  result.append(q->monthName(date->month(), QLocale::ShortFormat));
2461  break;
2462  case 4:
2463  result.append(q->monthName(date->month(), QLocale::LongFormat));
2464  break;
2465  }
2466  break;
2467 
2468  case 'd':
2469  used = true;
2470  repeat = qMin(repeat, 4);
2471  switch (repeat) {
2472  case 1:
2473  result.append(longLongToString(date->day()));
2474  break;
2475  case 2:
2476  result.append(longLongToString(date->day(), -1, 10, 2, QLocalePrivate::ZeroPadded));
2477  break;
2478  case 3:
2479  result.append(q->dayName(date->dayOfWeek(), QLocale::ShortFormat));
2480  break;
2481  case 4:
2482  result.append(q->dayName(date->dayOfWeek(), QLocale::LongFormat));
2483  break;
2484  }
2485  break;
2486 
2487  default:
2488  break;
2489  }
2490  }
2491  if (!used && time) {
2492  switch (c.unicode()) {
2493  case 'h': {
2494  used = true;
2495  repeat = qMin(repeat, 2);
2496  const int hour = format_am_pm ? hour12 : time->hour();
2497 
2498  switch (repeat) {
2499  case 1:
2500  result.append(longLongToString(hour));
2501  break;
2502  case 2:
2503  result.append(longLongToString(hour, -1, 10, 2, QLocalePrivate::ZeroPadded));
2504  break;
2505  }
2506  break;
2507  }
2508  case 'H':
2509  used = true;
2510  repeat = qMin(repeat, 2);
2511  switch (repeat) {
2512  case 1:
2513  result.append(longLongToString(time->hour()));
2514  break;
2515  case 2:
2516  result.append(longLongToString(time->hour(), -1, 10, 2, QLocalePrivate::ZeroPadded));
2517  break;
2518  }
2519  break;
2520 
2521  case 'm':
2522  used = true;
2523  repeat = qMin(repeat, 2);
2524  switch (repeat) {
2525  case 1:
2526  result.append(longLongToString(time->minute()));
2527  break;
2528  case 2:
2529  result.append(longLongToString(time->minute(), -1, 10, 2, QLocalePrivate::ZeroPadded));
2530  break;
2531  }
2532  break;
2533 
2534  case 's':
2535  used = true;
2536  repeat = qMin(repeat, 2);
2537  switch (repeat) {
2538  case 1:
2539  result.append(longLongToString(time->second()));
2540  break;
2541  case 2:
2542  result.append(longLongToString(time->second(), -1, 10, 2, QLocalePrivate::ZeroPadded));
2543  break;
2544  }
2545  break;
2546 
2547  case 'a':
2548  used = true;
2549  if (i + 1 < format.length() && format.at(i + 1).unicode() == 'p') {
2550  repeat = 2;
2551  } else {
2552  repeat = 1;
2553  }
2554  result.append(am_pm == AM ? q->amText().toLower() : q->pmText().toLower());
2555  break;
2556 
2557  case 'A':
2558  used = true;
2559  if (i + 1 < format.length() && format.at(i + 1).unicode() == 'P') {
2560  repeat = 2;
2561  } else {
2562  repeat = 1;
2563  }
2564  result.append(am_pm == AM ? q->amText().toUpper() : q->pmText().toUpper());
2565  break;
2566 
2567  case 'z':
2568  used = true;
2569  if (repeat >= 3) {
2570  repeat = 3;
2571  } else {
2572  repeat = 1;
2573  }
2574  switch (repeat) {
2575  case 1:
2576  result.append(longLongToString(time->msec()));
2577  break;
2578  case 3:
2579  result.append(longLongToString(time->msec(), -1, 10, 3, QLocalePrivate::ZeroPadded));
2580  break;
2581  }
2582  break;
2583 
2584  case 't':
2585  used = true;
2586  repeat = 1;
2587  result.append(timeZone());
2588  break;
2589  default:
2590  break;
2591  }
2592  }
2593  if (!used) {
2594  result.append(QString(repeat, c));
2595  }
2596  i += repeat;
2597  }
2598 
2599  return result;
2600 }
int dayOfWeek() const
Returns the weekday (1 = Monday to 7 = Sunday) for this date.
Definition: qdatetime.cpp:408
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
bool isValid() const
Returns true if this date is valid; otherwise returns false.
Definition: qdatetime.cpp:340
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
QString monthName(int, FormatType format=LongFormat) const
Returns the localized name of month, in the format specified by type.
Definition: qlocale.cpp:2007
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
Definition: qdatetime.cpp:382
int day() const
Returns the day of the month (1 to 31) of this date.
Definition: qdatetime.cpp:395
int msec() const
Returns the millisecond part (0 to 999) of the time.
Definition: qdatetime.cpp:1611
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
int qt_repeatCount(const QString &s, int i)
Definition: qlocale.cpp:421
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)
Definition: qlocale.cpp:2775
QString qt_readEscapedFormatString(const QString &format, int *idx)
Definition: qlocale.cpp:387
static bool timeFormatContainsAP(const QString &format)
Definition: qlocale.cpp:1354
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
QString pmText() const
Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hou...
Definition: qlocale.cpp:2376
static QString timeZone()
Definition: qlocale.cpp:1371
int second() const
Returns the second part (0 to 59) of the time.
Definition: qdatetime.cpp:1600
int minute() const
Returns the minute part (0 to 59) of the time.
Definition: qdatetime.cpp:1589
QString amText() const
Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hou...
Definition: qlocale.cpp:2353
QString & append(QChar c)
Definition: qstring.cpp:1777
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389
int year() const
Returns the year of this date.
Definition: qdatetime.cpp:353
QString dayName(int, FormatType format=LongFormat) const
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on)...
Definition: qlocale.cpp:2106
bool isValid() const
Returns true if the time is valid; otherwise returns false.
Definition: qdatetime.cpp:1566
int hour() const
Returns the hour part (0 to 23) of the time.
Definition: qdatetime.cpp:1578

◆ decimal()

QChar QLocalePrivate::decimal ( ) const
inline

Definition at line 71 of file qlocale_p.h.

Referenced by QLocale::decimalPoint().

71 { return QChar(m_decimal); }
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
quint16 m_decimal
Definition: qlocale_p.h:182

◆ digitToCLocale()

char QLocalePrivate::digitToCLocale ( const QChar c) const
inline

Definition at line 224 of file qlocale_p.h.

225 {
226  const QChar _zero = zero();
227  const QChar _group = group();
228  const ushort zeroUnicode = _zero.unicode();
229  const ushort tenUnicode = zeroUnicode + 10;
230 
231  if (in.unicode() >= zeroUnicode && in.unicode() < tenUnicode)
232  return '0' + in.unicode() - zeroUnicode;
233 
234  if (in.unicode() >= '0' && in.unicode() <= '9')
235  return in.toLatin1();
236 
237  if (in == plus())
238  return '+';
239 
240  if (in == minus())
241  return '-';
242 
243  if (in == decimal())
244  return '.';
245 
246  if (in == group())
247  return ',';
248 
249  if (in == exponential() || in == exponential().toUpper())
250  return 'e';
251 
252  // In several languages group() is the char 0xA0, which looks like a space.
253  // People use a regular space instead of it and complain it doesn't work.
254  if (_group.unicode() == 0xA0 && in.unicode() == ' ')
255  return ',';
256 
257  return 0;
258 }
QChar group() const
Definition: qlocale_p.h:72
QChar decimal() const
Definition: qlocale_p.h:71
QChar zero() const
Definition: qlocale_p.h:75
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
QChar plus() const
Definition: qlocale_p.h:76
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
QChar minus() const
Definition: qlocale_p.h:77
QChar exponential() const
Definition: qlocale_p.h:78
unsigned short ushort
Definition: qglobal.h:995

◆ doubleToString() [1/2]

QString QLocalePrivate::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 
)
static

Definition at line 2613 of file qlocale.cpp.

Referenced by QString::arg(), doubleToString(), QTextStream::operator<<(), QByteArray::setNum(), QString::setNum(), QSystemLocalePrivate::toCurrencyString(), QLocale::toCurrencyString(), QLocale::toString(), and QString::vsprintf().

2620 {
2621  if (precision == -1)
2622  precision = 6;
2623  if (width == -1)
2624  width = 0;
2625 
2626  bool negative = false;
2627  bool special_number = false; // nan, +/-inf
2628  QString num_str;
2629 
2630  // Detect special numbers (nan, +/-inf)
2631  if (qt_is_inf(d)) {
2632  num_str = QString::fromLatin1("inf");
2633  special_number = true;
2634  negative = d < 0;
2635  } else if (qt_is_nan(d)) {
2636  num_str = QString::fromLatin1("nan");
2637  special_number = true;
2638  }
2639 
2640  // Handle normal numbers
2641  if (!special_number) {
2642  int decpt, sign;
2643  QString digits;
2644 
2645 #ifdef QT_QLOCALE_USES_FCVT
2646  // NOT thread safe!
2647  if (form == DFDecimal) {
2648  digits = QLatin1String(fcvt(d, precision, &decpt, &sign));
2649  } else {
2650  int pr = precision;
2651  if (form == DFExponent)
2652  ++pr;
2653  else if (form == DFSignificantDigits && pr == 0)
2654  pr = 1;
2655  digits = QLatin1String(ecvt(d, pr, &decpt, &sign));
2656 
2657  // Chop trailing zeros
2658  if (digits.length() > 0) {
2659  int last_nonzero_idx = digits.length() - 1;
2660  while (last_nonzero_idx > 0
2661  && digits.unicode()[last_nonzero_idx] == QLatin1Char('0'))
2662  --last_nonzero_idx;
2663  digits.truncate(last_nonzero_idx + 1);
2664  }
2665 
2666  }
2667 
2668 #else
2669  int mode;
2670  if (form == DFDecimal)
2671  mode = 3;
2672  else
2673  mode = 2;
2674 
2675  /* This next bit is a bit quirky. In DFExponent form, the precision
2676  is the number of digits after decpt. So that would suggest using
2677  mode=3 for qdtoa. But qdtoa behaves strangely when mode=3 and
2678  precision=0. So we get around this by using mode=2 and reasoning
2679  that we want precision+1 significant digits, since the decimal
2680  point in this mode is always after the first digit. */
2681  int pr = precision;
2682  if (form == DFExponent)
2683  ++pr;
2684 
2685  char *rve = 0;
2686  char *buff = 0;
2687  QT_TRY {
2688  digits = QLatin1String(qdtoa(d, mode, pr, &decpt, &sign, &rve, &buff));
2689  } QT_CATCH(...) {
2690  if (buff != 0)
2691  free(buff);
2692  QT_RETHROW;
2693  }
2694  if (buff != 0)
2695  free(buff);
2696 #endif // QT_QLOCALE_USES_FCVT
2697 
2698  if (_zero.unicode() != '0') {
2699  ushort z = _zero.unicode() - '0';
2700  for (int i = 0; i < digits.length(); ++i)
2701  reinterpret_cast<ushort *>(digits.data())[i] += z;
2702  }
2703 
2704  bool always_show_decpt = (flags & Alternate || flags & ForcePoint);
2705  switch (form) {
2706  case DFExponent: {
2707  num_str = exponentForm(_zero, decimal, exponential, group, plus, minus,
2708  digits, decpt, precision, PMDecimalDigits,
2709  always_show_decpt);
2710  break;
2711  }
2712  case DFDecimal: {
2713  num_str = decimalForm(_zero, decimal, group,
2714  digits, decpt, precision, PMDecimalDigits,
2715  always_show_decpt, flags & ThousandsGroup);
2716  break;
2717  }
2718  case DFSignificantDigits: {
2719  PrecisionMode mode = (flags & Alternate) ?
2721 
2722  if (decpt != digits.length() && (decpt <= -4 || decpt > precision))
2723  num_str = exponentForm(_zero, decimal, exponential, group, plus, minus,
2724  digits, decpt, precision, mode,
2725  always_show_decpt);
2726  else
2727  num_str = decimalForm(_zero, decimal, group,
2728  digits, decpt, precision, mode,
2729  always_show_decpt, flags & ThousandsGroup);
2730  break;
2731  }
2732  }
2733 
2734  negative = sign != 0 && !isZero(d);
2735  }
2736 
2737  // pad with zeros. LeftAdjusted overrides this flag). Also, we don't
2738  // pad special numbers
2739  if (flags & QLocalePrivate::ZeroPadded
2740  && !(flags & QLocalePrivate::LeftAdjusted)
2741  && !special_number) {
2742  int num_pad_chars = width - num_str.length();
2743  // leave space for the sign
2744  if (negative
2747  --num_pad_chars;
2748 
2749  for (int i = 0; i < num_pad_chars; ++i)
2750  num_str.prepend(_zero);
2751  }
2752 
2753  // add sign
2754  if (negative)
2755  num_str.prepend(minus);
2756  else if (flags & QLocalePrivate::AlwaysShowSign)
2757  num_str.prepend(plus);
2758  else if (flags & QLocalePrivate::BlankBeforePositive)
2759  num_str.prepend(QLatin1Char(' '));
2760 
2761  if (flags & QLocalePrivate::CapitalEorX)
2762  num_str = num_str.toUpper();
2763 
2764  return num_str;
2765 }
double d
Definition: qnumeric_p.h:62
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QString & prepend(QChar c)
Definition: qstring.h:261
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
static bool qt_is_nan(double d)
Definition: qnumeric_p.h:183
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QString & exponentForm(QChar zero, QChar decimal, QChar exponential, QChar group, QChar plus, QChar minus, QString &digits, int decpt, uint precision, PrecisionMode pm, bool always_show_decpt)
The QString class provides a Unicode character string.
Definition: qstring.h:83
QChar * data()
Returns a pointer to the data stored in the QString.
Definition: qstring.h:710
static int sign(int x)
#define QT_RETHROW
Definition: qglobal.h:1539
void truncate(int pos)
Truncates the string at the given position index.
Definition: qstring.cpp:4603
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
#define QT_CATCH(A)
Definition: qglobal.h:1537
QChar exponential() const
Definition: qlocale_p.h:78
PrecisionMode
unsigned short ushort
Definition: qglobal.h:995
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static bool qt_is_inf(double d)
Definition: qnumeric_p.h:169
Q_CORE_EXPORT char * qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **resultp)
bool isZero(double d)
#define QT_TRY
Definition: qglobal.h:1536
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QString & decimalForm(QChar zero, QChar decimal, QChar group, QString &digits, int decpt, uint precision, PrecisionMode pm, bool always_show_decpt, bool thousands_group)

◆ doubleToString() [2/2]

QString QLocalePrivate::doubleToString ( double  d,
int  precision = -1,
DoubleForm  form = DFSignificantDigits,
int  width = -1,
unsigned  flags = NoFlags 
) const

Definition at line 2602 of file qlocale.cpp.

2607 {
2609  group(), decimal(),
2610  d, precision, form, width, flags);
2611 }
double d
Definition: qnumeric_p.h:62
QChar group() const
Definition: qlocale_p.h:72
QChar decimal() const
Definition: qlocale_p.h:71
QChar zero() const
Definition: qlocale_p.h:75
QChar plus() const
Definition: qlocale_p.h:76
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)
Definition: qlocale.cpp:2613
QChar minus() const
Definition: qlocale_p.h:77
QChar exponential() const
Definition: qlocale_p.h:78

◆ exponential()

QChar QLocalePrivate::exponential ( ) const
inline

Definition at line 78 of file qlocale_p.h.

Referenced by QLocale::exponential().

78 { return QChar(m_exponential); }
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
quint16 m_exponential
Definition: qlocale_p.h:182

◆ findLocale()

const QLocalePrivate * QLocalePrivate::findLocale ( QLocale::Language  language,
QLocale::Script  script,
QLocale::Country  country 
)
static

Definition at line 241 of file qlocale.cpp.

Referenced by findLocale(), and QLocale::QLocale().

242 {
243  const unsigned language_id = language;
244  const unsigned script_id = script;
245  const unsigned country_id = country;
246 
247  uint idx = locale_index[language_id];
248 
249  const QLocalePrivate *d = locale_data + idx;
250 
251  if (idx == 0) // default language has no associated country
252  return d;
253 
255  return d;
256 
257  Q_ASSERT(d->languageId() == language_id);
258 
259  if (country == QLocale::AnyCountry) {
260  while (d->m_language_id == language_id && d->m_script_id != script_id)
261  ++d;
262  if (d->m_language_id == language_id && d->m_script_id == script_id)
263  return d;
264  } else if (script == QLocale::AnyScript) {
265  while (d->m_language_id == language_id) {
266  if (d->m_script_id == script_id && d->m_country_id == country_id)
267  return d;
268  ++d;
269  }
270  } else {
271  // both script and country are explicitly specified
272  while (d->m_language_id == language_id) {
273  if (d->m_script_id == script_id && d->m_country_id == country_id)
274  return d;
275  ++d;
276  }
277  }
278 
279  return locale_data + idx;
280 }
double d
Definition: qnumeric_p.h:62
quint16 m_language_id
Definition: qlocale_p.h:180
quint16 m_country_id
Definition: qlocale_p.h:180
quint16 languageId() const
Definition: qlocale_p.h:80
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QLocale::Language language
unsigned int uint
Definition: qglobal.h:996
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
quint16 m_script_id
Definition: qlocale_p.h:180
static const QLocalePrivate locale_data[]
QLocale::Country country
static const quint16 locale_index[]

◆ getLangAndCountry()

void QLocalePrivate::getLangAndCountry ( const QString name,
QLocale::Language lang,
QLocale::Script script,
QLocale::Country cntry 
)
static

Definition at line 357 of file qlocale.cpp.

Referenced by findLocale(), and QSystemLocalePrivate::winToQtFormat().

359 {
360  lang = QLocale::C;
362  cntry = QLocale::AnyCountry;
363 
364  QString lang_code;
365  QString script_code;
366  QString cntry_code;
367  if (!qt_splitLocaleName(name, lang_code, script_code, cntry_code))
368  return;
369 
370  lang = QLocalePrivate::codeToLanguage(lang_code);
371  if (lang == QLocale::C)
372  return;
373  script = QLocalePrivate::codeToScript(script_code);
374  cntry = QLocalePrivate::codeToCountry(cntry_code);
375 }
static QLocale::Language codeToLanguage(const QString &code)
Definition: qlocale.cpp:103
bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QString &cntry)
Definition: qlocale.cpp:302
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
static QLocale::Script codeToScript(const QString &code)
Definition: qlocale.cpp:124
static QLocale::Country codeToCountry(const QString &code)
Definition: qlocale.cpp:144

◆ group()

QChar QLocalePrivate::group ( ) const
inline

Definition at line 72 of file qlocale_p.h.

Referenced by QLocale::groupSeparator().

72 { return QChar(m_group); }
quint16 m_group
Definition: qlocale_p.h:182
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72

◆ languageCode()

QString QLocalePrivate::languageCode ( ) const

Definition at line 162 of file qlocale.cpp.

163 {
165  return QString();
166  if (m_language_id == QLocale::C)
167  return QLatin1String("C");
168 
169  const unsigned char *c = language_code_list + 3*(uint(m_language_id));
170 
171  QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
172 
173  code[0] = ushort(c[0]);
174  code[1] = ushort(c[1]);
175  if (c[2] != 0)
176  code[2] = ushort(c[2]);
177 
178  return code;
179 }
quint16 m_language_id
Definition: qlocale_p.h:180
unsigned char c[8]
Definition: qnumeric_p.h:62
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const unsigned char language_code_list[]
unsigned int uint
Definition: qglobal.h:996
unsigned short ushort
Definition: qglobal.h:995

◆ languageId()

quint16 QLocalePrivate::languageId ( ) const
inline

Definition at line 80 of file qlocale_p.h.

Referenced by QLocale::countriesForLanguage(), findLocale(), and QLocale::QLocale().

80 { return m_language_id; }
quint16 m_language_id
Definition: qlocale_p.h:180

◆ list()

QChar QLocalePrivate::list ( ) const
inline

Definition at line 73 of file qlocale_p.h.

73 { return QChar(m_list); }
quint16 m_list
Definition: qlocale_p.h:182
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72

◆ longLongToString() [1/2]

QString QLocalePrivate::longLongToString ( const QChar  zero,
const QChar  group,
const QChar  plus,
const QChar  minus,
qint64  l,
int  precision,
int  base,
int  width,
unsigned  flags 
)
static

Definition at line 2775 of file qlocale.cpp.

Referenced by QString::arg(), exponentForm(), longLongToString(), QTextStreamPrivate::putNumber(), QByteArray::setNum(), QString::setNum(), QSystemLocalePrivate::toCurrencyString(), QLocale::toCurrencyString(), QLocale::toString(), and QString::vsprintf().

2780 {
2781  bool precision_not_specified = false;
2782  if (precision == -1) {
2783  precision_not_specified = true;
2784  precision = 1;
2785  }
2786 
2787  bool negative = l < 0;
2788  if (base != 10) {
2789  // these are not supported by sprintf for octal and hex
2790  flags &= ~AlwaysShowSign;
2791  flags &= ~BlankBeforePositive;
2792  negative = false; // neither are negative numbers
2793  }
2794 
2795  QString num_str;
2796  if (base == 10)
2797  num_str = qlltoa(l, base, zero);
2798  else
2799  num_str = qulltoa(l, base, zero);
2800 
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);
2805  ++cnt_thousand_sep;
2806  }
2807  }
2808 
2809  for (int i = num_str.length()/* - cnt_thousand_sep*/; i < precision; ++i)
2810  num_str.prepend(base == 10 ? zero : QChar::fromLatin1('0'));
2811 
2812  if ((flags & Alternate || flags & ShowBase)
2813  && base == 8
2814  && (num_str.isEmpty() || num_str[0].unicode() != QLatin1Char('0')))
2815  num_str.prepend(QLatin1Char('0'));
2816 
2817  // LeftAdjusted overrides this flag ZeroPadded. sprintf only padds
2818  // when precision is not specified in the format string
2819  bool zero_padded = flags & ZeroPadded
2820  && !(flags & LeftAdjusted)
2821  && precision_not_specified;
2822 
2823  if (zero_padded) {
2824  int num_pad_chars = width - num_str.length();
2825 
2826  // leave space for the sign
2827  if (negative
2828  || flags & AlwaysShowSign
2829  || flags & BlankBeforePositive)
2830  --num_pad_chars;
2831 
2832  // leave space for optional '0x' in hex form
2833  if (base == 16 && (flags & Alternate || flags & ShowBase))
2834  num_pad_chars -= 2;
2835  // leave space for optional '0b' in binary form
2836  else if (base == 2 && (flags & Alternate || flags & ShowBase))
2837  num_pad_chars -= 2;
2838 
2839  for (int i = 0; i < num_pad_chars; ++i)
2840  num_str.prepend(base == 10 ? zero : QChar::fromLatin1('0'));
2841  }
2842 
2843  if (flags & CapitalEorX)
2844  num_str = num_str.toUpper();
2845 
2846  if (base == 16 && (flags & Alternate || flags & ShowBase))
2847  num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x"));
2848  if (base == 2 && (flags & Alternate || flags & ShowBase))
2849  num_str.prepend(QLatin1String(flags & UppercaseBase ? "0B" : "0b"));
2850 
2851  // add sign
2852  if (negative)
2853  num_str.prepend(minus);
2854  else if (flags & AlwaysShowSign)
2855  num_str.prepend(plus);
2856  else if (flags & BlankBeforePositive)
2857  num_str.prepend(QLatin1Char(' '));
2858 
2859  return num_str;
2860 }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QString & prepend(QChar c)
Definition: qstring.h:261
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const uint base
Definition: qurl.cpp:268
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
unsigned int uint
Definition: qglobal.h:996
static QChar fromLatin1(char c)
Converts the Latin-1 character c to its equivalent QChar.
Definition: qchar.h:378
QFactoryLoader * l
QString qlltoa(qlonglong l, int base, const QChar zero)
QString qulltoa(qulonglong l, int base, const QChar _zero)
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ longLongToString() [2/2]

QString QLocalePrivate::longLongToString ( qint64  l,
int  precision = -1,
int  base = 10,
int  width = -1,
unsigned  flags = NoFlags 
) const

Definition at line 2767 of file qlocale.cpp.

2770 {
2772  l, precision, base, width, flags);
2773 }
QChar group() const
Definition: qlocale_p.h:72
QChar zero() const
Definition: qlocale_p.h:75
QChar plus() const
Definition: qlocale_p.h:76
static const uint base
Definition: qurl.cpp:268
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)
Definition: qlocale.cpp:2775
QChar minus() const
Definition: qlocale_p.h:77
QFactoryLoader * l

◆ measurementSystem()

QLocale::MeasurementSystem QLocalePrivate::measurementSystem ( ) const

Definition at line 2218 of file qlocale.cpp.

Referenced by QLocale::measurementSystem().

2219 {
2220  for (int i = 0; i < ImperialMeasurementSystemsCount; ++i) {
2223  return QLocale::ImperialSystem;
2224  }
2225  }
2226  return QLocale::MetricSystem;
2227 }
quint16 m_language_id
Definition: qlocale_p.h:180
quint16 m_country_id
Definition: qlocale_p.h:180
quint16 countryId() const
Definition: qlocale_p.h:81
quint16 languageId() const
Definition: qlocale_p.h:80
static const int ImperialMeasurementSystemsCount
static const CountryLanguage ImperialMeasurementSystems[]

◆ minus()

QChar QLocalePrivate::minus ( ) const
inline

Definition at line 77 of file qlocale_p.h.

Referenced by QLocale::negativeSign().

77 { return QChar(m_minus); }
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
quint16 m_minus
Definition: qlocale_p.h:182

◆ numberToCLocale()

bool QLocalePrivate::numberToCLocale ( const QString num,
GroupSeparatorMode  group_sep_mode,
CharBuff result 
) const

Definition at line 2945 of file qlocale.cpp.

2948 {
2949  const QChar *uc = num.unicode();
2950  int l = num.length();
2951  int idx = 0;
2952 
2953  // Skip whitespace
2954  while (idx < l && uc[idx].isSpace())
2955  ++idx;
2956  if (idx == l)
2957  return false;
2958 
2959  while (idx < l) {
2960  const QChar &in = uc[idx];
2961 
2962  char out = digitToCLocale(in);
2963  if (out == 0) {
2964  if (in == list())
2965  out = ';';
2966  else if (in == percent())
2967  out = '%';
2968  // for handling base-x numbers
2969  else if (in.unicode() >= 'A' && in.unicode() <= 'Z')
2970  out = in.toLower().toLatin1();
2971  else if (in.unicode() >= 'a' && in.unicode() <= 'z')
2972  out = in.toLatin1();
2973  else
2974  break;
2975  }
2976 
2977  result->append(out);
2978 
2979  ++idx;
2980  }
2981 
2982  // Check trailing whitespace
2983  for (; idx < l; ++idx) {
2984  if (!uc[idx].isSpace())
2985  return false;
2986  }
2987 
2988  result->append('\0');
2989 
2990  // Check separators
2991  if (group_sep_mode == ParseGroupSeparators
2992  && !removeGroupSeparators(result))
2993  return false;
2994 
2995 
2996  return true;
2997 }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
char digitToCLocale(const QChar &c) const
Definition: qlocale_p.h:224
QChar list() const
Definition: qlocale_p.h:73
QChar percent() const
Definition: qlocale_p.h:74
bool removeGroupSeparators(QLocalePrivate::CharBuff *num)
QFactoryLoader * l
char toLatin1() const
Returns the Latin-1 character equivalent to the QChar, or 0.
Definition: qchar.h:376
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1239

◆ percent()

QChar QLocalePrivate::percent ( ) const
inline

Definition at line 74 of file qlocale_p.h.

Referenced by QLocale::percent().

74 { return QChar(m_percent); }
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
quint16 m_percent
Definition: qlocale_p.h:182

◆ plus()

QChar QLocalePrivate::plus ( ) const
inline

Definition at line 76 of file qlocale_p.h.

Referenced by QLocale::positiveSign().

76 { return QChar(m_plus); }
quint16 m_plus
Definition: qlocale_p.h:182
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72

◆ scriptCode()

QString QLocalePrivate::scriptCode ( ) const

Definition at line 181 of file qlocale.cpp.

182 {
184  return QString();
185  const unsigned char *c = script_code_list + 4*(uint(m_script_id));
186  return QString::fromLatin1((const char *)c, 4);
187 }
unsigned char c[8]
Definition: qnumeric_p.h:62
static const unsigned char script_code_list[]
The QString class provides a Unicode character string.
Definition: qstring.h:83
unsigned int uint
Definition: qglobal.h:996
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
quint16 m_script_id
Definition: qlocale_p.h:180

◆ stringToDouble()

double QLocalePrivate::stringToDouble ( const QString num,
bool *  ok,
GroupSeparatorMode  group_sep_mode 
) const

Definition at line 3092 of file qlocale.cpp.

Referenced by QString::toDouble(), and QLocale::toDouble().

3094 {
3095  CharBuff buff;
3096  if (!numberToCLocale(group().unicode() == 0xa0 ? number.trimmed() : number,
3097  group_sep_mode, &buff)) {
3098  if (ok != 0)
3099  *ok = false;
3100  return 0.0;
3101  }
3102  return bytearrayToDouble(buff.constData(), ok);
3103 }
QChar group() const
Definition: qlocale_p.h:72
bool numberToCLocale(const QString &num, GroupSeparatorMode group_sep_mode, CharBuff *result) const
Definition: qlocale.cpp:2945
static double bytearrayToDouble(const char *num, bool *ok, bool *overflow=0)
Definition: qlocale.cpp:3134
QVarLengthArray< char, 256 > CharBuff
Definition: qlocale_p.h:166

◆ stringToLongLong()

qlonglong QLocalePrivate::stringToLongLong ( const QString num,
int  base,
bool *  ok,
GroupSeparatorMode  group_sep_mode 
) const

Definition at line 3105 of file qlocale.cpp.

Referenced by QString::toLongLong(), and QLocale::toLongLong().

3107 {
3108  CharBuff buff;
3109  if (!numberToCLocale(group().unicode() == 0xa0 ? number.trimmed() : number,
3110  group_sep_mode, &buff)) {
3111  if (ok != 0)
3112  *ok = false;
3113  return 0;
3114  }
3115 
3116  return bytearrayToLongLong(buff.constData(), base, ok);
3117 }
QChar group() const
Definition: qlocale_p.h:72
bool numberToCLocale(const QString &num, GroupSeparatorMode group_sep_mode, CharBuff *result) const
Definition: qlocale.cpp:2945
static qint64 bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow=0)
Definition: qlocale.cpp:3186
static const uint base
Definition: qurl.cpp:268
QVarLengthArray< char, 256 > CharBuff
Definition: qlocale_p.h:166

◆ stringToUnsLongLong()

qulonglong QLocalePrivate::stringToUnsLongLong ( const QString num,
int  base,
bool *  ok,
GroupSeparatorMode  group_sep_mode 
) const

Definition at line 3119 of file qlocale.cpp.

Referenced by QString::toULongLong(), and QLocale::toULongLong().

3121 {
3122  CharBuff buff;
3123  if (!numberToCLocale(group().unicode() == 0xa0 ? number.trimmed() : number,
3124  group_sep_mode, &buff)) {
3125  if (ok != 0)
3126  *ok = false;
3127  return 0;
3128  }
3129 
3130  return bytearrayToUnsLongLong(buff.constData(), base, ok);
3131 }
QChar group() const
Definition: qlocale_p.h:72
bool numberToCLocale(const QString &num, GroupSeparatorMode group_sep_mode, CharBuff *result) const
Definition: qlocale.cpp:2945
static const uint base
Definition: qurl.cpp:268
static quint64 bytearrayToUnsLongLong(const char *num, int base, bool *ok)
Definition: qlocale.cpp:3228
QVarLengthArray< char, 256 > CharBuff
Definition: qlocale_p.h:166

◆ unsLongLongToString() [1/2]

QString QLocalePrivate::unsLongLongToString ( const QChar  zero,
const QChar  group,
const QChar  plus,
quint64  l,
int  precision,
int  base,
int  width,
unsigned  flags 
)
static

Definition at line 2870 of file qlocale.cpp.

Referenced by QString::arg(), QTextStreamPrivate::putNumber(), QByteArray::setNum(), QString::setNum(), QSystemLocalePrivate::toCurrencyString(), QLocale::toCurrencyString(), QLocale::toString(), unsLongLongToString(), and QString::vsprintf().

2875 {
2876  bool precision_not_specified = false;
2877  if (precision == -1) {
2878  precision_not_specified = true;
2879  precision = 1;
2880  }
2881 
2882  QString num_str = qulltoa(l, base, zero);
2883 
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);
2888  ++cnt_thousand_sep;
2889  }
2890  }
2891 
2892  for (int i = num_str.length()/* - cnt_thousand_sep*/; i < precision; ++i)
2893  num_str.prepend(base == 10 ? zero : QChar::fromLatin1('0'));
2894 
2895  if ((flags & Alternate || flags & ShowBase)
2896  && base == 8
2897  && (num_str.isEmpty() || num_str[0].unicode() != QLatin1Char('0')))
2898  num_str.prepend(QLatin1Char('0'));
2899 
2900  // LeftAdjusted overrides this flag ZeroPadded. sprintf only padds
2901  // when precision is not specified in the format string
2902  bool zero_padded = flags & ZeroPadded
2903  && !(flags & LeftAdjusted)
2904  && precision_not_specified;
2905 
2906  if (zero_padded) {
2907  int num_pad_chars = width - num_str.length();
2908 
2909  // leave space for optional '0x' in hex form
2910  if (base == 16 && flags & Alternate)
2911  num_pad_chars -= 2;
2912  // leave space for optional '0b' in binary form
2913  else if (base == 2 && flags & Alternate)
2914  num_pad_chars -= 2;
2915 
2916  for (int i = 0; i < num_pad_chars; ++i)
2917  num_str.prepend(base == 10 ? zero : QChar::fromLatin1('0'));
2918  }
2919 
2920  if (flags & CapitalEorX)
2921  num_str = num_str.toUpper();
2922 
2923  if (base == 16 && (flags & Alternate || flags & ShowBase))
2924  num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x"));
2925  else if (base == 2 && (flags & Alternate || flags & ShowBase))
2926  num_str.prepend(QLatin1String(flags & UppercaseBase ? "0B" : "0b"));
2927 
2928  // add sign
2929  if (flags & AlwaysShowSign)
2930  num_str.prepend(plus);
2931  else if (flags & BlankBeforePositive)
2932  num_str.prepend(QLatin1Char(' '));
2933 
2934  return num_str;
2935 }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QString & prepend(QChar c)
Definition: qstring.h:261
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const uint base
Definition: qurl.cpp:268
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
unsigned int uint
Definition: qglobal.h:996
static QChar fromLatin1(char c)
Converts the Latin-1 character c to its equivalent QChar.
Definition: qchar.h:378
QFactoryLoader * l
QString qulltoa(qulonglong l, int base, const QChar _zero)
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ unsLongLongToString() [2/2]

QString QLocalePrivate::unsLongLongToString ( quint64  l,
int  precision = -1,
int  base = 10,
int  width = -1,
unsigned  flags = NoFlags 
) const

Definition at line 2862 of file qlocale.cpp.

2865 {
2867  l, precision, base, width, flags);
2868 }
QChar group() const
Definition: qlocale_p.h:72
QChar zero() const
Definition: qlocale_p.h:75
QChar plus() const
Definition: qlocale_p.h:76
static const uint base
Definition: qurl.cpp:268
static QString unsLongLongToString(const QChar zero, const QChar group, const QChar plus, quint64 l, int precision, int base, int width, unsigned flags)
Definition: qlocale.cpp:2870
QFactoryLoader * l

◆ updateSystemPrivate()

void QLocalePrivate::updateSystemPrivate ( )
static

Definition at line 478 of file qlocale.cpp.

Referenced by QWindowSystemInterface::handleLocaleChange(), QtWndProc(), and systemPrivate().

479 {
480  const QSystemLocale *sys_locale = systemLocale();
481  if (!system_lp)
482  system_lp = globalLocalePrivate();
483 
484  // tell the object that the system locale has changed.
486 
487  *system_lp = *sys_locale->fallbackLocale().d();
488 
489 #if defined(Q_OS_SYMBIAN)
490  qt_symbianUpdateSystemPrivate();
491 #endif
492 
493  QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant());
494  if (!res.isNull()) {
495  system_lp->m_language_id = res.toInt();
496  system_lp->m_script_id = QLocale::AnyScript; // default for compatibility
497  }
498  res = sys_locale->query(QSystemLocale::CountryId, QVariant());
499  if (!res.isNull()) {
500  system_lp->m_country_id = res.toInt();
501  system_lp->m_script_id = QLocale::AnyScript; // default for compatibility
502  }
503  res = sys_locale->query(QSystemLocale::ScriptId, QVariant());
504  if (!res.isNull())
505  system_lp->m_script_id = res.toInt();
506 
507  res = sys_locale->query(QSystemLocale::DecimalPoint, QVariant());
508  if (!res.isNull())
509  system_lp->m_decimal = res.toString().at(0).unicode();
510 
511  res = sys_locale->query(QSystemLocale::GroupSeparator, QVariant());
512  if (!res.isNull())
513  system_lp->m_group = res.toString().at(0).unicode();
514 
515  res = sys_locale->query(QSystemLocale::ZeroDigit, QVariant());
516  if (!res.isNull())
517  system_lp->m_zero = res.toString().at(0).unicode();
518 
519  res = sys_locale->query(QSystemLocale::NegativeSign, QVariant());
520  if (!res.isNull())
521  system_lp->m_minus = res.toString().at(0).unicode();
522 
523  res = sys_locale->query(QSystemLocale::PositiveSign, QVariant());
524  if (!res.isNull())
525  system_lp->m_plus = res.toString().at(0).unicode();
526 
527 #ifdef QT_USE_ICU
528  if (!default_lp)
530 #endif
531 
532 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
quint16 m_plus
Definition: qlocale_p.h:182
quint16 m_language_id
Definition: qlocale_p.h:180
quint16 m_country_id
Definition: qlocale_p.h:180
static const QSystemLocale * systemLocale()
Definition: qlocale.cpp:471
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
Definition: qvariant.cpp:3102
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
quint16 m_group
Definition: qlocale_p.h:182
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
quint16 m_zero
Definition: qlocale_p.h:182
bool qt_initIcu(const QString &localeString)
Definition: qlocale_icu.cpp:76
const QLocalePrivate * d() const
Definition: qlocale.cpp:761
static QLocalePrivate * system_lp
Definition: qlocale.cpp:85
quint16 m_script_id
Definition: qlocale_p.h:180
virtual QVariant query(QueryType type, QVariant in) const
virtual QLocale fallbackLocale() const
static const QLocalePrivate * default_lp
Definition: qlocale.cpp:430
quint16 m_decimal
Definition: qlocale_p.h:182
quint16 m_minus
Definition: qlocale_p.h:182
QString bcp47Name() const
Definition: qlocale.cpp:206

◆ validateChars()

bool QLocalePrivate::validateChars ( const QString str,
NumberMode  numMode,
QByteArray buff,
int  decDigits = -1 
) const

Definition at line 2999 of file qlocale.cpp.

Referenced by QIntValidator::fixup(), QIntValidator::validate(), and QDoubleValidatorPrivate::validateWithLocale().

3001 {
3002  buff->clear();
3003  buff->reserve(str.length());
3004 
3005  const bool scientific = numMode == DoubleScientificMode;
3006  bool lastWasE = false;
3007  bool lastWasDigit = false;
3008  int eCnt = 0;
3009  int decPointCnt = 0;
3010  bool dec = false;
3011  int decDigitCnt = 0;
3012 
3013  for (int i = 0; i < str.length(); ++i) {
3014  char c = digitToCLocale(str.at(i));
3015 
3016  if (c >= '0' && c <= '9') {
3017  if (numMode != IntegerMode) {
3018  // If a double has too many digits after decpt, it shall be Invalid.
3019  if (dec && decDigits != -1 && decDigits < ++decDigitCnt)
3020  return false;
3021  }
3022  lastWasDigit = true;
3023  } else {
3024  switch (c) {
3025  case '.':
3026  if (numMode == IntegerMode) {
3027  // If an integer has a decimal point, it shall be Invalid.
3028  return false;
3029  } else {
3030  // If a double has more than one decimal point, it shall be Invalid.
3031  if (++decPointCnt > 1)
3032  return false;
3033 #if 0
3034  // If a double with no decimal digits has a decimal point, it shall be
3035  // Invalid.
3036  if (decDigits == 0)
3037  return false;
3038 #endif // On second thoughts, it shall be Valid.
3039 
3040  dec = true;
3041  }
3042  break;
3043 
3044  case '+':
3045  case '-':
3046  if (scientific) {
3047  // If a scientific has a sign that's not at the beginning or after
3048  // an 'e', it shall be Invalid.
3049  if (i != 0 && !lastWasE)
3050  return false;
3051  } else {
3052  // If a non-scientific has a sign that's not at the beginning,
3053  // it shall be Invalid.
3054  if (i != 0)
3055  return false;
3056  }
3057  break;
3058 
3059  case ',':
3060  //it can only be placed after a digit which is before the decimal point
3061  if (!lastWasDigit || decPointCnt > 0)
3062  return false;
3063  break;
3064 
3065  case 'e':
3066  if (scientific) {
3067  // If a scientific has more than one 'e', it shall be Invalid.
3068  if (++eCnt > 1)
3069  return false;
3070  dec = false;
3071  } else {
3072  // If a non-scientific has an 'e', it shall be Invalid.
3073  return false;
3074  }
3075  break;
3076 
3077  default:
3078  // If it's not a valid digit, it shall be Invalid.
3079  return false;
3080  }
3081  lastWasDigit = false;
3082  }
3083 
3084  lastWasE = c == 'e';
3085  if (c != ',')
3086  buff->append(c);
3087  }
3088 
3089  return true;
3090 }
unsigned char c[8]
Definition: qnumeric_p.h:62
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
QByteArray & append(char c)
Appends the character ch to this byte array.
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
char digitToCLocale(const QChar &c) const
Definition: qlocale_p.h:224
Q_CORE_EXPORT QTextStream & scientific(QTextStream &s)
void reserve(int size)
Attempts to allocate memory for at least size bytes.
Definition: qbytearray.h:449
void clear()
Clears the contents of the byte array and makes it empty.

◆ zero()

QChar QLocalePrivate::zero ( ) const
inline

Definition at line 75 of file qlocale_p.h.

Referenced by QLocale::zeroDigit().

75 { return QChar(m_zero); }
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
quint16 m_zero
Definition: qlocale_p.h:182

Properties

◆ m_alternate_quotation_end

quint16 QLocalePrivate::m_alternate_quotation_end

Definition at line 185 of file qlocale_p.h.

◆ m_alternate_quotation_start

quint16 QLocalePrivate::m_alternate_quotation_start

Definition at line 185 of file qlocale_p.h.

◆ m_am_idx

quint16 QLocalePrivate::m_am_idx

Definition at line 207 of file qlocale_p.h.

◆ m_am_size

quint16 QLocalePrivate::m_am_size

Definition at line 207 of file qlocale_p.h.

◆ m_country_endonym_idx

quint16 QLocalePrivate::m_country_endonym_idx

Definition at line 215 of file qlocale_p.h.

◆ m_country_endonym_size

quint16 QLocalePrivate::m_country_endonym_size

Definition at line 215 of file qlocale_p.h.

◆ m_country_id

quint16 QLocalePrivate::m_country_id

Definition at line 180 of file qlocale_p.h.

Referenced by bcp47Name(), countryCode(), findLocale(), and QLocale::name().

◆ m_currency_digits

quint16 QLocalePrivate::m_currency_digits

Definition at line 216 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_display_name_idx

quint16 QLocalePrivate::m_currency_display_name_idx

Definition at line 211 of file qlocale_p.h.

Referenced by QLocale::currencySymbol().

◆ m_currency_display_name_size

quint16 QLocalePrivate::m_currency_display_name_size

Definition at line 211 of file qlocale_p.h.

Referenced by QLocale::currencySymbol().

◆ m_currency_format_idx

quint8 QLocalePrivate::m_currency_format_idx

Definition at line 212 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_format_size

quint8 QLocalePrivate::m_currency_format_size

Definition at line 212 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_iso_code

char QLocalePrivate::m_currency_iso_code[3]

Definition at line 209 of file qlocale_p.h.

Referenced by QLocale::currencySymbol().

◆ m_currency_negative_format_idx

quint8 QLocalePrivate::m_currency_negative_format_idx

Definition at line 213 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_negative_format_size

quint8 QLocalePrivate::m_currency_negative_format_size

Definition at line 213 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_rounding

quint16 QLocalePrivate::m_currency_rounding

Definition at line 217 of file qlocale_p.h.

◆ m_currency_symbol_idx

quint16 QLocalePrivate::m_currency_symbol_idx

Definition at line 210 of file qlocale_p.h.

Referenced by QLocale::currencySymbol().

◆ m_currency_symbol_size

quint16 QLocalePrivate::m_currency_symbol_size

Definition at line 210 of file qlocale_p.h.

Referenced by QLocale::currencySymbol().

◆ m_decimal

quint16 QLocalePrivate::m_decimal

Definition at line 182 of file qlocale_p.h.

◆ m_exponential

quint16 QLocalePrivate::m_exponential

Definition at line 182 of file qlocale_p.h.

◆ m_first_day_of_week

quint16 QLocalePrivate::m_first_day_of_week

Definition at line 218 of file qlocale_p.h.

Referenced by QLocale::firstDayOfWeek().

◆ m_group

quint16 QLocalePrivate::m_group

Definition at line 182 of file qlocale_p.h.

◆ m_language_endonym_idx

quint16 QLocalePrivate::m_language_endonym_idx

Definition at line 214 of file qlocale_p.h.

◆ m_language_endonym_size

quint16 QLocalePrivate::m_language_endonym_size

Definition at line 214 of file qlocale_p.h.

◆ m_language_id

quint16 QLocalePrivate::m_language_id

◆ m_list

quint16 QLocalePrivate::m_list

Definition at line 182 of file qlocale_p.h.

◆ m_list_pattern_part_end_idx

quint16 QLocalePrivate::m_list_pattern_part_end_idx

Definition at line 189 of file qlocale_p.h.

◆ m_list_pattern_part_end_size

quint16 QLocalePrivate::m_list_pattern_part_end_size

Definition at line 189 of file qlocale_p.h.

◆ m_list_pattern_part_mid_idx

quint16 QLocalePrivate::m_list_pattern_part_mid_idx

Definition at line 188 of file qlocale_p.h.

◆ m_list_pattern_part_mid_size

quint16 QLocalePrivate::m_list_pattern_part_mid_size

Definition at line 188 of file qlocale_p.h.

◆ m_list_pattern_part_start_idx

quint16 QLocalePrivate::m_list_pattern_part_start_idx

Definition at line 187 of file qlocale_p.h.

◆ m_list_pattern_part_start_size

quint16 QLocalePrivate::m_list_pattern_part_start_size

Definition at line 187 of file qlocale_p.h.

◆ m_list_pattern_part_two_idx

quint16 QLocalePrivate::m_list_pattern_part_two_idx

Definition at line 190 of file qlocale_p.h.

◆ m_list_pattern_part_two_size

quint16 QLocalePrivate::m_list_pattern_part_two_size

Definition at line 190 of file qlocale_p.h.

◆ m_long_date_format_idx

quint16 QLocalePrivate::m_long_date_format_idx

Definition at line 192 of file qlocale_p.h.

Referenced by QLocale::dateFormat().

◆ m_long_date_format_size

quint16 QLocalePrivate::m_long_date_format_size

Definition at line 192 of file qlocale_p.h.

Referenced by QLocale::dateFormat().

◆ m_long_day_names_idx

quint16 QLocalePrivate::m_long_day_names_idx

Definition at line 205 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_long_day_names_size

quint16 QLocalePrivate::m_long_day_names_size

Definition at line 205 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_long_month_names_idx

quint16 QLocalePrivate::m_long_month_names_idx

Definition at line 199 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_long_month_names_size

quint16 QLocalePrivate::m_long_month_names_size

Definition at line 199 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_long_time_format_idx

quint16 QLocalePrivate::m_long_time_format_idx

Definition at line 194 of file qlocale_p.h.

Referenced by QLocale::timeFormat().

◆ m_long_time_format_size

quint16 QLocalePrivate::m_long_time_format_size

Definition at line 194 of file qlocale_p.h.

Referenced by QLocale::timeFormat().

◆ m_minus

quint16 QLocalePrivate::m_minus

Definition at line 182 of file qlocale_p.h.

◆ m_narrow_day_names_idx

quint16 QLocalePrivate::m_narrow_day_names_idx

Definition at line 206 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_narrow_day_names_size

quint16 QLocalePrivate::m_narrow_day_names_size

Definition at line 206 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_narrow_month_names_idx

quint16 QLocalePrivate::m_narrow_month_names_idx

Definition at line 200 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_narrow_month_names_size

quint16 QLocalePrivate::m_narrow_month_names_size

Definition at line 200 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_percent

quint16 QLocalePrivate::m_percent

Definition at line 182 of file qlocale_p.h.

◆ m_plus

quint16 QLocalePrivate::m_plus

Definition at line 182 of file qlocale_p.h.

◆ m_pm_idx

quint16 QLocalePrivate::m_pm_idx

Definition at line 208 of file qlocale_p.h.

◆ m_pm_size

quint16 QLocalePrivate::m_pm_size

Definition at line 208 of file qlocale_p.h.

◆ m_quotation_end

quint16 QLocalePrivate::m_quotation_end

Definition at line 184 of file qlocale_p.h.

◆ m_quotation_start

quint16 QLocalePrivate::m_quotation_start

Definition at line 184 of file qlocale_p.h.

◆ m_script_id

quint16 QLocalePrivate::m_script_id

Definition at line 180 of file qlocale_p.h.

Referenced by bcp47Name(), findLocale(), and scriptCode().

◆ m_short_date_format_idx

quint16 QLocalePrivate::m_short_date_format_idx

Definition at line 191 of file qlocale_p.h.

Referenced by QLocale::dateFormat().

◆ m_short_date_format_size

quint16 QLocalePrivate::m_short_date_format_size

Definition at line 191 of file qlocale_p.h.

Referenced by QLocale::dateFormat().

◆ m_short_day_names_idx

quint16 QLocalePrivate::m_short_day_names_idx

Definition at line 204 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_short_day_names_size

quint16 QLocalePrivate::m_short_day_names_size

Definition at line 204 of file qlocale_p.h.

Referenced by QLocale::dayName().

◆ m_short_month_names_idx

quint16 QLocalePrivate::m_short_month_names_idx

Definition at line 198 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_short_month_names_size

quint16 QLocalePrivate::m_short_month_names_size

Definition at line 198 of file qlocale_p.h.

Referenced by QLocale::monthName().

◆ m_short_time_format_idx

quint16 QLocalePrivate::m_short_time_format_idx

Definition at line 193 of file qlocale_p.h.

Referenced by QLocale::timeFormat().

◆ m_short_time_format_size

quint16 QLocalePrivate::m_short_time_format_size

Definition at line 193 of file qlocale_p.h.

Referenced by QLocale::timeFormat().

◆ m_standalone_long_day_names_idx

quint16 QLocalePrivate::m_standalone_long_day_names_idx

Definition at line 202 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_long_day_names_size

quint16 QLocalePrivate::m_standalone_long_day_names_size

Definition at line 202 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_long_month_names_idx

quint16 QLocalePrivate::m_standalone_long_month_names_idx

Definition at line 196 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_standalone_long_month_names_size

quint16 QLocalePrivate::m_standalone_long_month_names_size

Definition at line 196 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_standalone_narrow_day_names_idx

quint16 QLocalePrivate::m_standalone_narrow_day_names_idx

Definition at line 203 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_narrow_day_names_size

quint16 QLocalePrivate::m_standalone_narrow_day_names_size

Definition at line 203 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_narrow_month_names_idx

quint16 QLocalePrivate::m_standalone_narrow_month_names_idx

Definition at line 197 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_standalone_narrow_month_names_size

quint16 QLocalePrivate::m_standalone_narrow_month_names_size

Definition at line 197 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_standalone_short_day_names_idx

quint16 QLocalePrivate::m_standalone_short_day_names_idx

Definition at line 201 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_short_day_names_size

quint16 QLocalePrivate::m_standalone_short_day_names_size

Definition at line 201 of file qlocale_p.h.

Referenced by QLocale::standaloneDayName().

◆ m_standalone_short_month_names_idx

quint16 QLocalePrivate::m_standalone_short_month_names_idx

Definition at line 195 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_standalone_short_month_names_size

quint16 QLocalePrivate::m_standalone_short_month_names_size

Definition at line 195 of file qlocale_p.h.

Referenced by QLocale::standaloneMonthName().

◆ m_weekend_end

quint16 QLocalePrivate::m_weekend_end

Definition at line 220 of file qlocale_p.h.

Referenced by QLocale::weekdays().

◆ m_weekend_start

quint16 QLocalePrivate::m_weekend_start

Definition at line 219 of file qlocale_p.h.

Referenced by QLocale::weekdays().

◆ m_zero

quint16 QLocalePrivate::m_zero

Definition at line 182 of file qlocale_p.h.


The documentation for this struct was generated from the following files: