summaryrefslogtreecommitdiffstats
path: root/src/xmlpatterns/type/qatomiccasterlocators.cpp
blob: 54cd75d02458c2c66b794d346ff0ccbbe4678e4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:COMM$
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
****************************************************************************/

#include "qabstractfloatcasters_p.h"

#include "qatomiccasterlocators_p.h"

QT_BEGIN_NAMESPACE

using namespace QPatternist;

#define impl(owner, mather, type)                                                           \
AtomicTypeVisitorResult::Ptr owner::visit(const type *,                                     \
                                          const SourceLocationReflection *const) const      \
{                                                                                           \
    return AtomicTypeVisitorResult::Ptr(new mather());                                      \
}

#define implSelf(owner) impl(To##owner##CasterLocator, SelfToSelfCaster, owner##Type)

/* xs:string */
implSelf(String)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             AnyURIType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             Base64BinaryType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             BooleanType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DateTimeType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DateType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DayTimeDurationType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DecimalType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DoubleType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             DurationType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             FloatType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             GDayType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             GMonthDayType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             GMonthType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             GYearMonthType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             GYearType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             HexBinaryType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             IntegerType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             NOTATIONType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             QNameType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             SchemaTimeType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             UntypedAtomicType)
impl(ToStringCasterLocator,             ToStringCaster<TypeString>,             YearMonthDurationType)

/* xs:untypedAtomic */
implSelf(UntypedAtomic)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  AnyURIType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  Base64BinaryType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  BooleanType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DateTimeType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DateType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DayTimeDurationType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DecimalType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DoubleType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  DurationType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  FloatType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  GDayType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  GMonthDayType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  GMonthType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  GYearMonthType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  GYearType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  HexBinaryType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  IntegerType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  NOTATIONType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  QNameType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  StringType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  SchemaTimeType)
impl(ToUntypedAtomicCasterLocator,      ToUntypedAtomicCaster,                  YearMonthDurationType)

/* xs:anyURI */
implSelf(AnyURI)
impl(ToAnyURICasterLocator,             ToAnyURICaster,                         StringType)
impl(ToAnyURICasterLocator,             ToAnyURICaster,                         UntypedAtomicType)

/* xs:boolean */
implSelf(Boolean)
impl(ToBooleanCasterLocator,            NumericToBooleanCaster,                 DoubleType)
impl(ToBooleanCasterLocator,            NumericToBooleanCaster,                 FloatType)
impl(ToBooleanCasterLocator,            NumericToBooleanCaster,                 DecimalType)
impl(ToBooleanCasterLocator,            NumericToBooleanCaster,                 IntegerType)
impl(ToBooleanCasterLocator,            StringToBooleanCaster,                  StringType)
impl(ToBooleanCasterLocator,            StringToBooleanCaster,                  UntypedAtomicType)

/* xs:double */
implSelf(Double)
impl(ToDoubleCasterLocator,             BooleanToDoubleCaster,                  BooleanType)
impl(ToDoubleCasterLocator,             NumericToDoubleCaster,                  FloatType)
impl(ToDoubleCasterLocator,             NumericToDoubleCaster,                  DecimalType)
impl(ToDoubleCasterLocator,             NumericToDoubleCaster,                  IntegerType)
impl(ToDoubleCasterLocator,             StringToDoubleCaster,                   StringType)
impl(ToDoubleCasterLocator,             StringToDoubleCaster,                   UntypedAtomicType)

/* xs:float */
implSelf(Float)
impl(ToFloatCasterLocator,              BooleanToFloatCaster,                   BooleanType)
impl(ToFloatCasterLocator,              NumericToFloatCaster,                   DoubleType)
impl(ToFloatCasterLocator,              NumericToFloatCaster,                   DecimalType)
impl(ToFloatCasterLocator,              NumericToFloatCaster,                   IntegerType)
impl(ToFloatCasterLocator,              StringToFloatCaster,                    StringType)
impl(ToFloatCasterLocator,              StringToFloatCaster,                    UntypedAtomicType)

/* xs:decimal */
implSelf(Decimal)
impl(ToDecimalCasterLocator,            BooleanToDecimalCaster,                 BooleanType)
impl(ToDecimalCasterLocator,            NumericToDecimalCaster<false>,          DoubleType)
impl(ToDecimalCasterLocator,            NumericToDecimalCaster<false>,          FloatType)
impl(ToDecimalCasterLocator,            NumericToDecimalCaster<false>,          IntegerType)
impl(ToDecimalCasterLocator,            StringToDecimalCaster,                  StringType)
impl(ToDecimalCasterLocator,            StringToDecimalCaster,                  UntypedAtomicType)

/* xs:integer */
implSelf(Integer)
impl(ToIntegerCasterLocator,            BooleanToIntegerCaster,                 BooleanType)
impl(ToIntegerCasterLocator,            NumericToDecimalCaster<true>,           DoubleType)
impl(ToIntegerCasterLocator,            NumericToDecimalCaster<true>,           FloatType)
impl(ToIntegerCasterLocator,            NumericToDecimalCaster<true>,           DecimalType)
impl(ToIntegerCasterLocator,            StringToIntegerCaster,                  StringType)
impl(ToIntegerCasterLocator,            StringToIntegerCaster,                  UntypedAtomicType)

/* xs:base64binary */
implSelf(Base64Binary)
impl(ToBase64BinaryCasterLocator,       HexBinaryToBase64BinaryCaster,          HexBinaryType)
impl(ToBase64BinaryCasterLocator,       StringToBase64BinaryCaster,             StringType)
impl(ToBase64BinaryCasterLocator,       StringToBase64BinaryCaster,             UntypedAtomicType)

