1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the core module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
32
#include "QtCore/qstring.h"
35
struct QLocalePrivate;
37
class Q_CORE_EXPORT QLocale
40
friend class QByteArray;
185
LastLanguage = Nynorsk
198
AntiguaAndBarbuda = 9,
216
BosniaAndHerzegowina = 27,
220
BritishIndianOceanTerritory = 31,
221
BruneiDarussalam = 32,
230
CentralAfricanRepublic = 41,
234
ChristmasIsland = 45,
238
DemocraticRepublicOfCongo = 49,
239
PeoplesRepublicOfCongo = 50,
250
DominicanRepublic = 61,
255
EquatorialGuinea = 66,
259
FalklandIslands = 70,
264
MetropolitanFrance = 75,
266
FrenchPolynesia = 77,
267
FrenchSouthernTerritories = 78,
284
HeardAndMcDonaldIslands = 95,
302
DemocraticRepublicOfKorea = 113,
303
RepublicOfKorea = 114,
311
LibyanArabJamahiriya = 122,
323
MarshallIslands = 134,
341
NetherlandsAntilles = 152,
349
NorthernMarianaIslands = 160,
354
PalestinianTerritory = 165,
356
PapuaNewGuinea = 167,
367
RussianFederation = 178,
369
SaintKittsAndNevis = 180,
371
StVincentAndTheGrenadines = 182,
374
SaoTomeAndPrincipe = 185,
382
SolomonIslands = 193,
385
SouthGeorgiaAndTheSouthSandwichIslands = 196,
389
StPierreAndMiquelon = 200,
392
SvalbardAndJanMayenIslands = 203,
396
SyrianArabRepublic = 207,
404
TrinidadAndTobago = 215,
408
TurksAndCaicosIslands = 219,
412
UnitedArabEmirates = 223,
415
UnitedStatesMinorOutlyingIslands = 226,
419
VaticanCityState = 230,
422
BritishVirginIslands = 233,
423
USVirginIslands = 234,
424
WallisAndFutunaIslands = 235,
430
LastCountry = Zimbabwe
434
QLocale(const QString &name);
435
QLocale(Language language, Country country = AnyCountry);
436
QLocale(const QLocale &other);
438
QLocale &operator=(const QLocale &other);
440
Language language() const;
441
Country country() const;
442
QString name() const;
444
short toShort(const QString &s, bool *ok = 0, int base = 0) const;
445
ushort toUShort(const QString &s, bool *ok = 0, int base = 0) const;
446
int toInt(const QString &s, bool *ok = 0, int base = 0) const;
447
uint toUInt(const QString &s, bool *ok = 0, int base = 0) const;
448
qlonglong toLongLong(const QString &s, bool *ok = 0, int base = 0) const;
449
qlonglong toULongLong(const QString &s, bool *ok = 0, int base = 0) const;
450
float toFloat(const QString &s, bool *ok = 0) const;
451
double toDouble(const QString &s, bool *ok = 0) const;
453
QString toString(short i) const
454
{ return toString(qlonglong(i)); }
455
QString toString(ushort i) const
456
{ return toString(qulonglong(i)); }
457
QString toString(int i) const
458
{ return toString(qlonglong(i)); }
459
QString toString(uint i) const
460
{ return toString(qulonglong(i)); }
461
QString toString(qlonglong i) const;
462
QString toString(qulonglong i) const;
463
QString toString(float i, char f = 'g', int prec = 6) const
464
{ return toString(double(i), f, prec); }
465
QString toString(double i, char f = 'g', int prec = 6) const;
467
inline bool operator==(const QLocale &other) const { return d == other.d; }
468
inline bool operator!=(const QLocale &other) const { return d != other.d; }
470
static QString languageToString(Language language);
471
static QString countryToString(Country country);
472
static void setDefault(const QLocale &locale);
474
static QLocale c() { return QLocale(C); }
475
static QLocale system();
478
const QLocalePrivate *d;
479
static const QLocalePrivate *default_d;
481
Q_DECLARE_TYPEINFO(QLocale, Q_MOVABLE_TYPE);
483
#ifndef QT_NO_DATASTREAM
484
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QLocale &);
485
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QLocale &);