summaryrefslogtreecommitdiff
path: root/qmake/include/private/qlocale_p.h
Unidiff
Diffstat (limited to 'qmake/include/private/qlocale_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qlocale_p.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/qmake/include/private/qlocale_p.h b/qmake/include/private/qlocale_p.h
new file mode 100644
index 0000000..26c05c9
--- a/dev/null
+++ b/qmake/include/private/qlocale_p.h
@@ -0,0 +1,128 @@
1/****************************************************************************
2**
3**
4** Declaration of the QLocalePrivate class
5**
6** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
7**
8** This file is part of the widgets module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QLOCALE_P_H
37#define QLOCALE_P_H
38
39//
40// W A R N I N G
41// -------------
42//
43// This file is not part of the Qt API. It exists for the convenience
44// of internal files. This header file may change from version to version
45// without notice, or even be removed.
46//
47// We mean it.
48//
49//
50
51#include <qstring.h>
52
53struct QLocalePrivate
54{
55public:
56 const QChar &decimal() const { return (QChar&)m_decimal; }
57 const QChar &group() const { return (QChar&)m_group; }
58 const QChar &list() const { return (QChar&)m_list; }
59 const QChar &percent() const { return (QChar&)m_percent; }
60 const QChar &zero() const { return (QChar&)m_zero; }
61 QChar plus() const { return QChar('+'); }
62 const QChar &minus() const { return (QChar&)m_minus; }
63 const QChar &exponential() const { return (QChar&)m_exponential; }
64 QString infinity() const;
65 QString nan() const;
66
67 Q_UINT32 languageId() const { return m_language_id; }
68 Q_UINT32 countryId() const { return m_country_id; }
69
70 bool isDigit(QChar d) const;
71
72 enum GroupSeparatorMode {
73 FailOnGroupSeparators,
74 ParseGroupSeparators
75 };
76
77 enum DoubleForm {
78 DFExponent = 0, // %e or %E
79 DFDecimal, // %f or %F
80 DFSignificantDigits, // %g or %G
81 _DFMax = DFSignificantDigits
82 };
83
84 enum Flags {
85 NoFlags = 0,
86
87 // These correspond to the options in a printf format string
88 Alternate = 0x01,
89 ZeroPadded = 0x02,
90 LeftAdjusted = 0x04,
91 BlankBeforePositive = 0x08,
92 AlwaysShowSign = 0x10,
93 ThousandsGroup = 0x20,
94 CapitalEorX = 0x40 // %x, %e, %f, %g vs. %X, %E, %F, %G
95 };
96
97 QString doubleToString(double d,
98 int precision = -1,
99 DoubleForm form = DFSignificantDigits,
100 int width = -1,
101 unsigned flags = NoFlags) const;
102 QString longLongToString(Q_LLONG l, int precision = -1,
103 int base = 10,
104 int width = -1,
105 unsigned flags = NoFlags) const;
106 QString unsLongLongToString(Q_ULLONG l, int precision = -1,
107 int base = 10,
108 int width = -1,
109 unsigned flags = NoFlags) const;
110 double stringToDouble(QString num, bool *ok, GroupSeparatorMode group_sep_mode) const;
111 Q_LLONG stringToLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const;
112 Q_ULLONG stringToUnsLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const;
113 bool removeGroupSeparators(QString &num_str) const;
114 bool numberToCLocale(QString &locale_num, GroupSeparatorMode group_sep_mode) const;
115
116 Q_UINT32 m_language_id, m_country_id;
117
118 Q_UINT16 m_decimal, m_group, m_list, m_percent,
119 m_zero, m_minus, m_exponential;
120
121 static const QString m_infinity;
122 static const QString m_nan;
123 static const QChar m_plus;
124
125 static const char *systemLocaleName();
126};
127
128#endif