1 | // file : xsd/cxx/parser/validating/xml-schema-pimpl.ixx |
---|
2 | // author : Boris Kolpackov <boris@codesynthesis.com> |
---|
3 | // copyright : Copyright (c) 2005-2008 Code Synthesis Tools CC |
---|
4 | // license : GNU GPL v2 + exceptions; see accompanying LICENSE file |
---|
5 | |
---|
6 | #if defined(XSD_CXX_PARSER_USE_CHAR) || !defined(XSD_CXX_PARSER_USE_WCHAR) |
---|
7 | |
---|
8 | #ifndef XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_CHAR |
---|
9 | #define XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_CHAR |
---|
10 | |
---|
11 | namespace xsd |
---|
12 | { |
---|
13 | namespace cxx |
---|
14 | { |
---|
15 | namespace parser |
---|
16 | { |
---|
17 | namespace validating |
---|
18 | { |
---|
19 | namespace bits |
---|
20 | { |
---|
21 | template<> |
---|
22 | inline const char* |
---|
23 | boolean<char> () |
---|
24 | { |
---|
25 | return "boolean"; |
---|
26 | } |
---|
27 | |
---|
28 | template<> |
---|
29 | inline const char* |
---|
30 | byte<char> () |
---|
31 | { |
---|
32 | return "byte"; |
---|
33 | } |
---|
34 | |
---|
35 | template<> |
---|
36 | inline const char* |
---|
37 | unsigned_byte<char> () |
---|
38 | { |
---|
39 | return "unsignedByte"; |
---|
40 | } |
---|
41 | |
---|
42 | template<> |
---|
43 | inline const char* |
---|
44 | short_<char> () |
---|
45 | { |
---|
46 | return "short"; |
---|
47 | } |
---|
48 | |
---|
49 | template<> |
---|
50 | inline const char* |
---|
51 | unsigned_short<char> () |
---|
52 | { |
---|
53 | return "unsignedShort"; |
---|
54 | } |
---|
55 | |
---|
56 | template<> |
---|
57 | inline const char* |
---|
58 | int_<char> () |
---|
59 | { |
---|
60 | return "int"; |
---|
61 | } |
---|
62 | |
---|
63 | template<> |
---|
64 | inline const char* |
---|
65 | unsigned_int<char> () |
---|
66 | { |
---|
67 | return "unsignedInt"; |
---|
68 | } |
---|
69 | |
---|
70 | template<> |
---|
71 | inline const char* |
---|
72 | long_<char> () |
---|
73 | { |
---|
74 | return "long"; |
---|
75 | } |
---|
76 | |
---|
77 | template<> |
---|
78 | inline const char* |
---|
79 | unsigned_long<char> () |
---|
80 | { |
---|
81 | return "unsignedLong"; |
---|
82 | } |
---|
83 | |
---|
84 | template<> |
---|
85 | inline const char* |
---|
86 | integer<char> () |
---|
87 | { |
---|
88 | return "integer"; |
---|
89 | } |
---|
90 | |
---|
91 | template<> |
---|
92 | inline const char* |
---|
93 | negative_integer<char> () |
---|
94 | { |
---|
95 | return "negativeInteger"; |
---|
96 | } |
---|
97 | |
---|
98 | template<> |
---|
99 | inline const char* |
---|
100 | non_positive_integer<char> () |
---|
101 | { |
---|
102 | return "nonPositiveInteger"; |
---|
103 | } |
---|
104 | |
---|
105 | template<> |
---|
106 | inline const char* |
---|
107 | non_negative_integer<char> () |
---|
108 | { |
---|
109 | return "nonNegativeInteger"; |
---|
110 | } |
---|
111 | |
---|
112 | template<> |
---|
113 | inline const char* |
---|
114 | positive_integer<char> () |
---|
115 | { |
---|
116 | return "positiveInteger"; |
---|
117 | } |
---|
118 | |
---|
119 | template<> |
---|
120 | inline const char* |
---|
121 | float_<char> () |
---|
122 | { |
---|
123 | return "float"; |
---|
124 | } |
---|
125 | |
---|
126 | template<> |
---|
127 | inline const char* |
---|
128 | double_<char> () |
---|
129 | { |
---|
130 | return "double"; |
---|
131 | } |
---|
132 | |
---|
133 | template<> |
---|
134 | inline const char* |
---|
135 | decimal<char> () |
---|
136 | { |
---|
137 | return "decimal"; |
---|
138 | } |
---|
139 | |
---|
140 | template<> |
---|
141 | inline const char* |
---|
142 | name<char> () |
---|
143 | { |
---|
144 | return "Name"; |
---|
145 | } |
---|
146 | |
---|
147 | template<> |
---|
148 | inline const char* |
---|
149 | nmtoken<char> () |
---|
150 | { |
---|
151 | return "NMTOKEN"; |
---|
152 | } |
---|
153 | |
---|
154 | template<> |
---|
155 | inline const char* |
---|
156 | nmtokens<char> () |
---|
157 | { |
---|
158 | return "NMTOKENS"; |
---|
159 | } |
---|
160 | |
---|
161 | template<> |
---|
162 | inline const char* |
---|
163 | ncname<char> () |
---|
164 | { |
---|
165 | return "NCName"; |
---|
166 | } |
---|
167 | |
---|
168 | template<> |
---|
169 | inline const char* |
---|
170 | idrefs<char> () |
---|
171 | { |
---|
172 | return "IDREFS"; |
---|
173 | } |
---|
174 | |
---|
175 | template<> |
---|
176 | inline const char* |
---|
177 | language<char> () |
---|
178 | { |
---|
179 | return "language"; |
---|
180 | } |
---|
181 | |
---|
182 | template<> |
---|
183 | inline const char* |
---|
184 | qname<char> () |
---|
185 | { |
---|
186 | return "QName"; |
---|
187 | } |
---|
188 | |
---|
189 | template<> |
---|
190 | inline const char* |
---|
191 | base64_binary<char> () |
---|
192 | { |
---|
193 | return "base64Binary"; |
---|
194 | } |
---|
195 | |
---|
196 | template<> |
---|
197 | inline const char* |
---|
198 | hex_binary<char> () |
---|
199 | { |
---|
200 | return "hexBinary"; |
---|
201 | } |
---|
202 | |
---|
203 | template<> |
---|
204 | inline const char* |
---|
205 | gday<char> () |
---|
206 | { |
---|
207 | return "gDay"; |
---|
208 | } |
---|
209 | |
---|
210 | template<> |
---|
211 | inline const char* |
---|
212 | gmonth<char> () |
---|
213 | { |
---|
214 | return "gMonth"; |
---|
215 | } |
---|
216 | |
---|
217 | template<> |
---|
218 | inline const char* |
---|
219 | gyear<char> () |
---|
220 | { |
---|
221 | return "gYear"; |
---|
222 | } |
---|
223 | |
---|
224 | template<> |
---|
225 | inline const char* |
---|
226 | gmonth_day<char> () |
---|
227 | { |
---|
228 | return "gMonthDay"; |
---|
229 | } |
---|
230 | |
---|
231 | template<> |
---|
232 | inline const char* |
---|
233 | gyear_month<char> () |
---|
234 | { |
---|
235 | return "gYearMonth"; |
---|
236 | } |
---|
237 | |
---|
238 | template<> |
---|
239 | inline const char* |
---|
240 | date<char> () |
---|
241 | { |
---|
242 | return "date"; |
---|
243 | } |
---|
244 | |
---|
245 | template<> |
---|
246 | inline const char* |
---|
247 | time<char> () |
---|
248 | { |
---|
249 | return "time"; |
---|
250 | } |
---|
251 | |
---|
252 | template<> |
---|
253 | inline const char* |
---|
254 | date_time<char> () |
---|
255 | { |
---|
256 | return "dateTime"; |
---|
257 | } |
---|
258 | |
---|
259 | template<> |
---|
260 | inline const char* |
---|
261 | duration<char> () |
---|
262 | { |
---|
263 | return "duration"; |
---|
264 | } |
---|
265 | |
---|
266 | // |
---|
267 | // |
---|
268 | template<> |
---|
269 | inline const char* |
---|
270 | positive_inf<char> () |
---|
271 | { |
---|
272 | return "INF"; |
---|
273 | } |
---|
274 | |
---|
275 | template<> |
---|
276 | inline const char* |
---|
277 | negative_inf<char> () |
---|
278 | { |
---|
279 | return "-INF"; |
---|
280 | } |
---|
281 | |
---|
282 | template<> |
---|
283 | inline const char* |
---|
284 | nan<char> () |
---|
285 | { |
---|
286 | return "NaN"; |
---|
287 | } |
---|
288 | |
---|
289 | // |
---|
290 | // |
---|
291 | template<> |
---|
292 | inline const char* |
---|
293 | true_<char> () |
---|
294 | { |
---|
295 | return "true"; |
---|
296 | } |
---|
297 | |
---|
298 | template<> |
---|
299 | inline const char* |
---|
300 | false_<char> () |
---|
301 | { |
---|
302 | return "false"; |
---|
303 | } |
---|
304 | |
---|
305 | template<> |
---|
306 | inline const char* |
---|
307 | one<char> () |
---|
308 | { |
---|
309 | return "1"; |
---|
310 | } |
---|
311 | |
---|
312 | template<> |
---|
313 | inline const char* |
---|
314 | zero<char> () |
---|
315 | { |
---|
316 | return "0"; |
---|
317 | } |
---|
318 | } |
---|
319 | } |
---|
320 | } |
---|
321 | } |
---|
322 | } |
---|
323 | |
---|
324 | #endif // XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_CHAR |
---|
325 | #endif // XSD_CXX_PARSER_USE_CHAR |
---|
326 | |
---|
327 | |
---|
328 | #if defined(XSD_CXX_PARSER_USE_WCHAR) || !defined(XSD_CXX_PARSER_USE_CHAR) |
---|
329 | |
---|
330 | #ifndef XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_WCHAR |
---|
331 | #define XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_WCHAR |
---|
332 | |
---|
333 | namespace xsd |
---|
334 | { |
---|
335 | namespace cxx |
---|
336 | { |
---|
337 | namespace parser |
---|
338 | { |
---|
339 | namespace validating |
---|
340 | { |
---|
341 | namespace bits |
---|
342 | { |
---|
343 | template<> |
---|
344 | inline const wchar_t* |
---|
345 | boolean<wchar_t> () |
---|
346 | { |
---|
347 | return L"boolean"; |
---|
348 | } |
---|
349 | |
---|
350 | template<> |
---|
351 | inline const wchar_t* |
---|
352 | byte<wchar_t> () |
---|
353 | { |
---|
354 | return L"byte"; |
---|
355 | } |
---|
356 | |
---|
357 | template<> |
---|
358 | inline const wchar_t* |
---|
359 | unsigned_byte<wchar_t> () |
---|
360 | { |
---|
361 | return L"unsignedByte"; |
---|
362 | } |
---|
363 | |
---|
364 | template<> |
---|
365 | inline const wchar_t* |
---|
366 | short_<wchar_t> () |
---|
367 | { |
---|
368 | return L"short"; |
---|
369 | } |
---|
370 | |
---|
371 | template<> |
---|
372 | inline const wchar_t* |
---|
373 | unsigned_short<wchar_t> () |
---|
374 | { |
---|
375 | return L"unsignedShort"; |
---|
376 | } |
---|
377 | |
---|
378 | template<> |
---|
379 | inline const wchar_t* |
---|
380 | int_<wchar_t> () |
---|
381 | { |
---|
382 | return L"int"; |
---|
383 | } |
---|
384 | |
---|
385 | template<> |
---|
386 | inline const wchar_t* |
---|
387 | unsigned_int<wchar_t> () |
---|
388 | { |
---|
389 | return L"unsignedInt"; |
---|
390 | } |
---|
391 | |
---|
392 | template<> |
---|
393 | inline const wchar_t* |
---|
394 | long_<wchar_t> () |
---|
395 | { |
---|
396 | return L"long"; |
---|
397 | } |
---|
398 | |
---|
399 | template<> |
---|
400 | inline const wchar_t* |
---|
401 | unsigned_long<wchar_t> () |
---|
402 | { |
---|
403 | return L"unsignedLong"; |
---|
404 | } |
---|
405 | |
---|
406 | template<> |
---|
407 | inline const wchar_t* |
---|
408 | integer<wchar_t> () |
---|
409 | { |
---|
410 | return L"integer"; |
---|
411 | } |
---|
412 | |
---|
413 | template<> |
---|
414 | inline const wchar_t* |
---|
415 | negative_integer<wchar_t> () |
---|
416 | { |
---|
417 | return L"negativeInteger"; |
---|
418 | } |
---|
419 | |
---|
420 | template<> |
---|
421 | inline const wchar_t* |
---|
422 | non_positive_integer<wchar_t> () |
---|
423 | { |
---|
424 | return L"nonPositiveInteger"; |
---|
425 | } |
---|
426 | |
---|
427 | template<> |
---|
428 | inline const wchar_t* |
---|
429 | non_negative_integer<wchar_t> () |
---|
430 | { |
---|
431 | return L"nonNegativeInteger"; |
---|
432 | } |
---|
433 | |
---|
434 | template<> |
---|
435 | inline const wchar_t* |
---|
436 | positive_integer<wchar_t> () |
---|
437 | { |
---|
438 | return L"positiveInteger"; |
---|
439 | } |
---|
440 | |
---|
441 | template<> |
---|
442 | inline const wchar_t* |
---|
443 | float_<wchar_t> () |
---|
444 | { |
---|
445 | return L"float"; |
---|
446 | } |
---|
447 | |
---|
448 | template<> |
---|
449 | inline const wchar_t* |
---|
450 | double_<wchar_t> () |
---|
451 | { |
---|
452 | return L"double"; |
---|
453 | } |
---|
454 | |
---|
455 | template<> |
---|
456 | inline const wchar_t* |
---|
457 | decimal<wchar_t> () |
---|
458 | { |
---|
459 | return L"decimal"; |
---|
460 | } |
---|
461 | |
---|
462 | template<> |
---|
463 | inline const wchar_t* |
---|
464 | name<wchar_t> () |
---|
465 | { |
---|
466 | return L"Name"; |
---|
467 | } |
---|
468 | |
---|
469 | template<> |
---|
470 | inline const wchar_t* |
---|
471 | nmtoken<wchar_t> () |
---|
472 | { |
---|
473 | return L"NMTOKEN"; |
---|
474 | } |
---|
475 | |
---|
476 | template<> |
---|
477 | inline const wchar_t* |
---|
478 | nmtokens<wchar_t> () |
---|
479 | { |
---|
480 | return L"SNMTOKEN"; |
---|
481 | } |
---|
482 | |
---|
483 | template<> |
---|
484 | inline const wchar_t* |
---|
485 | ncname<wchar_t> () |
---|
486 | { |
---|
487 | return L"NCName"; |
---|
488 | } |
---|
489 | |
---|
490 | template<> |
---|
491 | inline const wchar_t* |
---|
492 | idrefs<wchar_t> () |
---|
493 | { |
---|
494 | return L"IDREFS"; |
---|
495 | } |
---|
496 | |
---|
497 | template<> |
---|
498 | inline const wchar_t* |
---|
499 | language<wchar_t> () |
---|
500 | { |
---|
501 | return L"language"; |
---|
502 | } |
---|
503 | |
---|
504 | template<> |
---|
505 | inline const wchar_t* |
---|
506 | qname<wchar_t> () |
---|
507 | { |
---|
508 | return L"QName"; |
---|
509 | } |
---|
510 | |
---|
511 | template<> |
---|
512 | inline const wchar_t* |
---|
513 | base64_binary<wchar_t> () |
---|
514 | { |
---|
515 | return L"base64Binary"; |
---|
516 | } |
---|
517 | |
---|
518 | template<> |
---|
519 | inline const wchar_t* |
---|
520 | hex_binary<wchar_t> () |
---|
521 | { |
---|
522 | return L"hexBinary"; |
---|
523 | } |
---|
524 | |
---|
525 | template<> |
---|
526 | inline const wchar_t* |
---|
527 | gday<wchar_t> () |
---|
528 | { |
---|
529 | return L"gDay"; |
---|
530 | } |
---|
531 | |
---|
532 | template<> |
---|
533 | inline const wchar_t* |
---|
534 | gmonth<wchar_t> () |
---|
535 | { |
---|
536 | return L"gMonth"; |
---|
537 | } |
---|
538 | |
---|
539 | template<> |
---|
540 | inline const wchar_t* |
---|
541 | gyear<wchar_t> () |
---|
542 | { |
---|
543 | return L"gYear"; |
---|
544 | } |
---|
545 | |
---|
546 | template<> |
---|
547 | inline const wchar_t* |
---|
548 | gmonth_day<wchar_t> () |
---|
549 | { |
---|
550 | return L"gMonthDay"; |
---|
551 | } |
---|
552 | |
---|
553 | template<> |
---|
554 | inline const wchar_t* |
---|
555 | gyear_month<wchar_t> () |
---|
556 | { |
---|
557 | return L"gYearMonth"; |
---|
558 | } |
---|
559 | |
---|
560 | template<> |
---|
561 | inline const wchar_t* |
---|
562 | date<wchar_t> () |
---|
563 | { |
---|
564 | return L"date"; |
---|
565 | } |
---|
566 | |
---|
567 | template<> |
---|
568 | inline const wchar_t* |
---|
569 | time<wchar_t> () |
---|
570 | { |
---|
571 | return L"time"; |
---|
572 | } |
---|
573 | |
---|
574 | template<> |
---|
575 | inline const wchar_t* |
---|
576 | date_time<wchar_t> () |
---|
577 | { |
---|
578 | return L"dateTime"; |
---|
579 | } |
---|
580 | |
---|
581 | template<> |
---|
582 | inline const wchar_t* |
---|
583 | duration<wchar_t> () |
---|
584 | { |
---|
585 | return L"duration"; |
---|
586 | } |
---|
587 | |
---|
588 | |
---|
589 | // |
---|
590 | // |
---|
591 | template<> |
---|
592 | inline const wchar_t* |
---|
593 | positive_inf<wchar_t> () |
---|
594 | { |
---|
595 | return L"INF"; |
---|
596 | } |
---|
597 | |
---|
598 | template<> |
---|
599 | inline const wchar_t* |
---|
600 | negative_inf<wchar_t> () |
---|
601 | { |
---|
602 | return L"-INF"; |
---|
603 | } |
---|
604 | |
---|
605 | template<> |
---|
606 | inline const wchar_t* |
---|
607 | nan<wchar_t> () |
---|
608 | { |
---|
609 | return L"NaN"; |
---|
610 | } |
---|
611 | |
---|
612 | // |
---|
613 | // |
---|
614 | template<> |
---|
615 | inline const wchar_t* |
---|
616 | true_<wchar_t> () |
---|
617 | { |
---|
618 | return L"true"; |
---|
619 | } |
---|
620 | |
---|
621 | template<> |
---|
622 | inline const wchar_t* |
---|
623 | false_<wchar_t> () |
---|
624 | { |
---|
625 | return L"false"; |
---|
626 | } |
---|
627 | |
---|
628 | template<> |
---|
629 | inline const wchar_t* |
---|
630 | one<wchar_t> () |
---|
631 | { |
---|
632 | return L"1"; |
---|
633 | } |
---|
634 | |
---|
635 | template<> |
---|
636 | inline const wchar_t* |
---|
637 | zero<wchar_t> () |
---|
638 | { |
---|
639 | return L"0"; |
---|
640 | } |
---|
641 | } |
---|
642 | } |
---|
643 | } |
---|
644 | } |
---|
645 | } |
---|
646 | |
---|
647 | #endif // XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_IXX_WCHAR |
---|
648 | #endif // XSD_CXX_PARSER_USE_WCHAR |
---|