![]() |
Qt 6.x
The Qt SDK
|
#include <qlocale_p.h>
Classes | |
struct | DataRange |
struct | NumericData |
Public Types | |
enum | DoubleForm { DFExponent = 0 , DFDecimal , DFSignificantDigits , _DFMax = DFSignificantDigits } |
enum | Flags { NoFlags = 0 , AddTrailingZeroes = 0x01 , ZeroPadded = 0x02 , LeftAdjusted = 0x04 , BlankBeforePositive = 0x08 , AlwaysShowSign = 0x10 , GroupDigits = 0x20 , CapitalEorX = 0x40 , ShowBase = 0x80 , UppercaseBase = 0x100 , ZeroPadExponent = 0x200 , ForcePoint = 0x400 } |
enum | NumberMode { IntegerMode , DoubleStandardMode , DoubleScientificMode } |
Public Member Functions | |
QString | doubleToString (double d, int precision=-1, DoubleForm form=DFSignificantDigits, int width=-1, unsigned flags=NoFlags) const |
QString | longLongToString (qint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const |
QString | unsLongLongToString (quint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const |
double | stringToDouble (QStringView str, bool *ok, QLocale::NumberOptions options) const |
qint64 | stringToLongLong (QStringView str, int base, bool *ok, QLocale::NumberOptions options) const |
quint64 | stringToUnsLongLong (QStringView str, int base, bool *ok, QLocale::NumberOptions options) const |
bool | numberToCLocale (QStringView s, QLocale::NumberOptions number_options, NumberMode mode, CharBuff *result) const |
NumericData | numericData (NumberMode mode) const |
Q_CORE_EXPORT bool | validateChars (QStringView str, NumberMode numMode, QByteArray *buff, int decDigits=-1, QLocale::NumberOptions number_options=QLocale::DefaultNumberOptions) const |
QLocaleId | id () const |
QString | decimalPoint () const |
QString | groupSeparator () const |
QString | listSeparator () const |
QString | percentSign () const |
QString | zeroDigit () const |
char32_t | zeroUcs () const |
QString | positiveSign () const |
QString | negativeSign () const |
QString | exponentSeparator () const |
ForEachQLocaleRange (rangeIndex) ForEachQLocaleRange(Size) char m_currency_iso_code[3] | |
Static Public Member Functions | |
static qsizetype | findLocaleIndex (QLocaleId localeId) |
static const QLocaleData * | c () |
static float | convertDoubleToFloat (double d, bool *ok) |
static Q_CORE_EXPORT qint64 | bytearrayToLongLong (QByteArrayView num, int base, bool *ok) |
static quint64 | bytearrayToUnsLongLong (QByteArrayView num, int base, bool *ok) |
Public Attributes | |
quint8 | m_currency_digits: 2 |
quint8 | m_currency_rounding: 3 |
quint8 | m_first_day_of_week: 3 |
quint8 | m_weekend_start: 3 |
quint8 | m_weekend_end: 3 |
quint8 | m_grouping_top: 2 |
quint8 | m_grouping_higher: 3 |
quint8 | m_grouping_least: 3 |
Definition at line 217 of file qlocale_p.h.
Enumerator | |
---|---|
DFExponent | |
DFDecimal | |
DFSignificantDigits | |
_DFMax |
Definition at line 225 of file qlocale_p.h.
enum QLocaleData::Flags |
Enumerator | |
---|---|
NoFlags | |
AddTrailingZeroes | |
ZeroPadded | |
LeftAdjusted | |
BlankBeforePositive | |
AlwaysShowSign | |
GroupDigits | |
CapitalEorX | |
ShowBase | |
UppercaseBase | |
ZeroPadExponent | |
ForcePoint |
Definition at line 232 of file qlocale_p.h.
Enumerator | |
---|---|
IntegerMode | |
DoubleStandardMode | |
DoubleScientificMode |
Definition at line 248 of file qlocale_p.h.
|
static |
Definition at line 4352 of file qlocale.cpp.
References base, checkParsed(), ok, and qstrntoll().
Referenced by QIntValidator::fixup(), stringToLongLong(), toIntegral(), QtPrivate::toSignedInteger(), and QIntValidator::validate().
|
static |
Definition at line 4361 of file qlocale.cpp.
References base, checkParsed(), ok, and qstrntoull().
Referenced by stringToUnsLongLong(), toIntegral(), and QtPrivate::toUnsignedInteger().
|
static |
Definition at line 832 of file qlocale.cpp.
References QLocale::C, locale_data, locale_index, and Q_ASSERT.
Referenced by QString::arg(), QString::arg(), QString::arg(), numericData(), QSystemLocalePrivate::toCurrencyString(), validateChars(), and QString::vasprintf().
|
inlinestatic |
Definition at line 283 of file qlocale_p.h.
References d, ok, and qIsInf().
Referenced by QByteArray::toFloat(), QString::toFloat(), QStringView::toFloat(), QtPrivate::toFloat(), and QLocale::toFloat().
QString QLocaleData::decimalPoint | ( | ) | const |
Definition at line 920 of file qlocale.cpp.
References QSystemLocale::DecimalPoint, and localeString().
Referenced by QLocale::decimalPoint().
QString QLocaleData::doubleToString | ( | double | d, |
int | precision = -1 , |
||
DoubleForm | form = DFSignificantDigits , |
||
int | width = -1 , |
||
unsigned | flags = NoFlags |
||
) | const |
Definition at line 3546 of file qlocale.cpp.
References AddTrailingZeroes, QString::append(), CapitalEorX, ch, d, QGraphicsItem::data(), DFDecimal, DFExponent, DFSignificantDigits, digitCount(), digits(), QLocale::FloatingPointShortest, ForcePoint, form, QString::fromLatin1(), GroupDigits, QChar::highSurrogate(), i, QtMiscUtils::isAsciiDigit(), isZero(), LeftAdjusted, QChar::lowSurrogate(), m_grouping_higher, m_grouping_least, m_grouping_top, QString::prepend(), Q_ASSERT, qAbs(), qIsFinite(), qMax(), qstrncmp(), qt_doubleToAscii(), QChar::requiresSurrogates(), QString::reserve(), QString::size(), QChar::surrogateToUcs4(), unicodeForDigit(), wholePartSpace(), zero, zeroDigit(), ZeroPadded, and ZeroPadExponent.
Referenced by QString::arg(), QSystemLocalePrivate::toCurrencyString(), QLocale::toString(), and QString::vasprintf().
QString QLocaleData::exponentSeparator | ( | ) | const |
Definition at line 971 of file qlocale.cpp.
References single_character_data.
Referenced by QLocale::exponential().
Definition at line 485 of file qlocale.cpp.
References CheckCandidate, findLocaleIndexById(), QLocaleId::language_id, locale_index, QVarLengthArray< T, Prealloc >::push_back(), QLocaleId::script_id, QLocaleId::territory_id, and QLocaleId::withLikelySubtagsAdded().
Referenced by defaultIndex(), findLocalePrivate(), and Q_GLOBAL_STATIC().
QLocaleData::ForEachQLocaleRange | ( | rangeIndex | ) |
QString QLocaleData::groupSeparator | ( | ) | const |
Definition at line 925 of file qlocale.cpp.
References QSystemLocale::GroupSeparator, and localeString().
Referenced by QLocale::groupSeparator().
|
inline |
Definition at line 369 of file qlocale_p.h.
Referenced by QLocalePrivate::bcp47Name(), findLocaleIndexById(), QLocale::matchingLocales(), and QLocale::uiLanguages().
QString QLocaleData::listSeparator | ( | ) | const |
Definition at line 935 of file qlocale.cpp.
References single_character_data.
QString QLocaleData::longLongToString | ( | qint64 | l, |
int | precision = -1 , |
||
int | base = 10 , |
||
int | width = -1 , |
||
unsigned | flags = NoFlags |
||
) | const |
Definition at line 3785 of file qlocale.cpp.
References base, qulltoa(), and zeroDigit().
Referenced by QString::arg(), QTextStreamPrivate::putNumber(), QSystemLocalePrivate::toCurrencyString(), QLocale::toString(), and QString::vasprintf().
QString QLocaleData::negativeSign | ( | ) | const |
Definition at line 961 of file qlocale.cpp.
References localeString(), and QSystemLocale::NegativeSign.
Referenced by QLocale::negativeSign().
bool QLocaleData::numberToCLocale | ( | QStringView | s, |
QLocale::NumberOptions | number_options, | ||
NumberMode | mode, | ||
CharBuff * | result | ||
) | const |
Definition at line 4096 of file qlocale.cpp.
References IntegerMode, QtMiscUtils::isAsciiDigit(), m_grouping_higher, m_grouping_least, m_grouping_top, numericData(), out, Q_ASSERT, QLocale::RejectGroupSeparator, QLocale::RejectLeadingZeroInExponent, and QLocale::RejectTrailingZeroesAfterDot.
Referenced by stringToDouble(), stringToLongLong(), and stringToUnsLongLong().
|
inline |
Definition at line 3869 of file qlocale.cpp.
References c(), QLocale::CyrillicScript, QSystemLocale::DecimalPoint, DoubleScientificMode, getString(), QSystemLocale::GroupSeparator, IntegerMode, QSystemLocale::NegativeSign, QSystemLocale::PositiveSign, single_character_data, systemLocale(), systemLocaleData, zero, and QSystemLocale::ZeroDigit.
Referenced by numberToCLocale(), and validateChars().
QString QLocaleData::percentSign | ( | ) | const |
Definition at line 930 of file qlocale.cpp.
References single_character_data.
Referenced by QLocale::percent().
QString QLocaleData::positiveSign | ( | ) | const |
Definition at line 966 of file qlocale.cpp.
References localeString(), and QSystemLocale::PositiveSign.
Referenced by QLocale::positiveSign().
double QLocaleData::stringToDouble | ( | QStringView | str, |
bool * | ok, | ||
QLocale::NumberOptions | options | ||
) | const |
Definition at line 4293 of file qlocale.cpp.
References QVarLengthArray< T, Prealloc >::constData(), DoubleScientificMode, numberToCLocale(), ok, qt_asciiToDouble(), QVLABaseBase::size(), and str.
Referenced by QLocale::toDouble().
qlonglong QLocaleData::stringToLongLong | ( | QStringView | str, |
int | base, | ||
bool * | ok, | ||
QLocale::NumberOptions | options | ||
) | const |
Definition at line 4308 of file qlocale.cpp.
References base, bytearrayToLongLong(), QVarLengthArray< T, Prealloc >::constData(), IntegerMode, numberToCLocale(), ok, QVLABaseBase::size(), and str.
qulonglong QLocaleData::stringToUnsLongLong | ( | QStringView | str, |
int | base, | ||
bool * | ok, | ||
QLocale::NumberOptions | options | ||
) | const |
Definition at line 4321 of file qlocale.cpp.
References base, bytearrayToUnsLongLong(), QVarLengthArray< T, Prealloc >::constData(), IntegerMode, numberToCLocale(), ok, QVLABaseBase::size(), and str.
QString QLocaleData::unsLongLongToString | ( | quint64 | l, |
int | precision = -1 , |
||
int | base = 10 , |
||
int | width = -1 , |
||
unsigned | flags = NoFlags |
||
) | const |
Definition at line 3800 of file qlocale.cpp.
References base, QStringLiteral, qulltoa(), zero, and zeroDigit().
Referenced by QString::arg(), QTextStreamPrivate::putNumber(), QSystemLocalePrivate::toCurrencyString(), QLocale::toString(), and QString::vasprintf().
bool QLocaleData::validateChars | ( | QStringView | str, |
NumberMode | numMode, | ||
QByteArray * | buff, | ||
int | decDigits = -1 , |
||
QLocale::NumberOptions | number_options = QLocale::DefaultNumberOptions |
||
) | const |
Definition at line 4204 of file qlocale.cpp.
References QByteArray::append(), c(), QByteArray::clear(), DoubleScientificMode, IntegerMode, QtMiscUtils::isAsciiDigit(), numericData(), Q_ASSERT, QLocale::RejectGroupSeparator, QLocale::RejectLeadingZeroInExponent, QByteArray::reserve(), QString::size(), state, and str.
Referenced by QDoubleValidatorPrivate::fixupWithLocale(), and QDoubleValidatorPrivate::validateWithLocale().
QString QLocaleData::zeroDigit | ( | ) | const |
Definition at line 940 of file qlocale.cpp.
References localeString(), zero, and QSystemLocale::ZeroDigit.
Referenced by doubleToString(), longLongToString(), unsLongLongToString(), and QLocale::zeroDigit().
char32_t QLocaleData::zeroUcs | ( | ) | const |
Definition at line 945 of file qlocale.cpp.
References QString::at(), QString::isEmpty(), QChar::isHighSurrogate(), QChar::isSurrogate(), QSystemLocale::query(), single_character_data, QString::size(), QChar::surrogateToUcs4(), systemLocale(), systemLocaleData, text, QVariant::toString(), QChar::unicode(), zero, and QSystemLocale::ZeroDigit.
quint8 QLocaleData::m_currency_digits |
Definition at line 463 of file qlocale_p.h.
Referenced by QLocale::toCurrencyString().
quint8 QLocaleData::m_currency_rounding |
Definition at line 464 of file qlocale_p.h.
quint8 QLocaleData::m_first_day_of_week |
Definition at line 465 of file qlocale_p.h.
Referenced by QLocale::firstDayOfWeek().
quint8 QLocaleData::m_grouping_higher |
Definition at line 469 of file qlocale_p.h.
Referenced by doubleToString(), and numberToCLocale().
quint8 QLocaleData::m_grouping_least |
Definition at line 470 of file qlocale_p.h.
Referenced by doubleToString(), and numberToCLocale().
quint8 QLocaleData::m_grouping_top |
Definition at line 468 of file qlocale_p.h.
Referenced by doubleToString(), and numberToCLocale().
quint8 QLocaleData::m_weekend_end |
Definition at line 467 of file qlocale_p.h.
Referenced by QLocale::weekdays().
quint8 QLocaleData::m_weekend_start |
Definition at line 466 of file qlocale_p.h.
Referenced by QLocale::weekdays().