![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qlocale_p.h>
Classes | |
| struct | GroupSizes |
| struct | ParsingResult |
| struct | NumericData |
| class | DigitSequence |
| Descriptor for a digit sequence within a text. More... | |
| struct | DataRange |
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 } |
| using | CharBuff = QVarLengthArray<char, 256> |
Public Member Functions | |
| QString | doubleToString (double d, int precisionprecision=-1, DoubleForm form=DFSignificantDigits, int widthwidth=-1, unsigned flagsflags=NoFlags) const |
| QString | longLongToString (qint64 l, int precisionprecision=-1, int base=10, int widthwidth=-1, unsigned flagsflags=NoFlags) const |
| QString | unsLongLongToString (quint64 l, int precisionprecision=-1, int base=10, int widthwidth=-1, unsigned flagsflags=NoFlags) const |
| double | stringToDouble (QStringView str, bool *ok, QLocale::NumberOptions options) const |
| QSimpleParsedNumber< qint64 > | stringToLongLong (QStringView str, int base, QLocale::NumberOptions options) const |
| QSimpleParsedNumber< quint64 > | stringToUnsLongLong (QStringView str, int base, QLocale::NumberOptions options) const |
| bool | numberToCLocale (QStringView ss, QLocale::NumberOptions number_options, NumberMode modemode, CharBuff *resultresult) const |
| Returns a DigitSequence describing some portion of text starting at from. | |
| DigitSequence | digitSequence (QStringView text, DigitSequence::Options flagsflags=DigitSequence::Option::Default, qsizetype from=0, qsizetype maxDigits=-1) const |
| Q_CORE_EXPORT ParsingResult | validateChars (QStringView str, NumberMode numMode, 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 |
| Q_AUTOTEST_EXPORT char32_t | zeroUcs () const |
| QString | positiveSign () const |
| QString | negativeSign () const |
| QString | exponentSeparator () const |
| Q_CORE_EXPORT GroupSizes | groupSizes () const |
| ForEachQLocaleRange (rangeIndex) ForEachQLocaleRange(Size) char m_currency_iso_code[3] | |
Static Public Member Functions | |
| static Q_AUTOTEST_EXPORT qsizetype | findLocaleIndex (QLocaleId localeId) noexcept |
| static Q_AUTOTEST_EXPORT const QLocaleData * | c () noexcept |
| static Q_AUTOTEST_EXPORT bool | allLocaleDataRows (bool(*check)(qsizetype, const QLocaleData &)) |
| static Q_AUTOTEST_EXPORT const QLocaleData * | dataForLocaleIndex (qsizetype indexindex) |
| static float | convertDoubleToFloat (double d, bool *ok) |
| static Q_CORE_EXPORT QSimpleParsedNumber< qint64 > | bytearrayToLongLong (QByteArrayView numnum, int base) |
| static QSimpleParsedNumber< quint64 > | bytearrayToUnsLongLong (QByteArrayView numnum, int base) |
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_first: 2 |
| quint8 | m_grouping_higher: 3 |
| quint8 | m_grouping_least: 3 |
Definition at line 251 of file qlocale_p.h.
| using QLocaleData::CharBuff = QVarLengthArray<char, 256> |
Definition at line 296 of file qlocale_p.h.
| Enumerator | |
|---|---|
| DFExponent | |
| DFDecimal | |
| DFSignificantDigits | |
| _DFMax | |
Definition at line 263 of file qlocale_p.h.
| enum QLocaleData::Flags |
| Enumerator | |
|---|---|
| NoFlags | |
| AddTrailingZeroes | |
| ZeroPadded | |
| LeftAdjusted | |
| BlankBeforePositive | |
| AlwaysShowSign | |
| GroupDigits | |
| CapitalEorX | |
| ShowBase | |
| UppercaseBase | |
| ZeroPadExponent | |
| ForcePoint | |
Definition at line 270 of file qlocale_p.h.
| Enumerator | |
|---|---|
| IntegerMode | |
| DoubleStandardMode | |
| DoubleScientificMode | |
Definition at line 286 of file qlocale_p.h.
|
staticnodiscard |
Definition at line 526 of file qlocale.cpp.
|
staticnodiscard |
Definition at line 5171 of file qlocale.cpp.
|
staticnodiscard |
Definition at line 5179 of file qlocale.cpp.
|
staticnodiscardnoexcept |
Definition at line 941 of file qlocale.cpp.
References locale_data.
|
inlinestaticnodiscard |
Definition at line 344 of file qlocale_p.h.
Referenced by QByteArray::toFloat(), and QtPrivate::toFloat().
|
staticnodiscard |
Definition at line 536 of file qlocale.cpp.
References locale_data.
|
nodiscard |
Definition at line 1049 of file qlocale.cpp.
|
inlinenodiscard |
Definition at line 543 of file qlocale_p.h.
References IntegerMode.
|
nodiscard |
Definition at line 4050 of file qlocale.cpp.
References AddTrailingZeroes, CapitalEorX, DFDecimal, DFExponent, DFSignificantDigits, QLocaleData::GroupSizes::first, ForcePoint, GroupDigits, QLocaleData::GroupSizes::higher, QLocaleData::GroupSizes::least, LeftAdjusted, ZeroPadded, and ZeroPadExponent.
|
nodiscard |
Definition at line 1100 of file qlocale.cpp.
References single_character_data.
Definition at line 594 of file qlocale.cpp.
References QLocaleId::language_id, QLocaleId::script_id, QLocaleId::territory_id, and QLocaleId::withLikelySubtagsAdded().
| QLocaleData::ForEachQLocaleRange | ( | rangeIndex | ) |
|
nodiscard |
Definition at line 1054 of file qlocale.cpp.
|
nodiscard |
Definition at line 1105 of file qlocale.cpp.
References QLocaleData::GroupSizes::first, QLocaleData::GroupSizes::higher, and QLocaleData::GroupSizes::least.
|
inlinenodiscard |
Definition at line 554 of file qlocale_p.h.
Referenced by QLocalePrivate::bcp47Name().
|
nodiscard |
Definition at line 1064 of file qlocale.cpp.
References single_character_data.
|
nodiscard |
Definition at line 4293 of file qlocale.cpp.
|
nodiscard |
Definition at line 1090 of file qlocale.cpp.
|
nodiscard |
Returns a DigitSequence describing some portion of text starting at from.
QLocaleData::DigitSequence QLocaleData::digitSequence(QStringView text, QLocaleData::DigitSequence::Options, qsizetype from, qsizetype maxDigits)
As for the \l{QLocaleData::}{DigitSequence} constructor, supplying the \l{QLocaleData::}{NumericData} for this QLocaleData instance and the IntegerMode as the relevant argument to it.
If maxDigits is not passed, this will scan as many digits as it finds (after, where relevant, a sign) in a prefix of text and allocate space in which to store the results. If text is not known to be of sensible length for the data it is expected to contain, this may involve unbounded scanning and allocation. Callers should consider how many digits they can possibly have a use for and pass that, or a conservative upper-bound estimate of it, for maxDigits whenever they reasonably can.
If digits beyond that are technically acceptable (albeit useless), for example surplus digits in a fractional part, the caller can use a QStringIterator on text, starting at the return's endIndex(), and iterating as long as NumericData::digitValue() >= 0, to skip over the surplus. (You can also use digitValue() > 0 to resolve the case where a trailing 5 followed by 0s leaves open the possibility of an exact half in need of rounding according to the parity of the digit before the 5.)
Definition at line 4858 of file qlocale.cpp.
|
nodiscard |
Definition at line 1059 of file qlocale.cpp.
References single_character_data.
|
nodiscard |
Definition at line 1095 of file qlocale.cpp.
|
nodiscard |
Definition at line 5116 of file qlocale.cpp.
|
nodiscard |
Definition at line 5132 of file qlocale.cpp.
|
nodiscard |
Definition at line 5143 of file qlocale.cpp.
|
nodiscard |
Definition at line 4308 of file qlocale.cpp.
|
nodiscard |
Definition at line 5020 of file qlocale.cpp.
References QLocaleData::ParsingResult::Acceptable, DoubleScientificMode, IntegerMode, QLocaleData::ParsingResult::Intermediate, and QLocaleData::ParsingResult::state.
|
nodiscard |
Definition at line 1069 of file qlocale.cpp.
|
nodiscard |
Definition at line 1074 of file qlocale.cpp.
References single_character_data, and QLocaleData::DataRange::ucsFirst().
| quint8 QLocaleData::m_currency_digits |
Definition at line 663 of file qlocale_p.h.
| quint8 QLocaleData::m_currency_rounding |
Definition at line 664 of file qlocale_p.h.
| quint8 QLocaleData::m_first_day_of_week |
Definition at line 665 of file qlocale_p.h.
| quint8 QLocaleData::m_grouping_first |
Definition at line 668 of file qlocale_p.h.
| quint8 QLocaleData::m_grouping_higher |
Definition at line 669 of file qlocale_p.h.
| quint8 QLocaleData::m_grouping_least |
Definition at line 670 of file qlocale_p.h.
| quint8 QLocaleData::m_weekend_end |
Definition at line 667 of file qlocale_p.h.
| quint8 QLocaleData::m_weekend_start |
Definition at line 666 of file qlocale_p.h.