author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 0 | 1918ee327afb |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtXmlPatterns module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
// |
|
43 |
// W A R N I N G |
|
44 |
// ------------- |
|
45 |
// |
|
46 |
// This file is not part of the Qt API. It exists purely as an |
|
47 |
// implementation detail. This header file may change from version to |
|
48 |
// version without notice, or even be removed. |
|
49 |
// |
|
50 |
// We mean it. |
|
51 |
||
52 |
#ifndef Patternist_Primitives_H |
|
53 |
#define Patternist_Primitives_H |
|
54 |
||
55 |
#include <QtGlobal> |
|
56 |
#include <QtCore/QHash> |
|
57 |
#include <QtCore/QUrl> |
|
58 |
||
59 |
/** |
|
60 |
* @file |
|
61 |
* @short Contains enumerators and typedefs applying |
|
62 |
* for Patternist on a global scale, as well as central documentation. |
|
63 |
*/ |
|
64 |
||
65 |
/** |
|
66 |
* @short Contains Patternist, an XPath 2.0, XQuery 1.0 and XSL-T 2.0 implementation. |
|
67 |
* |
|
68 |
* @author Frans Englich <frans.englich@nokia.com> |
|
69 |
*/ |
|
70 |
QT_BEGIN_HEADER |
|
71 |
||
72 |
QT_BEGIN_NAMESPACE |
|
73 |
||
74 |
class QString; |
|
75 |
||
76 |
/** |
|
77 |
* @short The namespace for the internal API of QtXmlPatterns |
|
78 |
* @internal |
|
79 |
*/ |
|
80 |
namespace QPatternist |
|
81 |
{ |
|
82 |
||
83 |
/** |
|
84 |
* @internal |
|
85 |
* |
|
86 |
* A method to allow a QHash or QSet with QUrl |
|
87 |
* as key type. |
|
88 |
*/ |
|
89 |
inline uint qHash(const QUrl &uri) |
|
90 |
{ |
|
91 |
return qHash(uri.toString()); |
|
92 |
} |
|
93 |
||
94 |
/** |
|
95 |
* @defgroup Patternist_cppWXSTypes C++ Primitives for W3C XML Schema Number Types |
|
96 |
* |
|
97 |
* The implementations of W3C XML Schema's(WXS) number types, more specifically |
|
98 |
* their value spaces, must in the end be represented by primitive C++ types. |
|
99 |
* In addition, there is an extensive range of functions and classes that in |
|
100 |
* different ways deals with data that will end up as instances of the WXS |
|
101 |
* types. For this reason, a set of typedefs for these primitives exists, that |
|
102 |
* are used throughout the API. This ensures consistency, reduces the amount |
|
103 |
* of conversions, and potentially precision loss in conversions. |
|
104 |
* |
|
105 |
* @author Frans Englich <frans.englich@nokia.com> |
|
106 |
*/ |
|
107 |
||
108 |
/** |
|
109 |
* This is the native C++ scalar type holding the value space |
|
110 |
* for atomic values of type xs:double. Taking this type, xsDouble, |
|
111 |
* as parameter, is the most efficient way to integrate with xs:double. |
|
112 |
* |
|
113 |
* @ingroup Patternist_cppWXSTypes |
|
114 |
*/ |
|
115 |
typedef qreal xsDouble; |
|
116 |
||
117 |
/** |
|
118 |
* This is the native C++ scalar type holding the value space |
|
119 |
* for atomic values of type xs:float. Taking this type, xsFloat, |
|
120 |
* as parameter, is the most efficient way to integrate with xs:float. |
|
121 |
* |
|
122 |
* @ingroup Patternist_cppWXSTypes |
|
123 |
*/ |
|
124 |
typedef xsDouble xsFloat; |
|
125 |
||
126 |
/** |
|
127 |
* This is the native C++ scalar type holding the value space |
|
128 |
* for atomic values of type xs:decimal. Taking this type, xsDecimal, |
|
129 |
* as parameter, is the most efficient way to integrate with xs:decimal. |
|
130 |
* |
|
131 |
* @ingroup Patternist_cppWXSTypes |
|
132 |
*/ |
|
133 |
typedef xsDouble xsDecimal; |
|
134 |
||
135 |
/** |
|
136 |
* This is the native C++ scalar type holding the value space |
|
137 |
* for atomic values of type xs:integer. Taking this type, xsInteger, |
|
138 |
* as parameter, is the most efficient way to integrate with xs:integer. |
|
139 |
* |
|
140 |
* @ingroup Patternist_cppWXSTypes |
|
141 |
*/ |
|
142 |
typedef qint64 xsInteger; |
|
143 |
||
144 |
/** |
|
145 |
* This is the native C++ scalar type holding the value space |
|
146 |
* for atomic values of type xs:integer. Taking this type, xsInteger, |
|
147 |
* as parameter, is the most efficient way to integrate with xs:integer. |
|
148 |
* |
|
149 |
* @ingroup Patternist_cppWXSTypes |
|
150 |
*/ |
|
151 |
typedef qint32 VariableSlotID; |
|
152 |
||
153 |
typedef qint32 DayCountProperty; |
|
154 |
typedef qint32 HourCountProperty; |
|
155 |
typedef qint32 MinuteCountProperty; |
|
156 |
typedef qint32 MonthCountProperty; |
|
157 |
typedef qint32 SecondCountProperty; |
|
158 |
typedef qint64 MSecondCountProperty; |
|
159 |
typedef qint32 SecondProperty; |
|
160 |
typedef qint32 YearProperty; |
|
161 |
typedef qint8 DayProperty; |
|
162 |
typedef qint8 HourProperty; |
|
163 |
typedef qint8 MinuteProperty; |
|
164 |
typedef qint8 MonthProperty; |
|
165 |
||
166 |
/** |
|
167 |
* Milliseconds. 1 equals 0.001 SecondProperty. |
|
168 |
*/ |
|
169 |
typedef qint16 MSecondProperty; |
|
170 |
||
171 |
/** |
|
172 |
* The hour property of a zone offset. For example, -13 in the |
|
173 |
* zone offset "-13:08". |
|
174 |
*/ |
|
175 |
typedef qint8 ZOHourProperty; |
|
176 |
||
177 |
/** |
|
178 |
* The minute property of a zone offset. For example, -08 in the |
|
179 |
* zone offset "-13:08". |
|
180 |
*/ |
|
181 |
typedef qint8 ZOMinuteProperty; |
|
182 |
||
183 |
/** |
|
184 |
* The full zone offset in minutes. |
|
185 |
*/ |
|
186 |
typedef qint32 ZOTotal; |
|
187 |
||
188 |
typedef xsDouble PatternPriority; |
|
189 |
||
190 |
/** |
|
191 |
* Signifies the import precedence of a template. For instance, the first |
|
192 |
* stylesheet module has 1, the first import 2, and so forth. Smaller means |
|
193 |
* higher import precedence. 0 is reserved for builtin templates. |
|
194 |
*/ |
|
195 |
typedef int ImportPrecedence; |
|
196 |
||
197 |
/** |
|
198 |
* @short Similar to Qt::escape(), but also escapes apostrophes and quotes, |
|
199 |
* such that the result is suitable as attribute content too. |
|
200 |
* |
|
201 |
* Since Qt::escape() is in QtGui, using it creates a dependency on that |
|
202 |
* library. This function does not. |
|
203 |
* |
|
204 |
* The implementation resides in qpatternistlocale.cpp. |
|
205 |
* |
|
206 |
* @see Qt::escape() |
|
207 |
*/ |
|
208 |
QString Q_AUTOTEST_EXPORT escape(const QString &input); |
|
209 |
} |
|
210 |
||
211 |
using QPatternist::qHash; |
|
212 |
||
213 |
QT_END_NAMESPACE |
|
214 |
||
215 |
QT_END_HEADER |
|
216 |
||
217 |
#endif |