Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QLocaleData Struct Reference

#include <qlocale_p.h>

+ Collaboration diagram for QLocaleData:

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
 
QSimpleParsedNumber< qint64stringToLongLong (QStringView str, int base, QLocale::NumberOptions options) const
 
QSimpleParsedNumber< quint64stringToUnsLongLong (QStringView str, int base, 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 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
 
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 QLocaleDatac ()
 
static float convertDoubleToFloat (double d, bool *ok)
 
static Q_CORE_EXPORT QSimpleParsedNumber< qint64bytearrayToLongLong (QByteArrayView num, int base)
 
static QSimpleParsedNumber< quint64bytearrayToUnsLongLong (QByteArrayView num, 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_top: 2
 
quint8 m_grouping_higher: 3
 
quint8 m_grouping_least: 3
 

Detailed Description

Definition at line 242 of file qlocale_p.h.

Member Enumeration Documentation

◆ DoubleForm

Enumerator
DFExponent 
DFDecimal 
DFSignificantDigits 
_DFMax 

Definition at line 250 of file qlocale_p.h.

◆ Flags

Enumerator
NoFlags 
AddTrailingZeroes 
ZeroPadded 
LeftAdjusted 
BlankBeforePositive 
AlwaysShowSign 
GroupDigits 
CapitalEorX 
ShowBase 
UppercaseBase 
ZeroPadExponent 
ForcePoint 

Definition at line 257 of file qlocale_p.h.

◆ NumberMode

Enumerator
IntegerMode 
DoubleStandardMode 
DoubleScientificMode 

Definition at line 273 of file qlocale_p.h.

Member Function Documentation

◆ bytearrayToLongLong()

QSimpleParsedNumber< qint64 > QLocaleData::bytearrayToLongLong ( QByteArrayView num,
int base )
static

Definition at line 4516 of file qlocale.cpp.

References base, checkParsed(), and qstrntoll().

Referenced by QIntValidator::fixup(), toIntegral(), QtPrivate::toSignedInteger(), and QIntValidator::validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bytearrayToUnsLongLong()

QSimpleParsedNumber< quint64 > QLocaleData::bytearrayToUnsLongLong ( QByteArrayView num,
int base )
static

Definition at line 4524 of file qlocale.cpp.

References base, checkParsed(), and qstrntoull().

Referenced by toIntegral(), and QtPrivate::toUnsignedInteger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ c()

const QLocaleData * QLocaleData::c ( )
static

Definition at line 856 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(), and QString::vasprintf().

+ Here is the caller graph for this function:

◆ convertDoubleToFloat()

static float QLocaleData::convertDoubleToFloat ( double d,
bool * ok )
inlinestatic

Definition at line 309 of file qlocale_p.h.

References d, and ok.

Referenced by QByteArray::toFloat(), QString::toFloat(), QStringView::toFloat(), QtPrivate::toFloat(), and QLocale::toFloat().

+ Here is the caller graph for this function:

◆ decimalPoint()

QString QLocaleData::decimalPoint ( ) const

Definition at line 943 of file qlocale.cpp.

References QSystemLocale::DecimalPoint, and localeString().

Referenced by QLocale::decimalPoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doubleToString()

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

Definition at line 3706 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, i, QtMiscUtils::isAsciiDigit(), isZero(), LeftAdjusted, m_grouping_higher, m_grouping_least, m_grouping_top, Q_ASSERT, qAbs(), qMax(), qstrncmp(), qt_doubleToAscii(), qt_is_finite(), QString::reserve(), QString::size(), unicodeForDigit(), wholePartSpace(), zero, zeroDigit(), ZeroPadded, and ZeroPadExponent.

Referenced by QLocale::toString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exponentSeparator()

QString QLocaleData::exponentSeparator ( ) const

Definition at line 994 of file qlocale.cpp.

References single_character_data.

Referenced by QLocale::exponential().

+ Here is the caller graph for this function:

◆ findLocaleIndex()

qsizetype QLocaleData::findLocaleIndex ( QLocaleId localeId)
static

Definition at line 487 of file qlocale.cpp.

References CheckCandidate, findLocaleIndexById(), QLocaleId::language_id, locale_index, and QLocaleId::withLikelySubtagsAdded().

Referenced by defaultIndex(), findLocalePrivate(), Q_GLOBAL_STATIC(), and systemData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForEachQLocaleRange()

QLocaleData::ForEachQLocaleRange ( rangeIndex )

◆ groupSeparator()

QString QLocaleData::groupSeparator ( ) const

Definition at line 948 of file qlocale.cpp.

References QSystemLocale::GroupSeparator, and localeString().

Referenced by QLocale::groupSeparator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ id()

QLocaleId QLocaleData::id ( ) const
inline

Definition at line 386 of file qlocale_p.h.

Referenced by QLocalePrivate::bcp47Name().

+ Here is the caller graph for this function:

◆ listSeparator()

QString QLocaleData::listSeparator ( ) const

Definition at line 958 of file qlocale.cpp.

References single_character_data.

◆ longLongToString()

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

Definition at line 3945 of file qlocale.cpp.

References base, qulltoa(), and zeroDigit().

Referenced by QTextStreamPrivate::putNumber(), and QLocale::toString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ negativeSign()

QString QLocaleData::negativeSign ( ) const

Definition at line 984 of file qlocale.cpp.

References localeString(), and QSystemLocale::NegativeSign.

Referenced by QLocale::negativeSign().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numberToCLocale()

bool QLocaleData::numberToCLocale ( QStringView s,
QLocale::NumberOptions number_options,
NumberMode mode,
CharBuff * result ) const

Definition at line 4256 of file qlocale.cpp.

References QtMiscUtils::isAsciiDigit(), out, Q_ASSERT, QLocale::RejectGroupSeparator, QLocale::RejectLeadingZeroInExponent, and QLocale::RejectTrailingZeroesAfterDot.

+ Here is the call graph for this function:

◆ numericData()

QLocaleData::NumericData QLocaleData::numericData ( QLocaleData::NumberMode mode) const
inline

Definition at line 4029 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.

+ Here is the call graph for this function:

◆ percentSign()

QString QLocaleData::percentSign ( ) const

Definition at line 953 of file qlocale.cpp.

References single_character_data.

Referenced by QLocale::percent().

+ Here is the caller graph for this function:

◆ positiveSign()

QString QLocaleData::positiveSign ( ) const

Definition at line 989 of file qlocale.cpp.

References localeString(), and QSystemLocale::PositiveSign.

Referenced by QLocale::positiveSign().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringToDouble()

double QLocaleData::stringToDouble ( QStringView str,
bool * ok,
QLocale::NumberOptions options ) const

Definition at line 4461 of file qlocale.cpp.

References QVarLengthArray< T, Prealloc >::constData(), ok, qt_asciiToDouble(), QVLABaseBase::size(), and str.

Referenced by QLocale::toDouble().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringToLongLong()

QSimpleParsedNumber< qint64 > QLocaleData::stringToLongLong ( QStringView str,
int base,
QLocale::NumberOptions options ) const

Definition at line 4477 of file qlocale.cpp.

References base, and str.

◆ stringToUnsLongLong()

QSimpleParsedNumber< quint64 > QLocaleData::stringToUnsLongLong ( QStringView str,
int base,
QLocale::NumberOptions options ) const

Definition at line 4488 of file qlocale.cpp.

References base, and str.

◆ unsLongLongToString()

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

Definition at line 3960 of file qlocale.cpp.

References base, QStringLiteral, qulltoa(), zero, and zeroDigit().

Referenced by QTextStreamPrivate::putNumber(), and QLocale::toString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validateChars()

ParsingResult QLocaleData::validateChars ( QStringView str,
NumberMode numMode,
int decDigits = -1,
QLocale::NumberOptions number_options = QLocale::DefaultNumberOptions ) const

Definition at line 4365 of file qlocale.cpp.

References ParsingResult::Acceptable, ParsingResult::Intermediate, QtMiscUtils::isAsciiDigit(), Q_ASSERT, QLocale::RejectGroupSeparator, QLocale::RejectLeadingZeroInExponent, QString::size(), state, and str.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zeroDigit()

QString QLocaleData::zeroDigit ( ) const

Definition at line 963 of file qlocale.cpp.

References localeString(), zero, and QSystemLocale::ZeroDigit.

Referenced by doubleToString(), longLongToString(), unsLongLongToString(), and QLocale::zeroDigit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zeroUcs()

char32_t QLocaleData::zeroUcs ( ) const

Definition at line 968 of file qlocale.cpp.

References QString::at(), QString::isEmpty(), single_character_data, QString::size(), systemLocale(), systemLocaleData, text, zero, and QSystemLocale::ZeroDigit.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_currency_digits

quint8 QLocaleData::m_currency_digits

Definition at line 480 of file qlocale_p.h.

◆ m_currency_rounding

quint8 QLocaleData::m_currency_rounding

Definition at line 481 of file qlocale_p.h.

◆ m_first_day_of_week

quint8 QLocaleData::m_first_day_of_week

Definition at line 482 of file qlocale_p.h.

Referenced by QLocale::firstDayOfWeek().

◆ m_grouping_higher

quint8 QLocaleData::m_grouping_higher

Definition at line 486 of file qlocale_p.h.

Referenced by doubleToString().

◆ m_grouping_least

quint8 QLocaleData::m_grouping_least

Definition at line 487 of file qlocale_p.h.

Referenced by doubleToString().

◆ m_grouping_top

quint8 QLocaleData::m_grouping_top

Definition at line 485 of file qlocale_p.h.

Referenced by doubleToString().

◆ m_weekend_end

quint8 QLocaleData::m_weekend_end

Definition at line 484 of file qlocale_p.h.

Referenced by QLocale::weekdays().

◆ m_weekend_start

quint8 QLocaleData::m_weekend_start

Definition at line 483 of file qlocale_p.h.

Referenced by QLocale::weekdays().


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