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

source code of qtxmlpatterns/src/xmlpatterns/type/qprimitives_p.h