Update obsolete contact address.
[profile/ivi/qtxmlpatterns.git] / src / xmlpatterns / type / qatomiccasterlocators.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
6 **
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 **
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.
17 **
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.
21 **
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.
29 **
30 ** Other Usage
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.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qabstractfloatcasters_p.h"
43
44 #include "qatomiccasterlocators_p.h"
45
46 QT_BEGIN_NAMESPACE
47
48 using namespace QPatternist;
49
50 #define impl(owner, mather, type)                                                           \
51 AtomicTypeVisitorResult::Ptr owner::visit(const type *,                                     \
52                                           const SourceLocationReflection *const) const      \
53 {                                                                                           \
54     return AtomicTypeVisitorResult::Ptr(new mather());                                      \
55 }
56
57 #define implSelf(owner) impl(To##owner##CasterLocator, SelfToSelfCaster, owner##Type)
58
59 /* xs:string */
60 implSelf(String)
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)
83
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)
108
109 /* xs:anyURI */
110 implSelf(AnyURI)
111 impl(ToAnyURICasterLocator,             ToAnyURICaster,                         StringType)
112 impl(ToAnyURICasterLocator,             ToAnyURICaster,                         UntypedAtomicType)
113
114 /* xs:boolean */
115 implSelf(Boolean)
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)
122
123 /* xs:double */
124 implSelf(Double)
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)
131
132 /* xs:float */
133 implSelf(Float)
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)
140
141 /* xs:decimal */
142 implSelf(Decimal)
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)
149
150 /* xs:integer */
151 implSelf(Integer)
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)
158
159 /* xs:base64binary */
160 implSelf(Base64Binary)
161 impl(ToBase64BinaryCasterLocator,       HexBinaryToBase64BinaryCaster,          HexBinaryType)
162 impl(ToBase64BinaryCasterLocator,       StringToBase64BinaryCaster,             StringType)
163 impl(ToBase64BinaryCasterLocator,       StringToBase64BinaryCaster,             UntypedAtomicType)
164
165 /* xs:hexBinary */
166 implSelf(HexBinary)
167 impl(ToHexBinaryCasterLocator,          Base64BinaryToHexBinaryCaster,          Base64BinaryType)
168 impl(ToHexBinaryCasterLocator,          StringToHexBinaryCaster,                StringType)
169 impl(ToHexBinaryCasterLocator,          StringToHexBinaryCaster,                UntypedAtomicType)
170
171 /* xs:QName */
172 implSelf(QName)
173 impl(ToQNameCasterLocator,              ToStringCaster<TypeString>,             StringType)
174
175 /* xs:gYear */
176 implSelf(GYear)
177 impl(ToGYearCasterLocator,              StringToGYearCaster,                    StringType)
178 impl(ToGYearCasterLocator,              StringToGYearCaster,                    UntypedAtomicType)
179 impl(ToGYearCasterLocator,              AbstractDateTimeToGYearCaster,          DateType)
180 impl(ToGYearCasterLocator,              AbstractDateTimeToGYearCaster,          DateTimeType)
181
182 /* xs:gDay */
183 implSelf(GDay)
184 impl(ToGDayCasterLocator,               StringToGDayCaster,                     StringType)
185 impl(ToGDayCasterLocator,               StringToGDayCaster,                     UntypedAtomicType)
186 impl(ToGDayCasterLocator,               AbstractDateTimeToGDayCaster,           DateType)
187 impl(ToGDayCasterLocator,               AbstractDateTimeToGDayCaster,           DateTimeType)
188
189 /* xs:gMonth */
190 implSelf(GMonth)
191 impl(ToGMonthCasterLocator,             StringToGMonthCaster,                   StringType)
192 impl(ToGMonthCasterLocator,             StringToGMonthCaster,                   UntypedAtomicType)
193 impl(ToGMonthCasterLocator,             AbstractDateTimeToGMonthCaster,         DateType)
194 impl(ToGMonthCasterLocator,             AbstractDateTimeToGMonthCaster,         DateTimeType)
195
196 /* xs:gYearMonth */
197 implSelf(GYearMonth)
198 impl(ToGYearMonthCasterLocator,         StringToGYearMonthCaster,               StringType)
199 impl(ToGYearMonthCasterLocator,         StringToGYearMonthCaster,               UntypedAtomicType)
200 impl(ToGYearMonthCasterLocator,         AbstractDateTimeToGYearMonthCaster,     DateType)
201 impl(ToGYearMonthCasterLocator,         AbstractDateTimeToGYearMonthCaster,     DateTimeType)
202
203 /* xs:gMonthDay */
204 implSelf(GMonthDay)
205 impl(ToGMonthDayCasterLocator,          StringToGMonthDayCaster,                StringType)
206 impl(ToGMonthDayCasterLocator,          StringToGMonthDayCaster,                UntypedAtomicType)
207 impl(ToGMonthDayCasterLocator,          AbstractDateTimeToGMonthDayCaster,      DateType)
208 impl(ToGMonthDayCasterLocator,          AbstractDateTimeToGMonthDayCaster,      DateTimeType)
209
210 /* xs:dateTime */
211 implSelf(DateTime)
212 impl(ToDateTimeCasterLocator,           StringToDateTimeCaster,                 StringType)
213 impl(ToDateTimeCasterLocator,           AbstractDateTimeToDateTimeCaster,       DateType)
214 impl(ToDateTimeCasterLocator,           StringToDateTimeCaster,                 UntypedAtomicType)
215
216 /* xs:time */
217 implSelf(SchemaTime)
218 impl(ToSchemaTimeCasterLocator,         StringToTimeCaster,                     StringType)
219 impl(ToSchemaTimeCasterLocator,         AbstractDateTimeToTimeCaster,           DateTimeType)
220 impl(ToSchemaTimeCasterLocator,         StringToTimeCaster,                     UntypedAtomicType)
221
222 /* xs:date */
223 implSelf(Date)
224 impl(ToDateCasterLocator,               StringToDateCaster,                     StringType)
225 impl(ToDateCasterLocator,               AbstractDateTimeToDateCaster,           DateTimeType)
226 impl(ToDateCasterLocator,               StringToDateCaster,                     UntypedAtomicType)
227
228 /* xs:duration */
229 implSelf(Duration)
230 impl(ToDurationCasterLocator,           AbstractDurationToDurationCaster,       DayTimeDurationType)
231 impl(ToDurationCasterLocator,           AbstractDurationToDurationCaster,       YearMonthDurationType)
232 impl(ToDurationCasterLocator,           StringToDurationCaster,                 StringType)
233 impl(ToDurationCasterLocator,           StringToDurationCaster,                 UntypedAtomicType)
234
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)
241
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)
248
249 #undef implSelf
250 #undef impl
251
252 QT_END_NAMESPACE