55 #include <QtCore/private/qglobal_p.h>
56 #include "QtCore/qstring.h"
57 #include "QtCore/qvarlengtharray.h"
58 #include "QtCore/qvariant.h"
59 #include "QtCore/qnumeric.h"
60 #include <QtCore/qcalendar.h>
69 #ifndef QT_NO_SYSTEMLOCALE
134 StandaloneDayNameNarrow
138 virtual QLocale fallbackLocale()
const;
139 inline uint fallbackLocaleIndex()
const;
231 PMDecimalDigits = 0x01,
232 PMSignificantDigits = 0x02,
233 PMChopTrailingZeros = 0x03
237 PrecisionMode pm,
bool mustMarkDecimal,
238 bool groupDigits)
const;
240 PrecisionMode pm,
bool mustMarkDecimal,
241 int minExponentDigits)
const;
242 [[nodiscard]]
QString signPrefix(
bool negative,
unsigned flags)
const;
266 if (std::fabs(
d) > (std::numeric_limits<float>::max)()) {
269 const float huge = std::numeric_limits<float>::infinity();
272 if (
d != 0 &&
float(
d) == 0) {
282 QLocale::NumberOptions options)
const;
284 QLocale::NumberOptions options)
const;
286 QLocale::NumberOptions options)
const;
304 {
return QLocaleId { m_language_id, m_script_id, m_territory_id }; }
311 [[nodiscard]] char32_t
zeroUcs()
const;
349 const char16_t separator =
';';
363 #define ForEachQLocaleRange(X) \
364 X(startListPattern) X(midListPattern) X(endListPattern) X(pairListPattern) X(listDelimit) \
365 X(decimalSeparator) X(groupDelim) X(percent) X(zero) X(minus) X(plus) X(exponential) \
366 X(quoteStart) X(quoteEnd) X(quoteStartAlternate) X(quoteEndAlternate) \
367 X(longDateFormat) X(shortDateFormat) X(longTimeFormat) X(shortTimeFormat) \
368 X(longDayNamesStandalone) X(longDayNames) \
369 X(shortDayNamesStandalone) X(shortDayNames) \
370 X(narrowDayNamesStandalone) X(narrowDayNames) \
371 X(anteMeridiem) X(postMeridiem) \
372 X(byteCount) X(byteAmountSI) X(byteAmountIEC) \
373 X(currencySymbol) X(currencyDisplayName) \
374 X(currencyFormat) X(currencyFormatNegative) \
375 X(endonymLanguage) X(endonymTerritory)
377 #define rangeGetter(name) \
378 [[nodiscard]] DataRange name() const { return { m_ ## name ## _idx, m_ ## name ## _size }; }
383 quint16 m_language_id, m_script_id, m_territory_id;
386 #define rangeIndex(name) quint16 m_ ## name ## _idx;
389 #define Size(name) quint8 m_ ## name ## _size;
393 #undef ForEachQLocaleRange
396 char m_currency_iso_code[3];
454 #ifndef QT_NO_SYSTEMLOCALE
463 return new QLocalePrivate(d->m_data, d->m_index, d->m_numberOptions);
468 Q_ASSERT(
in.size() == 1 || (
in.size() == 2 &&
in.at(0).isHighSurrogate()));
493 const char32_t inUcs4 =
in.size() == 2
495 const char32_t zeroUcs4 =
zeroUcs();
497 if (zeroUcs4 ==
u'\u3007') {
499 if (inUcs4 == zeroUcs4)
501 if (inUcs4 >
u'\u3020' && inUcs4 <=
u'\u3029')
502 return inUcs4 -
u'\u3020';
503 }
else if (zeroUcs4 <= inUcs4 && inUcs4 < zeroUcs4 + 10) {
504 return '0' + inUcs4 - zeroUcs4;
506 if (
'0' <= inUcs4 && inUcs4 <=
'9')
524 (1u << (
'\r' - 1)) };
548 #ifndef QT_NO_SYSTEMLOCALE
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
The QByteArray class provides an array of bytes.
The QChar class provides a 16-bit Unicode character.
static constexpr char32_t surrogateToUcs4(char16_t high, char16_t low) noexcept
constexpr bool isSurrogate() const noexcept
constexpr bool isHighSurrogate() const noexcept
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
QLatin1String languageCode(QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode) const
quint16 languageId() const
static QLocale::Language codeToLanguage(QStringView code, QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode) noexcept
QLatin1String scriptCode() const
const QLocaleData *const m_data
QLocale::MeasurementSystem measurementSystem() const
static QBasicAtomicInt s_generation
quint16 territoryId() const
static QLatin1String territoryToCode(QLocale::Territory territory)
static QLocale::Territory codeToTerritory(QStringView code) noexcept
static const QLocalePrivate * get(const QLocale &l)
static QLocale::Script codeToScript(QStringView code) noexcept
QLocale::NumberOptions m_numberOptions
QLatin1String territoryCode() const
constexpr QLocalePrivate(const QLocaleData *data, const uint index, QLocale::NumberOptions numberOptions=QLocale::DefaultNumberOptions, int refs=0)
static QLatin1String scriptToCode(QLocale::Script script)
QByteArray bcp47Name(char separator='-') const
static QLatin1String languageToCode(QLocale::Language language, QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode)
The QString class provides a Unicode character string.
static QString fromRawData(const QChar *, qsizetype size)
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
@ StringToAlternateQuotation
@ StandaloneMonthNameLong
@ StandaloneMonthNameNarrow
@ StringToStandardQuotation
@ StandaloneMonthNameShort
virtual QLocale fallbackLocale() const
uint fallbackLocaleIndex() const
The QVariant class acts like a union for the most common Qt data types.
std::string toLower(std::string const &s)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
EGLOutputLayerEXT EGLint EGLAttrib value
bool qIsInf(qfloat16 f) noexcept
QT_BEGIN_INCLUDE_NAMESPACE typedef unsigned char uchar
unsigned long long quint64
QString qt_readEscapedFormatString(QStringView format, int *idx)
bool qt_splitLocaleName(QStringView name, QStringView *lang=nullptr, QStringView *script=nullptr, QStringView *cntry=nullptr)
Q_DECLARE_TYPEINFO(QSystemLocale::QueryType, Q_PRIMITIVE_TYPE)
#define rangeGetter(name)
constexpr bool ascii_isspace(uchar c)
int qt_repeatCount(QStringView s)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLsizei void * table
GLenum GLint GLint * precision
char32_t ucsFirst(const char16_t *table) const
QStringView viewListEntry(const char16_t *table, int index) const
QString getData(const char16_t *table) const
QStringView viewData(const char16_t *table) const
QString getListEntry(const char16_t *table, int index) const
static quint64 bytearrayToUnsLongLong(QByteArrayView num, int base, bool *ok)
QString positiveSign() const
static float convertDoubleToFloat(double d, bool *ok)
QString groupSeparator() const
QString zeroDigit() const
QString decimalPoint() const
QString doubleToString(double d, int precision=-1, DoubleForm form=DFSignificantDigits, int width=-1, unsigned flags=NoFlags) const
static const QLocaleData * c()
QVarLengthArray< char, 256 > CharBuff
QString listSeparator() const
quint64 stringToUnsLongLong(QStringView str, int base, bool *ok, QLocale::NumberOptions options) const
qint64 stringToLongLong(QStringView str, int base, bool *ok, QLocale::NumberOptions options) const
QString percentSign() const
bool numberToCLocale(QStringView s, QLocale::NumberOptions number_options, CharBuff *result) const
Q_CORE_EXPORT bool validateChars(QStringView str, NumberMode numMode, QByteArray *buff, int decDigits=-1, QLocale::NumberOptions number_options=QLocale::DefaultNumberOptions) const
ForEachQLocaleRange(rangeIndex) ForEachQLocaleRange(Size) char m_currency_iso_code[3]
double stringToDouble(QStringView str, bool *ok, QLocale::NumberOptions options) const
QString longLongToString(qint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
quint8 m_first_day_of_week
char numericToCLocale(QStringView in) const
quint8 m_currency_rounding
QString exponentSeparator() const
QString negativeSign() const
static Q_CORE_EXPORT qint64 bytearrayToLongLong(QByteArrayView num, int base, bool *ok)
QString unsLongLongToString(quint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
static int findLocaleIndex(QLocaleId localeId)
bool operator==(QLocaleId other) const
QLocaleId withLikelySubtagsRemoved() const
bool operator!=(QLocaleId other) const
bool acceptLanguage(quint16 lang) const
bool acceptScriptTerritory(QLocaleId other) const
QLocaleId withLikelySubtagsAdded() const
QByteArray name(char separator='-') const
static QLocaleId fromName(QStringView name)
CurrencyToStringArgument(const QVariant &v, const QString &s)
CurrencyToStringArgument()