1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #include "qabstractfloatcasters_p.h"
44 #include "qatomiccasterlocators_p.h"
48 using namespace QPatternist;
50 #define impl(owner, mather, type) \
51 AtomicTypeVisitorResult::Ptr owner::visit(const type *, \
52 const SourceLocationReflection *const) const \
54 return AtomicTypeVisitorResult::Ptr(new mather()); \
57 #define implSelf(owner) impl(To##owner##CasterLocator, SelfToSelfCaster, owner##Type)
61 impl(ToStringCasterLocator, ToStringCaster<TypeString>, AnyURIType)
62 impl(ToStringCasterLocator, ToStringCaster<TypeString>, Base64BinaryType)
63 impl(ToStringCasterLocator, ToStringCaster<TypeString>, BooleanType)
64 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DateTimeType)
65 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DateType)
66 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DayTimeDurationType)
67 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DecimalType)
68 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DoubleType)
69 impl(ToStringCasterLocator, ToStringCaster<TypeString>, DurationType)
70 impl(ToStringCasterLocator, ToStringCaster<TypeString>, FloatType)
71 impl(ToStringCasterLocator, ToStringCaster<TypeString>, GDayType)
72 impl(ToStringCasterLocator, ToStringCaster<TypeString>, GMonthDayType)
73 impl(ToStringCasterLocator, ToStringCaster<TypeString>, GMonthType)
74 impl(ToStringCasterLocator, ToStringCaster<TypeString>, GYearMonthType)
75 impl(ToStringCasterLocator, ToStringCaster<TypeString>, GYearType)
76 impl(ToStringCasterLocator, ToStringCaster<TypeString>, HexBinaryType)
77 impl(ToStringCasterLocator, ToStringCaster<TypeString>, IntegerType)
78 impl(ToStringCasterLocator, ToStringCaster<TypeString>, NOTATIONType)
79 impl(ToStringCasterLocator, ToStringCaster<TypeString>, QNameType)
80 impl(ToStringCasterLocator, ToStringCaster<TypeString>, SchemaTimeType)
81 impl(ToStringCasterLocator, ToStringCaster<TypeString>, UntypedAtomicType)
82 impl(ToStringCasterLocator, ToStringCaster<TypeString>, YearMonthDurationType)
84 /* xs:untypedAtomic */
85 implSelf(UntypedAtomic)
86 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, AnyURIType)
87 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, Base64BinaryType)
88 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, BooleanType)
89 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DateTimeType)
90 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DateType)
91 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DayTimeDurationType)
92 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DecimalType)
93 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DoubleType)
94 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, DurationType)
95 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, FloatType)
96 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, GDayType)
97 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, GMonthDayType)
98 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, GMonthType)
99 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, GYearMonthType)
100 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, GYearType)
101 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, HexBinaryType)
102 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, IntegerType)
103 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, NOTATIONType)
104 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, QNameType)
105 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, StringType)
106 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, SchemaTimeType)
107 impl(ToUntypedAtomicCasterLocator, ToUntypedAtomicCaster, YearMonthDurationType)
111 impl(ToAnyURICasterLocator, ToAnyURICaster, StringType)
112 impl(ToAnyURICasterLocator, ToAnyURICaster, UntypedAtomicType)
116 impl(ToBooleanCasterLocator, NumericToBooleanCaster, DoubleType)
117 impl(ToBooleanCasterLocator, NumericToBooleanCaster, FloatType)
118 impl(ToBooleanCasterLocator, NumericToBooleanCaster, DecimalType)
119 impl(ToBooleanCasterLocator, NumericToBooleanCaster, IntegerType)
120 impl(ToBooleanCasterLocator, StringToBooleanCaster, StringType)
121 impl(ToBooleanCasterLocator, StringToBooleanCaster, UntypedAtomicType)
125 impl(ToDoubleCasterLocator, BooleanToDoubleCaster, BooleanType)
126 impl(ToDoubleCasterLocator, NumericToDoubleCaster, FloatType)
127 impl(ToDoubleCasterLocator, NumericToDoubleCaster, DecimalType)
128 impl(ToDoubleCasterLocator, NumericToDoubleCaster, IntegerType)
129 impl(ToDoubleCasterLocator, StringToDoubleCaster, StringType)
130 impl(ToDoubleCasterLocator, StringToDoubleCaster, UntypedAtomicType)
134 impl(ToFloatCasterLocator, BooleanToFloatCaster, BooleanType)
135 impl(ToFloatCasterLocator, NumericToFloatCaster, DoubleType)
136 impl(ToFloatCasterLocator, NumericToFloatCaster, DecimalType)
137 impl(ToFloatCasterLocator, NumericToFloatCaster, IntegerType)
138 impl(ToFloatCasterLocator, StringToFloatCaster, StringType)
139 impl(ToFloatCasterLocator, StringToFloatCaster, UntypedAtomicType)
143 impl(ToDecimalCasterLocator, BooleanToDecimalCaster, BooleanType)
144 impl(ToDecimalCasterLocator, NumericToDecimalCaster<false>, DoubleType)
145 impl(ToDecimalCasterLocator, NumericToDecimalCaster<false>, FloatType)
146 impl(ToDecimalCasterLocator, NumericToDecimalCaster<false>, IntegerType)
147 impl(ToDecimalCasterLocator, StringToDecimalCaster, StringType)
148 impl(ToDecimalCasterLocator, StringToDecimalCaster, UntypedAtomicType)
152 impl(ToIntegerCasterLocator, BooleanToIntegerCaster, BooleanType)
153 impl(ToIntegerCasterLocator, NumericToDecimalCaster<true>, DoubleType)
154 impl(ToIntegerCasterLocator, NumericToDecimalCaster<true>, FloatType)
155 impl(ToIntegerCasterLocator, NumericToDecimalCaster<true>, DecimalType)
156 impl(ToIntegerCasterLocator, StringToIntegerCaster, StringType)
157 impl(ToIntegerCasterLocator, StringToIntegerCaster, UntypedAtomicType)
159 /* xs:base64binary */
160 implSelf(Base64Binary)
161 impl(ToBase64BinaryCasterLocator, HexBinaryToBase64BinaryCaster, HexBinaryType)
162 impl(ToBase64BinaryCasterLocator, StringToBase64BinaryCaster, StringType)
163 impl(ToBase64BinaryCasterLocator, StringToBase64BinaryCaster, UntypedAtomicType)
167 impl(ToHexBinaryCasterLocator, Base64BinaryToHexBinaryCaster, Base64BinaryType)
168 impl(ToHexBinaryCasterLocator, StringToHexBinaryCaster, StringType)
169 impl(ToHexBinaryCasterLocator, StringToHexBinaryCaster, UntypedAtomicType)
173 impl(ToQNameCasterLocator, ToStringCaster<TypeString>, StringType)
177 impl(ToGYearCasterLocator, StringToGYearCaster, StringType)
178 impl(ToGYearCasterLocator, StringToGYearCaster, UntypedAtomicType)
179 impl(ToGYearCasterLocator, AbstractDateTimeToGYearCaster, DateType)
180 impl(ToGYearCasterLocator, AbstractDateTimeToGYearCaster, DateTimeType)
184 impl(ToGDayCasterLocator, StringToGDayCaster, StringType)
185 impl(ToGDayCasterLocator, StringToGDayCaster, UntypedAtomicType)
186 impl(ToGDayCasterLocator, AbstractDateTimeToGDayCaster, DateType)
187 impl(ToGDayCasterLocator, AbstractDateTimeToGDayCaster, DateTimeType)
191 impl(ToGMonthCasterLocator, StringToGMonthCaster, StringType)
192 impl(ToGMonthCasterLocator, StringToGMonthCaster, UntypedAtomicType)
193 impl(ToGMonthCasterLocator, AbstractDateTimeToGMonthCaster, DateType)
194 impl(ToGMonthCasterLocator, AbstractDateTimeToGMonthCaster, DateTimeType)
198 impl(ToGYearMonthCasterLocator, StringToGYearMonthCaster, StringType)
199 impl(ToGYearMonthCasterLocator, StringToGYearMonthCaster, UntypedAtomicType)
200 impl(ToGYearMonthCasterLocator, AbstractDateTimeToGYearMonthCaster, DateType)
201 impl(ToGYearMonthCasterLocator, AbstractDateTimeToGYearMonthCaster, DateTimeType)
205 impl(ToGMonthDayCasterLocator, StringToGMonthDayCaster, StringType)
206 impl(ToGMonthDayCasterLocator, StringToGMonthDayCaster, UntypedAtomicType)
207 impl(ToGMonthDayCasterLocator, AbstractDateTimeToGMonthDayCaster, DateType)
208 impl(ToGMonthDayCasterLocator, AbstractDateTimeToGMonthDayCaster, DateTimeType)
212 impl(ToDateTimeCasterLocator, StringToDateTimeCaster, StringType)
213 impl(ToDateTimeCasterLocator, AbstractDateTimeToDateTimeCaster, DateType)
214 impl(ToDateTimeCasterLocator, StringToDateTimeCaster, UntypedAtomicType)
218 impl(ToSchemaTimeCasterLocator, StringToTimeCaster, StringType)
219 impl(ToSchemaTimeCasterLocator, AbstractDateTimeToTimeCaster, DateTimeType)
220 impl(ToSchemaTimeCasterLocator, StringToTimeCaster, UntypedAtomicType)
224 impl(ToDateCasterLocator, StringToDateCaster, StringType)
225 impl(ToDateCasterLocator, AbstractDateTimeToDateCaster, DateTimeType)
226 impl(ToDateCasterLocator, StringToDateCaster, UntypedAtomicType)
230 impl(ToDurationCasterLocator, AbstractDurationToDurationCaster, DayTimeDurationType)
231 impl(ToDurationCasterLocator, AbstractDurationToDurationCaster, YearMonthDurationType)
232 impl(ToDurationCasterLocator, StringToDurationCaster, StringType)
233 impl(ToDurationCasterLocator, StringToDurationCaster, UntypedAtomicType)
235 /* xs:dayTimeDuration */
236 implSelf(DayTimeDuration)
237 impl(ToDayTimeDurationCasterLocator, AbstractDurationToDayTimeDurationCaster, DurationType)
238 impl(ToDayTimeDurationCasterLocator, AbstractDurationToDayTimeDurationCaster, YearMonthDurationType)
239 impl(ToDayTimeDurationCasterLocator, StringToDayTimeDurationCaster, StringType)
240 impl(ToDayTimeDurationCasterLocator, StringToDayTimeDurationCaster, UntypedAtomicType)
242 /* xs:yearMonthDuration */
243 implSelf(YearMonthDuration)
244 impl(ToYearMonthDurationCasterLocator, AbstractDurationToYearMonthDurationCaster, DayTimeDurationType)
245 impl(ToYearMonthDurationCasterLocator, AbstractDurationToYearMonthDurationCaster, DurationType)
246 impl(ToYearMonthDurationCasterLocator, StringToYearMonthDurationCaster, StringType)
247 impl(ToYearMonthDurationCasterLocator, StringToYearMonthDurationCaster, UntypedAtomicType)