8786e1ee34a97dc943e3bcd589349442cd6e6071
[profile/ivi/qtxmlpatterns.git] / src / xmlpatterns / type / qcommonsequencetypes.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qebvtype_p.h"
43 #include "qgenericsequencetype_p.h"
44 #include "qnonetype_p.h"
45
46 #include "qcommonsequencetypes_p.h"
47
48 /* To avoid the static initialization fiasco, we put the builtin types in this compilation unit, since
49  * the sequence types depends on them. */
50 #include "qbuiltintypes.cpp"
51
52 QT_BEGIN_NAMESPACE
53
54 using namespace QPatternist;
55
56 // STATIC DATA
57 #define st(var, type, card)                                             \
58 const SequenceType::Ptr                                                 \
59 CommonSequenceTypes::var(new GenericSequenceType(BuiltinTypes::type,    \
60                                                  Cardinality::card()))
61
62 /* Alphabetically. */
63 st(ExactlyOneAnyURI,                xsAnyURI,               exactlyOne);
64 st(ExactlyOneAtomicType,            xsAnyAtomicType,        exactlyOne);
65 st(ExactlyOneAttribute,             attribute,              exactlyOne);
66 st(ExactlyOneBase64Binary,          xsBase64Binary,         exactlyOne);
67 st(ExactlyOneBoolean,               xsBoolean,              exactlyOne);
68 st(ExactlyOneComment,               comment,                exactlyOne);
69 st(ExactlyOneDateTime,              xsDateTime,             exactlyOne);
70 st(ExactlyOneDate,                  xsDate,                 exactlyOne);
71 st(ExactlyOneDayTimeDuration,       xsDayTimeDuration,      exactlyOne);
72 st(ExactlyOneDecimal,               xsDecimal,              exactlyOne);
73 st(ExactlyOneDocumentNode,          document,               exactlyOne);
74 st(OneOrMoreDocumentNodes,          document,               oneOrMore);
75 st(ExactlyOneDouble,                xsDouble,               exactlyOne);
76 st(ExactlyOneDuration,              xsDuration,             exactlyOne);
77 st(ExactlyOneElement,               element,                exactlyOne);
78 st(ExactlyOneFloat,                 xsFloat,                exactlyOne);
79 st(ExactlyOneGDay,                  xsGDay,                 exactlyOne);
80 st(ExactlyOneGMonthDay,             xsGMonthDay,            exactlyOne);
81 st(ExactlyOneGMonth,                xsGMonth,               exactlyOne);
82 st(ExactlyOneGYearMonth,            xsGYearMonth,           exactlyOne);
83 st(ExactlyOneGYear,                 xsGYear,                exactlyOne);
84 st(ExactlyOneHexBinary,             xsHexBinary,            exactlyOne);
85 st(ExactlyOneInteger,               xsInteger,              exactlyOne);
86 st(ExactlyOneItem,                  item,                   exactlyOne);
87 st(ExactlyOneNCName,                xsNCName,               exactlyOne);
88 st(ExactlyOneNode,                  node,                   exactlyOne);
89 st(ExactlyOneNumeric,               numeric,                exactlyOne);
90 st(ExactlyOneProcessingInstruction, pi,                     exactlyOne);
91 st(ExactlyOneQName,                 xsQName,                exactlyOne);
92 st(ExactlyOneString,                xsString,               exactlyOne);
93 st(ExactlyOneTextNode,              text,                   exactlyOne);
94 st(ExactlyOneTime,                  xsTime,                 exactlyOne);
95 st(ExactlyOneUntypedAtomic,         xsUntypedAtomic,        exactlyOne);
96 st(ExactlyOneYearMonthDuration,     xsYearMonthDuration,    exactlyOne);
97 st(OneOrMoreItems,                  item,                   oneOrMore);
98 st(ZeroOrMoreAtomicTypes,           xsAnyAtomicType,        zeroOrMore);
99 st(ZeroOrMoreElements,              element,                zeroOrMore);
100 st(ZeroOrMoreIntegers,              xsInteger,              zeroOrMore);
101 st(ZeroOrMoreItems,                 item,                   zeroOrMore);
102 st(ZeroOrMoreNodes,                 node,                   zeroOrMore);
103 st(ZeroOrMoreStrings,               xsString,               zeroOrMore);
104 st(ZeroOrOneAnyURI,                 xsAnyURI,               zeroOrOne);
105 st(ZeroOrOneAtomicType,             xsAnyAtomicType,        zeroOrOne);
106 st(ZeroOrOneBoolean,                xsBoolean,              zeroOrOne);
107 st(ZeroOrOneDateTime,               xsDateTime,             zeroOrOne);
108 st(ZeroOrOneDate,                   xsDate,                 zeroOrOne);
109 st(ZeroOrOneDayTimeDuration,        xsDayTimeDuration,      zeroOrOne);
110 st(ZeroOrOneDecimal,                xsDecimal,              zeroOrOne);
111 st(ZeroOrOneDocumentNode,           document,               zeroOrOne);
112 st(ZeroOrOneDuration,               xsDuration,             zeroOrOne);
113 st(ZeroOrOneInteger,                xsInteger,              zeroOrOne);
114 st(ZeroOrOneItem,                   item,                   zeroOrOne);
115 st(ZeroOrOneNCName,                 xsNCName,               zeroOrOne);
116 st(ZeroOrOneNode,                   node,                   zeroOrOne);
117 st(ZeroOrOneNumeric,                numeric,                zeroOrOne);
118 st(ZeroOrOneQName,                  xsQName,                zeroOrOne);
119 st(ZeroOrOneString,                 xsString,               zeroOrOne);
120 st(ZeroOrOneTextNode,               text,                   zeroOrOne);
121 st(ZeroOrOneTime,                   xsTime,                 zeroOrOne);
122 st(ZeroOrOneYearMonthDuration,      xsYearMonthDuration,    zeroOrOne);
123
124 #undef st
125
126 /* Special cases. */
127 const EmptySequenceType::Ptr    CommonSequenceTypes::Empty  (new EmptySequenceType());
128 const NoneType::Ptr             CommonSequenceTypes::None   (new NoneType());
129 const SequenceType::Ptr         CommonSequenceTypes::EBV    (new EBVType());
130
131
132 QT_END_NAMESPACE