Qt 6.x
The Qt SDK
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
 
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 QLocaleDatac ()
 
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
 

Detailed Description

Definition at line 217 of file qlocale_p.h.

Member Enumeration Documentation

◆ DoubleForm

Enumerator
DFExponent 
DFDecimal 
DFSignificantDigits 
_DFMax 

Definition at line 225 of file qlocale_p.h.

◆ Flags

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

Definition at line 232 of file qlocale_p.h.

◆ NumberMode

Enumerator
IntegerMode 
DoubleStandardMode 
DoubleScientificMode 

Definition at line 248 of file qlocale_p.h.

Member Function Documentation

◆ bytearrayToLongLong()

qlonglong QLocaleData::bytearrayToLongLong ( QByteArrayView  num,
int  base,
bool *  ok 
)
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().

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

◆ bytearrayToUnsLongLong()

qulonglong QLocaleData::bytearrayToUnsLongLong ( QByteArrayView  num,
int  base,
bool *  ok 
)
static

Definition at line 4361 of file qlocale.cpp.

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

Referenced by stringToUnsLongLong(), 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 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().

+ Here is the caller graph for this function:

◆ convertDoubleToFloat()

static float QLocaleData::convertDoubleToFloat ( double  d,
bool *  ok 
)
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().

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

◆ decimalPoint()

QString QLocaleData::decimalPoint ( ) const

Definition at line 920 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

◆ exponentSeparator()

QString QLocaleData::exponentSeparator ( ) const

Definition at line 971 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 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().

+ 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 925 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 369 of file qlocale_p.h.

Referenced by QLocalePrivate::bcp47Name(), findLocaleIndexById(), QLocale::matchingLocales(), and QLocale::uiLanguages().

+ Here is the caller graph for this function:

◆ listSeparator()

QString QLocaleData::listSeparator ( ) const

Definition at line 935 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 3785 of file qlocale.cpp.

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

Referenced by QString::arg(), QTextStreamPrivate::putNumber(), QSystemLocalePrivate::toCurrencyString(), QLocale::toString(), and QString::vasprintf().

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

◆ negativeSign()

QString QLocaleData::negativeSign ( ) const

Definition at line 961 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 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().

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

◆ numericData()

QLocaleData::NumericData QLocaleData::numericData ( QLocaleData::NumberMode  mode) const
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().

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

◆ percentSign()

QString QLocaleData::percentSign ( ) const

Definition at line 930 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 966 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 4293 of file qlocale.cpp.

References QVarLengthArray< T, Prealloc >::constData(), DoubleScientificMode, numberToCLocale(), 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()

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.

+ Here is the call graph for this function:

◆ stringToUnsLongLong()

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.

+ Here is the call graph for this function:

◆ unsLongLongToString()

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().

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

◆ validateChars()

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().

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

◆ zeroDigit()

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().

+ 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 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.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_currency_digits

quint8 QLocaleData::m_currency_digits

Definition at line 463 of file qlocale_p.h.

Referenced by QLocale::toCurrencyString().

◆ m_currency_rounding

quint8 QLocaleData::m_currency_rounding

Definition at line 464 of file qlocale_p.h.

◆ m_first_day_of_week

quint8 QLocaleData::m_first_day_of_week

Definition at line 465 of file qlocale_p.h.

Referenced by QLocale::firstDayOfWeek().

◆ m_grouping_higher

quint8 QLocaleData::m_grouping_higher

Definition at line 469 of file qlocale_p.h.

Referenced by doubleToString(), and numberToCLocale().

◆ m_grouping_least

quint8 QLocaleData::m_grouping_least

Definition at line 470 of file qlocale_p.h.

Referenced by doubleToString(), and numberToCLocale().

◆ m_grouping_top

quint8 QLocaleData::m_grouping_top

Definition at line 468 of file qlocale_p.h.

Referenced by doubleToString(), and numberToCLocale().

◆ m_weekend_end

quint8 QLocaleData::m_weekend_end

Definition at line 467 of file qlocale_p.h.

Referenced by QLocale::weekdays().

◆ m_weekend_start

quint8 QLocaleData::m_weekend_start

Definition at line 466 of file qlocale_p.h.

Referenced by QLocale::weekdays().


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