/* xs:hexBinary */
implSelf(HexBinary)
impl(ToHexBinaryCasterLocator,          Base64BinaryToHexBinaryCaster,          Base64BinaryType)
impl(ToHexBinaryCasterLocator,          StringToHexBinaryCaster,                StringType)
impl(ToHexBinaryCasterLocator,          StringToHexBinaryCaster,                UntypedAtomicType)

/* xs:QName */
implSelf(QName)
impl(ToQNameCasterLocator,              ToStringCaster<TypeString>,             StringType)

/* xs:gYear */
implSelf(GYear)
impl(ToGYearCasterLocator,              StringToGYearCaster,                    StringType)
impl(ToGYearCasterLocator,              StringToGYearCaster,                    UntypedAtomicType)
impl(ToGYearCasterLocator,              AbstractDateTimeToGYearCaster,          DateType)
impl(ToGYearCasterLocator,              AbstractDateTimeToGYearCaster,          DateTimeType)

/* xs:gDay */
implSelf(GDay)
impl(ToGDayCasterLocator,               StringToGDayCaster,                     StringType)
impl(ToGDayCasterLocator,               StringToGDayCaster,                     UntypedAtomicType)
impl(ToGDayCasterLocator,               AbstractDateTimeToGDayCaster,           DateType)
impl(ToGDayCasterLocator,               AbstractDateTimeToGDayCaster,           DateTimeType)

/* xs:gMonth */
implSelf(GMonth)
impl(ToGMonthCasterLocator,             StringToGMonthCaster,                   StringType)
impl(ToGMonthCasterLocator,             StringToGMonthCaster,                   UntypedAtomicType)
impl(ToGMonthCasterLocator,             AbstractDateTimeToGMonthCaster,         DateType)
impl(ToGMonthCasterLocator,             AbstractDateTimeToGMonthCaster,         DateTimeType)

/* xs:gYearMonth */
implSelf(GYearMonth)
impl(ToGYearMonthCasterLocator,         StringToGYearMonthCaster,               StringType)
impl(ToGYearMonthCasterLocator,         StringToGYearMonthCaster,               UntypedAtomicType)
impl(ToGYearMonthCasterLocator,         AbstractDateTimeToGYearMonthCaster,     DateType)
impl(ToGYearMonthCasterLocator,         AbstractDateTimeToGYearMonthCaster,     DateTimeType)

/* xs:gMonthDay */
implSelf(GMonthDay)
impl(ToGMonthDayCasterLocator,          StringToGMonthDayCaster,                StringType)
impl(ToGMonthDayCasterLocator,          StringToGMonthDayCaster,                UntypedAtomicType)
impl(ToGMonthDayCasterLocator,          AbstractDateTimeToGMonthDayCaster,      DateType)
impl(ToGMonthDayCasterLocator,          AbstractDateTimeToGMonthDayCaster,      DateTimeType)

/* xs:dateTime */
implSelf(DateTime)
impl(ToDateTimeCasterLocator,           StringToDateTimeCaster,                 StringType)
impl(ToDateTimeCasterLocator,           AbstractDateTimeToDateTimeCaster,       DateType)
impl(ToDateTimeCasterLocator,           StringToDateTimeCaster,                 UntypedAtomicType)

/* xs:time */
implSelf(SchemaTime)
impl(ToSchemaTimeCasterLocator,         StringToTimeCaster,                     StringType)
impl(ToSchemaTimeCasterLocator,         AbstractDateTimeToTimeCaster,           DateTimeType)
impl(ToSchemaTimeCasterLocator,         StringToTimeCaster,                     UntypedAtomicType)

/* xs:date */
implSelf(Date)
impl(ToDateCasterLocator,               StringToDateCaster,                     StringType)
impl(ToDateCasterLocator,               AbstractDateTimeToDateCaster,           DateTimeType)
impl(ToDateCasterLocator,               StringToDateCaster,                     UntypedAtomicType)

/* xs:duration */
implSelf(Duration)
impl(ToDurationCasterLocator,           AbstractDurationToDurationCaster,       DayTimeDurationType)
impl(ToDurationCasterLocator,           AbstractDurationToDurationCaster,       YearMonthDurationType)
impl(ToDurationCasterLocator,           StringToDurationCaster,                 StringType)
impl(ToDurationCasterLocator,           StringToDurationCaster,                 UntypedAtomicType)

/* xs:dayTimeDuration */
implSelf(DayTimeDuration)
impl(ToDayTimeDurationCasterLocator,    AbstractDurationToDayTimeDurationCaster,    DurationType)
impl(ToDayTimeDurationCasterLocator,    AbstractDurationToDayTimeDurationCaster,    YearMonthDurationType)
impl(ToDayTimeDurationCasterLocator,    StringToDayTimeDurationCaster,              StringType)
impl(ToDayTimeDurationCasterLocator,    StringToDayTimeDurationCaster,              UntypedAtomicType)

/* xs:yearMonthDuration */
implSelf(YearMonthDuration)
impl(ToYearMonthDurationCasterLocator,  AbstractDurationToYearMonthDurationCaster,  DayTimeDurationType)
impl(ToYearMonthDurationCasterLocator,  AbstractDurationToYearMonthDurationCaster,  DurationType)
impl(ToYearMonthDurationCasterLocator,  StringToYearMonthDurationCaster,            StringType)
impl(ToYearMonthDurationCasterLocator,  StringToYearMonthDurationCaster,            UntypedAtomicType)

#undef implSelf
#undef impl

QT_END_NAMESPACE