#include <sys/types.h>#include <ctype.h>#include <float.h>#include <limits.h>#include <math.h>#include <stdlib.h>#include "qlocale.h"#include "qlocale_p.h"Include dependency graph for qlocale.cpp:

Go to the source code of this file.
Defines | |
| #define | INFINITY (::inf()) |
| #define | NAN (::nan()) |
| #define | LLONG_MAX Q_INT64_C(9223372036854775807) |
| #define | LLONG_MIN (-LLONG_MAX - Q_INT64_C(1)) |
| #define | ULLONG_MAX Q_UINT64_C(0xffffffffffffffff) |
| #define | IEEE_BIG_OR_LITTLE_ENDIAN 1 |
| #define | Long Q_INT32 |
| #define | ULong Q_UINT32 |
| #define | MALLOC malloc |
| #define | CONST const |
| #define | Sign_Extend(a, b) |
| #define | word0(x) ((volatile ULong *)&x)[ByteOrder == BigEndian ? 0 : 1] |
| #define | word1(x) ((volatile ULong *)&x)[ByteOrder == BigEndian ? 1 : 0] |
| #define | USE_LITTLE_ENDIAN 0 |
| #define | USE_IEEE 1 |
| #define | Exp_shift 20 |
| #define | Exp_shift1 20 |
| #define | Exp_msk1 0x100000 |
| #define | Exp_msk11 0x100000 |
| #define | Exp_mask 0x7ff00000 |
| #define | P 53 |
| #define | Bias 1023 |
| #define | IEEE_Arith |
| #define | Emin (-1022) |
| #define | Exp_1 0x3ff00000 |
| #define | Exp_11 0x3ff00000 |
| #define | Ebits 11 |
| #define | Frac_mask 0xfffff |
| #define | Frac_mask1 0xfffff |
| #define | Ten_pmax 22 |
| #define | Bletch 0x10 |
| #define | Bndry_mask 0xfffff |
| #define | Bndry_mask1 0xfffff |
| #define | LSB 1 |
| #define | Sign_bit 0x80000000 |
| #define | Log2P 1 |
| #define | Tiny0 0 |
| #define | Tiny1 1 |
| #define | Quick_max 14 |
| #define | Int_max 14 |
| #define | Infinite(x) (word0(x) == 0x7ff00000) |
| #define | rounded_product(a, b) a *= b |
| #define | rounded_quotient(a, b) a /= b |
| #define | Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) |
| #define | Big1 0xffffffff |
| #define | Kmax 15 |
| #define | Bcopy(x, y) |
| #define | d0 word0(d) |
| #define | d1 word1(d) |
| #define | d0 word0(d) |
| #define | d1 word1(d) |
| #define | n_bigtens 5 |
Typedefs | |
| typedef Bigint | Bigint |
Enumerations | |
| enum | { LittleEndian, BigEndian } |
| enum | PrecisionMode { PMDecimalDigits = 0x01, PMSignificantDigits = 0x02, PMChopTrailingZeros = 0x03 } |
Functions | |
| static double | inf () |
| static double | nan () |
| static char * | qdtoa (double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **digits_str) |
| static double | qstrtod (const char *s00, char const **se, bool *ok) |
| static Q_LLONG | qstrtoll (const char *nptr, const char **endptr, register int base, bool *ok) |
| static Q_ULLONG | qstrtoull (const char *nptr, const char **endptr, register int base, bool *ok) |
| static QLocale::Language | codeToLanguage (const QString &code) |
| static QLocale::Country | codeToCountry (const QString &code) |
| static QString | languageToCode (QLocale::Language language) |
| static QString | countryToCode (QLocale::Country country) |
| static const QLocalePrivate * | findLocale (QLocale::Language language, QLocale::Country country) |
| static bool | qIsUpper (char c) |
| static char | qToLower (char c) |
| static char | digitToCLocale (QChar zero, QChar d) |
| static QString | qulltoa (Q_ULLONG l, int base, const QLocalePrivate &locale) |
| static QString | qlltoa (Q_LLONG l, int base, const QLocalePrivate &locale) |
| static QString & | decimalForm (QString &digits, int decpt, uint precision, PrecisionMode pm, bool always_show_decpt, bool thousands_group, const QLocalePrivate &locale) |
| static QString & | exponentForm (QString &digits, int decpt, uint precision, PrecisionMode pm, bool always_show_decpt, const QLocalePrivate &locale) |
| static bool | compareSubstr (const QString &s1, uint idx, const QString &s2) |
| static void | stripWhiteSpaceInPlace (QString &s) |
| static void | Storeinc (ULong *&a, const ULong &b, const ULong &c) |
| static Bigint * | Balloc (int k) |
| static void | Bfree (Bigint *v) |
| static Bigint * | multadd (Bigint *b, int m, int a) |
| static Bigint * | s2b (CONST char *s, int nd0, int nd, ULong y9) |
| static int | hi0bits (ULong x) |
| static int | lo0bits (ULong *y) |
| static Bigint * | i2b (int i) |
| static Bigint * | mult (Bigint *a, Bigint *b) |
| static Bigint * | pow5mult (Bigint *b, int k) |
| static Bigint * | lshift (Bigint *b, int k) |
| static int | cmp (Bigint *a, Bigint *b) |
| static Bigint * | diff (Bigint *a, Bigint *b) |
| static double | ulp (volatile double x) |
| static double | b2d (Bigint *a, int *e) |
| static Bigint * | d2b (double d, int *e, int *bits) |
| static double | ratio (Bigint *a, Bigint *b) |
| static double | qstrtod (CONST char *s00, CONST char **se, bool *ok) |
| static int | quorem (Bigint *b, Bigint *S) |
Variables | |
| static const unsigned int | one = 1 |
| static const bool | ByteOrder = ((*((unsigned char *) &one) == 0) ? BigEndian : LittleEndian) |
| static const unsigned char | be_inf_bytes [] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } |
| static const unsigned char | le_inf_bytes [] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } |
| static const unsigned char | be_nan_bytes [] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } |
| static const unsigned char | le_nan_bytes [] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } |
| static const uint | locale_index [] |
| static const QLocalePrivate | locale_data [] |
| static const char | language_name_list [] |
| static const uint | language_name_index [] |
| static const char | country_name_list [] |
| static const uint | country_name_index [] |
| static const char | language_code_list [] |
| static const char | country_code_list [] |
| static Bigint * | p5s |
| static CONST double | tens [] |
| static CONST double | bigtens [] = { 1e16, 1e32, 1e64, 1e128, 1e256 } |
| static CONST double | tinytens [] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 } |
| static double | g_double_zero = 0.0 |
|
|
Value: Definition at line 4078 of file qlocale.cpp. |
|
|
Definition at line 3944 of file qlocale.cpp. |
|
|
Definition at line 4035 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 4036 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3953 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 3954 of file qlocale.cpp. |
|
|
Definition at line 3955 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3865 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 3949 of file qlocale.cpp. Referenced by b2d(). |
|
|
Definition at line 3946 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3947 of file qlocale.cpp. Referenced by b2d(). |
|
|
Definition at line 3948 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 3942 of file qlocale.cpp. |
|
|
Definition at line 3940 of file qlocale.cpp. Referenced by d2b(), qdtoa(), qstrtod(), ratio(), and ulp(). |
|
|
Definition at line 3941 of file qlocale.cpp. Referenced by d2b(). |
|
|
Definition at line 3938 of file qlocale.cpp. |
|
|
Definition at line 3939 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 3950 of file qlocale.cpp. |
|
|
Definition at line 3951 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 3945 of file qlocale.cpp. |
|
|
Definition at line 3846 of file qlocale.cpp. |
|
|
Definition at line 3963 of file qlocale.cpp. |
|
|
Definition at line 102 of file qlocale.cpp. Referenced by QLocalePrivate::doubleToString(), and QLocalePrivate::stringToDouble(). |
|
|
Definition at line 3962 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 4049 of file qlocale.cpp. |
|
|
Definition at line 119 of file qlocale.cpp. |
|
|
Definition at line 122 of file qlocale.cpp. |
|
|
Definition at line 3958 of file qlocale.cpp. |
|
|
Definition at line 3861 of file qlocale.cpp. Referenced by Balloc(), diff(), qdtoa(), qstrtod(), quorem(), s2b(), and ulp(). |
|
|
Definition at line 3956 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3864 of file qlocale.cpp. Referenced by Balloc(). |
|
|
Definition at line 4774 of file qlocale.cpp. |
|
|
Definition at line 114 of file qlocale.cpp. Referenced by QLocalePrivate::stringToDouble(). |
|
|
|
Definition at line 3961 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 4031 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 4032 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3957 of file qlocale.cpp. Referenced by qdtoa(). |
|
|
Definition at line 3875 of file qlocale.cpp. |
|
|
Definition at line 3952 of file qlocale.cpp. |
|
|
Definition at line 3959 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 3960 of file qlocale.cpp. Referenced by qstrtod(). |
|
|
Definition at line 125 of file qlocale.cpp. Referenced by qstrtoull(). |
|
|
Definition at line 3862 of file qlocale.cpp. Referenced by b2d(), cmp(), d2b(), diff(), lo0bits(), lshift(), mult(), multadd(), qdtoa(), qstrtod(), and quorem(). |
|
|
Referenced by Storeinc(). |
|
|
Referenced by Storeinc(). |
|
|
Definition at line 3883 of file qlocale.cpp. Referenced by b2d(), d2b(), qdtoa(), qstrtod(), ratio(), and ulp(). |
|
|
Definition at line 3884 of file qlocale.cpp. |
|
|
Definition at line 4058 of file qlocale.cpp. |
|
|
Definition at line 74 of file qlocale.cpp. |
|
|
Definition at line 2891 of file qlocale.cpp. |
|
||||||||||||
|
Definition at line 4540 of file qlocale.cpp. References d, d0, d1, Ebits, Exp_1, hi0bits(), Bigint::k, ULong, Bigint::wds, word0, word1, Bigint::x, and Opie::MM::y. Referenced by ratio(). |
|
|
Definition at line 4060 of file qlocale.cpp. References Bigint::k, Long, MALLOC, Bigint::maxwds, Bigint::sign, Bigint::wds, and Opie::MM::x. Referenced by d2b(), diff(), i2b(), lshift(), mult(), multadd(), qdtoa(), qstrtod(), and s2b(). |
|
|
Definition at line 4073 of file qlocale.cpp. Referenced by lshift(), multadd(), pow5mult(), qdtoa(), and qstrtod(). |
|
||||||||||||
|
Definition at line 4404 of file qlocale.cpp. References i, ULong, Bigint::wds, and Bigint::x. Referenced by _muldiv(), _muldivr(), diff(), Catalog::findDestInTree(), Gfx::findOp(), PostScriptFunction::parseCode(), qdtoa(), qstrtod(), quorem(), and XLessThanY(). |
|
|
Definition at line 1590 of file qlocale.cpp. References QLocale::AnyCountry, and country_code_list. Referenced by QLocale::QLocale(). |
|
|
Definition at line 1573 of file qlocale.cpp. References QLocale::C, language_code_list, QString::length(), and QString::unicode(). Referenced by QLocale::QLocale(). |
|
||||||||||||||||
|
Definition at line 3269 of file qlocale.cpp. References i, QString::length(), and QString::unicode(). Referenced by QLocalePrivate::numberToCLocale(). |
|
|
Definition at line 1620 of file qlocale.cpp. References QLocale::AnyCountry, code, country_code_list, QString::null, and QString::setLength(). Referenced by QLocale::name(). |
|
||||||||||||||||
|
Definition at line 4604 of file qlocale.cpp. References Balloc(), Bias, d0, d1, Exp_msk1, Exp_msk11, Exp_shift, Frac_mask, hi0bits(), i, Bigint::k, lo0bits(), P, ULong, Bigint::wds, word0, word1, Bigint::x, Opie::MM::x, and Opie::MM::y. |
|
||||||||||||||||||||||||||||||||
|
Definition at line 2897 of file qlocale.cpp. References QString::append(), QLocalePrivate::decimal(), QLocalePrivate::group(), i, QString::insert(), QString::length(), PMDecimalDigits, PMSignificantDigits, QString::prepend(), and QLocalePrivate::zero(). Referenced by QLocalePrivate::doubleToString(). |
|
||||||||||||
|
||||||||||||
|
Definition at line 2844 of file qlocale.cpp. References QChar::cell(), qWarning(), QChar::row(), and QChar::unicode(). Referenced by QLocalePrivate::numberToCLocale(). |
|
||||||||||||||||||||||||||||
|
Definition at line 2939 of file qlocale.cpp. References QLocalePrivate::AlwaysShowSign, QString::append(), QLocalePrivate::decimal(), QLocalePrivate::exponential(), i, QString::insert(), QString::length(), QLocalePrivate::longLongToString(), PMDecimalDigits, PMSignificantDigits, and QLocalePrivate::zero(). Referenced by QLocalePrivate::doubleToString(). |
|
||||||||||||
|
Definition at line 1693 of file qlocale.cpp. References QLocale::AnyCountry, QLocalePrivate::countryId(), d, QLocalePrivate::languageId(), locale_index, and Q_ASSERT. Referenced by QLocale::QLocale(). |
|
|
Definition at line 4153 of file qlocale.cpp. References Bigint::k. |
|
|
Definition at line 4223 of file qlocale.cpp. References Balloc(), Bigint::wds, and Bigint::x. Referenced by pow5mult(), qdtoa(), and qstrtod(). |
|
|
Definition at line 96 of file qlocale.cpp. References be_inf_bytes, BigEndian, ByteOrder, and le_inf_bytes. Referenced by DCIM_DirLister::deleteImage(), DCIM_DirLister::findCameras(), ThumbNailTool::getThumb(), infoDlg::infoDlg(), ThumbNailTool::putThumb(), SlaveReciever::recieveAnswer(), saveLastDir(), PMainWindow::slotConfig(), SlaveReciever::slotImageInfo(), SlaveReciever::slotThumbNail(), and DCIM_DirLister::thumbNail(). |
|
|
Definition at line 1607 of file qlocale.cpp. References QLocale::C, code, language_code_list, and QString::setLength(). Referenced by QLocale::name(). |
|
|
Definition at line 4181 of file qlocale.cpp. References Bigint::k, ULong, and Opie::MM::x. Referenced by d2b(). |
|
||||||||||||
|
Definition at line 4350 of file qlocale.cpp. References Balloc(), Bfree(), i, Bigint::k, Bigint::maxwds, ULong, Bigint::wds, Bigint::x, and Opie::MM::x. |
|
||||||||||||
|
Definition at line 4233 of file qlocale.cpp. References Balloc(), Bigint::k, Bigint::maxwds, Storeinc(), ULong, Bigint::wds, Bigint::x, Opie::MM::x, and Opie::MM::y. Referenced by Board::bonussedValue(), QtRec::checkDiskSpace(), AdvancedFm::checkDiskSpace(), FormatterApp::deviceComboSelected(), InstallDlgImpl::displayAvailableSpace(), AdvancedFm::getDiskSpace(), Load::paintEvent(), pow5mult(), qdtoa(), qstrtod(), InstallDlg::slotDisplayAvailSpace(), and MountInfo::updateData(). |
|
||||||||||||||||
|
Definition at line 4082 of file qlocale.cpp. References Balloc(), Bcopy, Bfree(), i, Bigint::k, Bigint::maxwds, ULong, Bigint::wds, Bigint::x, Opie::MM::x, and Opie::MM::y. Referenced by pow5mult(), qdtoa(), and s2b(). |
|
|
Definition at line 108 of file qlocale.cpp. References be_nan_bytes, BigEndian, ByteOrder, and le_nan_bytes. |
|
||||||||||||
|
Definition at line 4317 of file qlocale.cpp. References Bfree(), i, i2b(), mult(), multadd(), and Bigint::next. |
|
||||||||||||||||||||||||||||||||
|
Definition at line 5483 of file qlocale.cpp. References Balloc(), Bcopy, Bfree(), Bias, Bletch, Bndry_mask, cmp(), d2b(), diff(), eps, Exp_11, Exp_mask, Exp_msk1, Exp_shift1, Frac_mask, Frac_mask1, hi0bits(), i, i2b(), Int_max, Bigint::k, Log2P, Long, lshift(), mult(), multadd(), n_bigtens, NULL, P, pow5mult(), Quick_max, quorem(), s, S, Bigint::sign, Sign_bit, Ten_pmax, ULong, Bigint::wds, word0, word1, Bigint::x, and Opie::MM::x. Referenced by QLocalePrivate::doubleToString(). |
|
|
Definition at line 2707 of file qlocale.cpp. Referenced by QLocale::toString(). |
|
||||||||||||||||
|
Definition at line 2886 of file qlocale.cpp. References qulltoa(). Referenced by QLocalePrivate::longLongToString(). |
|
||||||||||||||||
|
Definition at line 4798 of file qlocale.cpp. References Balloc(), Bcopy, Bfree(), Bias, Big0, Big1, Bndry_mask, Bndry_mask1, cmp(), CONST, d2b(), diff(), Emin, Exp_mask, Exp_msk1, i, i2b(), Bigint::k, Log2P, Long, LSB, lshift(), mult(), n_bigtens, NULL, P, pow5mult(), ratio(), rounded_product, rounded_quotient, s, s2b(), Bigint::sign, Ten_pmax, Tiny0, Tiny1, ULong, ulp(), word0, word1, and Opie::MM::y. |
|
||||||||||||||||
|
Referenced by QLocalePrivate::stringToDouble(). |
|
||||||||||||||||||||
|
Definition at line 3664 of file qlocale.cpp. References LLONG_MAX, LLONG_MIN, and s. Referenced by QLocalePrivate::stringToLongLong(). |
|
||||||||||||||||||||
|
Definition at line 3583 of file qlocale.cpp. References s, and ULLONG_MAX. Referenced by QLocalePrivate::stringToUnsLongLong(). |
|
|
Definition at line 2712 of file qlocale.cpp. Referenced by QLocale::toString(). |
|
||||||||||||||||
|
Definition at line 2854 of file qlocale.cpp. References p, and QLocalePrivate::zero(). Referenced by QLocalePrivate::longLongToString(), qlltoa(), and QLocalePrivate::unsLongLongToString(). |
|
||||||||||||
|
Definition at line 5345 of file qlocale.cpp. References cmp(), Long, Sign_Extend, Storeinc(), ULong, Bigint::wds, Bigint::x, and Opie::MM::y. Referenced by qdtoa(). |
|
||||||||||||
|
Definition at line 4727 of file qlocale.cpp. References b2d(), Exp_msk1, Bigint::k, Bigint::wds, and word0. Referenced by qstrtod(). |
|
||||||||||||||||||||
|
Definition at line 4121 of file qlocale.cpp. References Balloc(), i, Bigint::k, Long, multadd(), Bigint::wds, Bigint::x, Opie::MM::x, and Opie::MM::y. Referenced by qstrtod(). |
|
||||||||||||||||
|
Definition at line 3902 of file qlocale.cpp. References ByteOrder, LittleEndian, USE_IEEE, and USE_LITTLE_ENDIAN. |
|
|
Definition at line 3349 of file qlocale.cpp. References i, QString::length(), QString::remove(), QString::truncate(), and QString::unicode(). Referenced by QLocalePrivate::numberToCLocale(). |
|
|
Definition at line 4508 of file qlocale.cpp. References Exp_mask, Exp_msk1, Exp_shift, Long, P, word0, and word1. Referenced by qstrtod(). |
|
|
Definition at line 94 of file qlocale.cpp. Referenced by inf(). |
|
|
Definition at line 106 of file qlocale.cpp. Referenced by nan(). |
|
|
Definition at line 4772 of file qlocale.cpp. |
|
|
Definition at line 90 of file qlocale.cpp. Referenced by inf(), nan(), and Storeinc(). |
|
|
Definition at line 1329 of file qlocale.cpp. Referenced by codeToCountry(), and countryToCode(). |
|
|
Definition at line 941 of file qlocale.cpp. Referenced by QLocale::countryToString(). |
|
|
Definition at line 698 of file qlocale.cpp. Referenced by QLocale::countryToString(). |
|
|
Definition at line 4796 of file qlocale.cpp. |
|
|
Definition at line 1185 of file qlocale.cpp. Referenced by codeToLanguage(), and languageToCode(). |
|
|
Definition at line 554 of file qlocale.cpp. Referenced by QLocale::languageToString(). |
|
|
Definition at line 411 of file qlocale.cpp. Referenced by QLocale::languageToString(). |
|
|
Definition at line 95 of file qlocale.cpp. Referenced by inf(). |
|
|
Definition at line 107 of file qlocale.cpp. Referenced by nan(). |
|
|
Definition at line 281 of file qlocale.cpp. |
|
|
Definition at line 136 of file qlocale.cpp. Referenced by findLocale(). |
|
|
Definition at line 89 of file qlocale.cpp. Referenced by Calculator::Calculator(), ChannelGroup::ChannelGroup(), and ChannelGroupConf::ChannelGroupConf(). |
|
|
Definition at line 4315 of file qlocale.cpp. |
|
|
Initial value: {
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
1e20, 1e21, 1e22
}
Definition at line 4762 of file qlocale.cpp. |
|
|
Definition at line 4773 of file qlocale.cpp. |
1.4.2