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#include "qebvtype_p.h"
41#include "qgenericsequencetype_p.h"
42#include "qnonetype_p.h"
43
44#include "qcommonsequencetypes_p.h"
45
46/* To avoid the static initialization fiasco, we put the builtin types in this compilation unit, since
47 * the sequence types depends on them. */
48#include "qbuiltintypes.cpp"
49
50QT_BEGIN_NAMESPACE
51
52using namespace QPatternist;
53
54// STATIC DATA
55#define st(var, type, card) \
56const SequenceType::Ptr \
57CommonSequenceTypes::var(new GenericSequenceType(BuiltinTypes::type, \
58 Cardinality::card()))
59
60/* Alphabetically. */
61st(ExactlyOneAnyURI, xsAnyURI, exactlyOne);
62st(ExactlyOneAtomicType, xsAnyAtomicType, exactlyOne);
63st(ExactlyOneAttribute, attribute, exactlyOne);
64st(ExactlyOneBase64Binary, xsBase64Binary, exactlyOne);
65st(ExactlyOneBoolean, xsBoolean, exactlyOne);
66st(ExactlyOneComment, comment, exactlyOne);
67st(ExactlyOneDateTime, xsDateTime, exactlyOne);
68st(ExactlyOneDate, xsDate, exactlyOne);
69st(ExactlyOneDayTimeDuration, xsDayTimeDuration, exactlyOne);
70st(ExactlyOneDecimal, xsDecimal, exactlyOne);
71st(ExactlyOneDocumentNode, document, exactlyOne);
72st(OneOrMoreDocumentNodes, document, oneOrMore);
73st(ExactlyOneDouble, xsDouble, exactlyOne);
74st(ExactlyOneDuration, xsDuration, exactlyOne);
75st(ExactlyOneElement, element, exactlyOne);
76st(ExactlyOneFloat, xsFloat, exactlyOne);
77st(ExactlyOneGDay, xsGDay, exactlyOne);
78st(ExactlyOneGMonthDay, xsGMonthDay, exactlyOne);
79st(ExactlyOneGMonth, xsGMonth, exactlyOne);
80st(ExactlyOneGYearMonth, xsGYearMonth, exactlyOne);
81st(ExactlyOneGYear, xsGYear, exactlyOne);
82st(ExactlyOneHexBinary, xsHexBinary, exactlyOne);
83st(ExactlyOneInteger, xsInteger, exactlyOne);
84st(ExactlyOneItem, item, exactlyOne);
85st(ExactlyOneNCName, xsNCName, exactlyOne);
86st(ExactlyOneNode, node, exactlyOne);
87st(ExactlyOneNumeric, numeric, exactlyOne);
88st(ExactlyOneProcessingInstruction, pi, exactlyOne);
89st(ExactlyOneQName, xsQName, exactlyOne);
90st(ExactlyOneString, xsString, exactlyOne);
91st(ExactlyOneTextNode, text, exactlyOne);
92st(ExactlyOneTime, xsTime, exactlyOne);
93st(ExactlyOneUntypedAtomic, xsUntypedAtomic, exactlyOne);
94st(ExactlyOneYearMonthDuration, xsYearMonthDuration, exactlyOne);
95st(OneOrMoreItems, item, oneOrMore);
96st(ZeroOrMoreAtomicTypes, xsAnyAtomicType, zeroOrMore);
97st(ZeroOrMoreElements, element, zeroOrMore);
98st(ZeroOrMoreIntegers, xsInteger, zeroOrMore);
99st(ZeroOrMoreItems, item, zeroOrMore);
100st(ZeroOrMoreNodes, node, zeroOrMore);
101st(ZeroOrMoreStrings, xsString, zeroOrMore);
102st(ZeroOrOneAnyURI, xsAnyURI, zeroOrOne);
103st(ZeroOrOneAtomicType, xsAnyAtomicType, zeroOrOne);
104st(ZeroOrOneBoolean, xsBoolean, zeroOrOne);
105st(ZeroOrOneDateTime, xsDateTime, zeroOrOne);
106st(ZeroOrOneDate, xsDate, zeroOrOne);
107st(ZeroOrOneDayTimeDuration, xsDayTimeDuration, zeroOrOne);
108st(ZeroOrOneDecimal, xsDecimal, zeroOrOne);
109st(ZeroOrOneDocumentNode, document, zeroOrOne);
110st(ZeroOrOneDuration, xsDuration, zeroOrOne);
111st(ZeroOrOneInteger, xsInteger, zeroOrOne);
112st(ZeroOrOneItem, item, zeroOrOne);
113st(ZeroOrOneNCName, xsNCName, zeroOrOne);
114st(ZeroOrOneNode, node, zeroOrOne);
115st(ZeroOrOneNumeric, numeric, zeroOrOne);
116st(ZeroOrOneQName, xsQName, zeroOrOne);
117st(ZeroOrOneString, xsString, zeroOrOne);
118st(ZeroOrOneTextNode, text, zeroOrOne);
119st(ZeroOrOneTime, xsTime, zeroOrOne);
120st(ZeroOrOneYearMonthDuration, xsYearMonthDuration, zeroOrOne);
121
122#undef st
123
124/* Special cases. */
125const EmptySequenceType::Ptr CommonSequenceTypes::Empty (new EmptySequenceType());
126const NoneType::Ptr CommonSequenceTypes::None (new NoneType());
127const SequenceType::Ptr CommonSequenceTypes::EBV (new EBVType());
128
129
130QT_END_NAMESPACE
131

source code of qtxmlpatterns/src/xmlpatterns/type/qcommonsequencetypes.cpp