![]() |
Qt 6.x
The Qt SDK
|
#include "qlocale_tools_p.h"
#include "qdoublescanprint_p.h"
#include "qlocale_p.h"
#include "qstring.h"
#include <private/qtools_p.h>
#include <private/qnumeric_p.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <limits>
#include <charconv>
Go to the source code of this file.
Macros | |
#define | LLONG_MAX Q_INT64_C(0x7fffffffffffffff) |
#define | LLONG_MIN (-LLONG_MAX - Q_INT64_C(1)) |
#define | ULLONG_MAX Q_UINT64_C(0xffffffffffffffff) |
#define | BIG_BASE_LOOP(b) |
#define | SMALL_BASE_LOOP(b) |
#define LLONG_MAX Q_INT64_C(0x7fffffffffffffff) |
Definition at line 30 of file qlocale_tools.cpp.
Definition at line 33 of file qlocale_tools.cpp.
#define SMALL_BASE_LOOP | ( | b | ) |
#define ULLONG_MAX Q_UINT64_C(0xffffffffffffffff) |
Definition at line 36 of file qlocale_tools.cpp.
|
staticconstexpr |
Definition at line 626 of file qlocale_tools.cpp.
References i, number, Q_ASSERT, and Q_LIKELY.
Referenced by QTest::countSignificantDigits(), digitCount(), QLocaleData::doubleToString(), dtoString(), qdtoa(), QSystemLocalePrivate::zeroDigit(), and zeroPad().
|
static |
Definition at line 639 of file qlocale_tools.cpp.
References d, QGraphicsItem::data(), QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocaleData::DFSignificantDigits, digits(), QLocale::FloatingPointShortest, form, i, isZero(), Q_ASSERT, qAbs(), qIsFinite(), qMax(), qt_doubleToAscii(), resolveFormat(), sign(), view, and wholePartSpace().
|
static |
Definition at line 408 of file qlocale_tools.cpp.
References base, d, and qMin().
Referenced by qstrntoll().
Definition at line 572 of file qlocale_tools.cpp.
References d, QLocaleData::DFSignificantDigits, digits(), QLocale::FloatingPointShortest, qt_doubleToAscii(), and sign().
Referenced by QV4::RuntimeHelpers::numberToString().
QByteArray qdtoAscii | ( | double | d, |
QLocaleData::DoubleForm | form, | ||
int | precision, | ||
bool | uppercase | ||
) |
Definition at line 793 of file qlocale_tools.cpp.
Referenced by QByteArray::number().
QString qdtoBasicLatin | ( | double | d, |
QLocaleData::DoubleForm | form, | ||
int | precision, | ||
bool | uppercase | ||
) |
Definition at line 788 of file qlocale_tools.cpp.
Referenced by QString::number().
double qstrntod | ( | const char * | s00, |
qsizetype | len, | ||
const char ** | se, | ||
bool * | ok | ||
) |
Converts the initial portion of the string pointed to by s00 to a double, using the 'C' locale. The function sets the pointer pointed to by se to point to the character past the last character converted.
Definition at line 562 of file qlocale_tools.cpp.
References ok, qt_asciiToDouble(), and TrailingJunkAllowed.
Referenced by qstrtod().
QSimpleParsedNumber< qlonglong > qstrntoll | ( | const char * | begin, |
qsizetype | size, | ||
int | base | ||
) |
Definition at line 439 of file qlocale_tools.cpp.
References ascii_isspace(), base, begin(), isDigitForBase(), and scanPrefix().
Referenced by QLocaleData::bytearrayToLongLong(), deviceNumber(), getWinLocaleName(), parsePosixTime(), and qt_doubleToAscii().
QSimpleParsedNumber< qulonglong > qstrntoull | ( | const char * | begin, |
qsizetype | size, | ||
int | base | ||
) |
Definition at line 421 of file qlocale_tools.cpp.
References ascii_isspace(), base, begin(), and scanPrefix().
Referenced by QLocaleData::bytearrayToUnsLongLong(), from_string(), parse_field_width(), QIPAddressUtils::parseIp4Internal(), QIPAddressUtils::parseIp6(), and winIso639LangName().
QSimpleParsedNumber< double > qt_asciiToDouble | ( | const char * | num, |
qsizetype | numLen, | ||
StrayCharacterMode | strayCharMode | ||
) |
Definition at line 253 of file qlocale_tools.cpp.
References c2, d, fmt, i, isZero(), Q_ASSERT, qIsFinite(), qIsNaN(), qsnprintf(), qt_inf(), qt_qnan(), TrailingJunkAllowed, TrailingJunkProhibited, and WhitespacesAllowed.
Referenced by qstrntod(), QLocaleData::stringToDouble(), QStringView::toDouble(), and QtPrivate::toDouble().
QT_CLOCALE_HOLDER void qt_doubleToAscii | ( | double | d, |
QLocaleData::DoubleForm | form, | ||
int | precision, | ||
char * | buf, | ||
qsizetype | bufSize, | ||
bool & | sign, | ||
int & | length, | ||
int & | decpt | ||
) |
Definition at line 45 of file qlocale_tools.cpp.
References d, QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocaleData::DFSignificantDigits, QLocale::FloatingPointShortest, form, isZero(), Q_ASSERT, qMin(), qstrntoll(), qt_is_inf(), qt_is_nan(), sign(), and wholePartSpace().
Referenced by QLocaleData::doubleToString(), dtoString(), and qdtoa().
QString qulltoa | ( | qulonglong | number, |
int | base, | ||
const QStringView | zero | ||
) |
Definition at line 520 of file qlocale_tools.cpp.
References base, QChar::highSurrogate(), QChar::lowSurrogate(), number, QChar::surrogateToUcs4(), unicodeForDigit(), and zero.
Referenced by QLocaleData::longLongToString(), QIPAddressUtils::number(), and QLocaleData::unsLongLongToString().
QString qulltoBasicLatin | ( | qulonglong | number, |
int | base, | ||
bool | negative | ||
) |
Definition at line 502 of file qlocale_tools.cpp.
References base, number, and QStringLiteral.
Referenced by QString::number(), and QString::number().
|
static |
Definition at line 473 of file qlocale_tools.cpp.
References base, BIG_BASE_LOOP, and SMALL_BASE_LOOP.
|
static |
Definition at line 592 of file qlocale_tools.cpp.
References QLocaleData::DFDecimal, QLocaleData::DFExponent, QLocale::FloatingPointShortest, and Q_ASSERT.
Referenced by dtoString().
|
static |
Definition at line 370 of file qlocale_tools.cpp.
References base, QtMiscUtils::isAsciiDigit(), next, Q_ASSERT, and R.
Referenced by qstrntoll(), and qstrntoull().