root/win32/xsd-3.1.0-i686/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx @ 111

Revision 111, 21.6 kB (checked in by mido, 16 years ago)

pridana knihovna XSD (a jeji chlebodarkyne XERCES), v ramci Win32 zprovoznen priklad tests/test_xsd_hello.cxx

Line 
1// file      : xsd/cxx/parser/validating/xml-schema-pimpl.hxx
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#ifndef XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_HXX
7#define XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_HXX
8
9#include <string>
10
11#include <xsd/cxx/parser/validating/xml-schema-pskel.hxx>
12
13namespace xsd
14{
15  namespace cxx
16  {
17    namespace parser
18    {
19      namespace validating
20      {
21        // any_type
22        //
23        template <typename C>
24        struct any_type_pimpl: virtual any_type_pskel<C>
25        {
26          virtual void
27          post_any_type ();
28        };
29
30        // any_simple_type
31        //
32        template <typename C>
33        struct any_simple_type_pimpl: virtual any_simple_type_pskel<C>
34        {
35          virtual void
36          post_any_simple_type ();
37        };
38
39        // boolean
40        //
41        template <typename C>
42        struct boolean_pimpl: virtual boolean_pskel<C>
43        {
44          virtual void
45          _pre ();
46
47          virtual void
48          _characters (const ro_string<C>&);
49
50          virtual void
51          _post ();
52
53          virtual bool
54          post_boolean ();
55
56        protected:
57          std::basic_string<C> str_;
58          bool value_;
59        };
60
61
62        // 8-bit
63        //
64        template <typename C>
65        struct byte_pimpl: virtual byte_pskel<C>
66        {
67          virtual void
68          _pre ();
69
70          virtual void
71          _characters (const ro_string<C>&);
72
73          virtual void
74          _post ();
75
76          virtual signed char
77          post_byte ();
78
79        protected:
80          std::basic_string<C> str_;
81          signed char value_;
82        };
83
84
85        template <typename C>
86        struct unsigned_byte_pimpl: virtual unsigned_byte_pskel<C>
87        {
88          virtual void
89          _pre ();
90
91          virtual void
92          _characters (const ro_string<C>&);
93
94          virtual void
95          _post ();
96
97          virtual unsigned char
98          post_unsigned_byte ();
99
100        protected:
101          std::basic_string<C> str_;
102          unsigned char value_;
103        };
104
105
106        // 16-bit
107        //
108        template <typename C>
109        struct short_pimpl: virtual short_pskel<C>
110        {
111          virtual void
112          _pre ();
113
114          virtual void
115          _characters (const ro_string<C>&);
116
117          virtual void
118          _post ();
119
120          virtual short
121          post_short ();
122
123        protected:
124          std::basic_string<C> str_;
125          short value_;
126        };
127
128
129        template <typename C>
130        struct unsigned_short_pimpl: virtual unsigned_short_pskel<C>
131        {
132          virtual void
133          _pre ();
134
135          virtual void
136          _characters (const ro_string<C>&);
137
138          virtual void
139          _post ();
140
141          virtual unsigned short
142          post_unsigned_short ();
143
144        protected:
145          std::basic_string<C> str_;
146          unsigned short value_;
147        };
148
149
150        // 32-bit
151        //
152        template <typename C>
153        struct int_pimpl: virtual int_pskel<C>
154        {
155          virtual void
156          _pre ();
157
158          virtual void
159          _characters (const ro_string<C>&);
160
161          virtual void
162          _post ();
163
164          virtual int
165          post_int ();
166
167        protected:
168          std::basic_string<C> str_;
169          int value_;
170        };
171
172
173        template <typename C>
174        struct unsigned_int_pimpl: virtual unsigned_int_pskel<C>
175        {
176          virtual void
177          _pre ();
178
179          virtual void
180          _characters (const ro_string<C>&);
181
182          virtual void
183          _post ();
184
185          virtual unsigned int
186          post_unsigned_int ();
187
188        protected:
189          std::basic_string<C> str_;
190          unsigned int value_;
191        };
192
193
194        // 64-bit
195        //
196        template <typename C>
197        struct long_pimpl: virtual long_pskel<C>
198        {
199          virtual void
200          _pre ();
201
202          virtual void
203          _characters (const ro_string<C>&);
204
205          virtual void
206          _post ();
207
208          virtual long long
209          post_long ();
210
211        protected:
212          std::basic_string<C> str_;
213          long long value_;
214        };
215
216
217        template <typename C>
218        struct unsigned_long_pimpl: virtual unsigned_long_pskel<C>
219        {
220          virtual void
221          _pre ();
222
223          virtual void
224          _characters (const ro_string<C>&);
225
226          virtual void
227          _post ();
228
229          virtual unsigned long long
230          post_unsigned_long ();
231
232        protected:
233          std::basic_string<C> str_;
234          unsigned long long value_;
235        };
236
237
238        // Arbitrary-length integers.
239        //
240        template <typename C>
241        struct integer_pimpl: virtual integer_pskel<C>
242        {
243          virtual void
244          _pre ();
245
246          virtual void
247          _characters (const ro_string<C>&);
248
249          virtual void
250          _post ();
251
252          virtual long long
253          post_integer ();
254
255        protected:
256          std::basic_string<C> str_;
257          long long value_;
258        };
259
260        template <typename C>
261        struct negative_integer_pimpl: virtual negative_integer_pskel<C>
262        {
263          virtual void
264          _pre ();
265
266          virtual void
267          _characters (const ro_string<C>&);
268
269          virtual void
270          _post ();
271
272          virtual long long
273          post_negative_integer ();
274
275        protected:
276          std::basic_string<C> str_;
277          long long value_;
278        };
279
280        template <typename C>
281        struct non_positive_integer_pimpl: virtual non_positive_integer_pskel<C>
282        {
283          virtual void
284          _pre ();
285
286          virtual void
287          _characters (const ro_string<C>&);
288
289          virtual void
290          _post ();
291
292          virtual long long
293          post_non_positive_integer ();
294
295        protected:
296          std::basic_string<C> str_;
297          long long value_;
298        };
299
300        template <typename C>
301        struct positive_integer_pimpl: virtual positive_integer_pskel<C>
302        {
303          virtual void
304          _pre ();
305
306          virtual void
307          _characters (const ro_string<C>&);
308
309          virtual void
310          _post ();
311
312          virtual unsigned long long
313          post_positive_integer ();
314
315        protected:
316          std::basic_string<C> str_;
317          unsigned long long value_;
318        };
319
320        template <typename C>
321        struct non_negative_integer_pimpl: virtual non_negative_integer_pskel<C>
322        {
323          virtual void
324          _pre ();
325
326          virtual void
327          _characters (const ro_string<C>&);
328
329          virtual void
330          _post ();
331
332          virtual unsigned long long
333          post_non_negative_integer ();
334
335        protected:
336          std::basic_string<C> str_;
337          unsigned long long value_;
338        };
339
340
341        // Floats.
342        //
343        template <typename C>
344        struct float_pimpl: virtual float_pskel<C>
345        {
346          virtual void
347          _pre ();
348
349          virtual void
350          _characters (const ro_string<C>&);
351
352          virtual void
353          _post ();
354
355          virtual float
356          post_float ();
357
358        protected:
359          std::basic_string<C> str_;
360          float value_;
361        };
362
363
364        template <typename C>
365        struct double_pimpl: virtual double_pskel<C>
366        {
367          virtual void
368          _pre ();
369
370          virtual void
371          _characters (const ro_string<C>&);
372
373          virtual void
374          _post ();
375
376          virtual double
377          post_double ();
378
379        protected:
380          std::basic_string<C> str_;
381          double value_;
382        };
383
384
385        template <typename C>
386        struct decimal_pimpl: virtual decimal_pskel<C>
387        {
388          virtual void
389          _pre ();
390
391          virtual void
392          _characters (const ro_string<C>&);
393
394          virtual void
395          _post ();
396
397          virtual double
398          post_decimal ();
399
400        protected:
401          std::basic_string<C> str_;
402          double value_;
403        };
404
405
406        // Strings.
407        //
408        template <typename C>
409        struct string_pimpl: virtual string_pskel<C>
410        {
411          virtual void
412          _pre ();
413
414          virtual void
415          _characters (const ro_string<C>&);
416
417          virtual std::basic_string<C>
418          post_string ();
419
420        protected:
421          std::basic_string<C> str_;
422        };
423
424        template <typename C>
425        struct normalized_string_pimpl: virtual normalized_string_pskel<C>
426        {
427          virtual void
428          _pre ();
429
430          virtual void
431          _characters (const ro_string<C>&);
432
433          virtual std::basic_string<C>
434          post_normalized_string ();
435
436        protected:
437          std::basic_string<C> str_;
438        };
439
440        template <typename C>
441        struct token_pimpl: virtual token_pskel<C>
442        {
443          virtual void
444          _pre ();
445
446          virtual void
447          _characters (const ro_string<C>&);
448
449          virtual std::basic_string<C>
450          post_token ();
451
452        protected:
453          std::basic_string<C> str_;
454        };
455
456        template <typename C>
457        struct name_pimpl: virtual name_pskel<C>
458        {
459          virtual void
460          _pre ();
461
462          virtual void
463          _characters (const ro_string<C>&);
464
465          virtual void
466          _post ();
467
468          virtual std::basic_string<C>
469          post_name ();
470
471        protected:
472          std::basic_string<C> str_;
473        };
474
475        template <typename C>
476        struct nmtoken_pimpl: virtual nmtoken_pskel<C>
477        {
478          virtual void
479          _pre ();
480
481          virtual void
482          _characters (const ro_string<C>&);
483
484          virtual void
485          _post ();
486
487          virtual std::basic_string<C>
488          post_nmtoken ();
489
490        protected:
491          std::basic_string<C> str_;
492        };
493
494        template <typename C>
495        struct nmtokens_pimpl: virtual nmtokens_pskel<C>
496        {
497          virtual void
498          _pre ();
499
500          virtual void
501          _xsd_parse_item (const ro_string<C>&);
502
503          virtual void
504          _post ();
505
506          virtual string_sequence<C>
507          post_nmtokens ();
508
509        protected:
510          string_sequence<C> seq_;
511          nmtoken_pimpl<C> parser_;
512        };
513
514        template <typename C>
515        struct ncname_pimpl: virtual ncname_pskel<C>
516        {
517          virtual void
518          _pre ();
519
520          virtual void
521          _characters (const ro_string<C>&);
522
523          virtual void
524          _post ();
525
526          virtual std::basic_string<C>
527          post_ncname ();
528
529        protected:
530          std::basic_string<C> str_;
531        };
532
533        template <typename C>
534        struct id_pimpl: virtual id_pskel<C>, ncname_pimpl<C>
535        {
536          virtual std::basic_string<C>
537          post_id ();
538        };
539
540        template <typename C>
541        struct idref_pimpl: virtual idref_pskel<C>, ncname_pimpl<C>
542        {
543          virtual std::basic_string<C>
544          post_idref ();
545        };
546
547        template <typename C>
548        struct idrefs_pimpl: virtual idrefs_pskel<C>
549        {
550          virtual void
551          _pre ();
552
553          virtual void
554          _xsd_parse_item (const ro_string<C>&);
555
556          virtual void
557          _post ();
558
559          virtual string_sequence<C>
560          post_idrefs ();
561
562        protected:
563          string_sequence<C> seq_;
564          idref_pimpl<C> parser_;
565        };
566
567        // language
568        //
569        template <typename C>
570        struct language_pimpl: virtual language_pskel<C>
571        {
572          virtual void
573          _pre ();
574
575          virtual void
576          _characters (const ro_string<C>&);
577
578          virtual void
579          _post ();
580
581          virtual std::basic_string<C>
582          post_language ();
583
584        protected:
585          std::basic_string<C> str_;
586        };
587
588        // anyURI
589        //
590        template <typename C>
591        struct uri_pimpl: virtual uri_pskel<C>
592        {
593          virtual void
594          _pre ();
595
596          virtual void
597          _characters (const ro_string<C>&);
598
599          virtual std::basic_string<C>
600          post_uri ();
601
602        protected:
603          std::basic_string<C> str_;
604        };
605
606        // QName
607        //
608        template <typename C>
609        struct qname_pimpl: virtual qname_pskel<C>
610        {
611          virtual void
612          _pre ();
613
614          virtual void
615          _characters (const ro_string<C>&);
616
617          virtual void
618          _post ();
619
620          virtual qname<C>
621          post_qname ();
622
623        protected:
624          std::basic_string<C> str_;
625          std::basic_string<C> name_;
626          std::basic_string<C> prefix_;
627        };
628
629        // base64Binary
630        //
631        template <typename C>
632        struct base64_binary_pimpl: virtual base64_binary_pskel<C>
633        {
634          virtual void
635          _pre ();
636
637          virtual void
638          _characters (const ro_string<C>&);
639
640          virtual void
641          _post ();
642
643          virtual std::auto_ptr<buffer>
644          post_base64_binary ();
645
646        protected:
647          std::basic_string<C> str_;
648          std::auto_ptr<buffer> buf_;
649        };
650
651        // hexBinary
652        //
653        template <typename C>
654        struct hex_binary_pimpl: virtual hex_binary_pskel<C>
655        {
656          virtual void
657          _pre ();
658
659          virtual void
660          _characters (const ro_string<C>&);
661
662          virtual void
663          _post ();
664
665          virtual std::auto_ptr<buffer>
666          post_hex_binary ();
667
668        protected:
669          std::basic_string<C> str_;
670          std::auto_ptr<buffer> buf_;
671        };
672
673        // gday
674        //
675        template <typename C>
676        struct gday_pimpl: virtual gday_pskel<C>
677        {
678          virtual void
679          _pre ();
680
681          virtual void
682          _characters (const ro_string<C>&);
683
684          virtual void
685          _post ();
686
687          virtual gday
688          post_gday ();
689
690        protected:
691          std::basic_string<C> str_;
692          unsigned short day_;
693          bool z_;
694          short zh_, zm_;
695        };
696
697        // gmonth
698        //
699        template <typename C>
700        struct gmonth_pimpl: virtual gmonth_pskel<C>
701        {
702          virtual void
703          _pre ();
704
705          virtual void
706          _characters (const ro_string<C>&);
707
708          virtual void
709          _post ();
710
711          virtual gmonth
712          post_gmonth ();
713
714        protected:
715          std::basic_string<C> str_;
716          unsigned short month_;
717          bool z_;
718          short zh_, zm_;
719        };
720
721        // gyear
722        //
723        template <typename C>
724        struct gyear_pimpl: virtual gyear_pskel<C>
725        {
726          virtual void
727          _pre ();
728
729          virtual void
730          _characters (const ro_string<C>&);
731
732          virtual void
733          _post ();
734
735          virtual gyear
736          post_gyear ();
737
738        protected:
739          std::basic_string<C> str_;
740          int year_;
741          bool z_;
742          short zh_, zm_;
743        };
744
745        // gmonth_day
746        //
747        template <typename C>
748        struct gmonth_day_pimpl: virtual gmonth_day_pskel<C>
749        {
750          virtual void
751          _pre ();
752
753          virtual void
754          _characters (const ro_string<C>&);
755
756          virtual void
757          _post ();
758
759          virtual gmonth_day
760          post_gmonth_day ();
761
762        protected:
763          std::basic_string<C> str_;
764          unsigned short month_;
765          unsigned short day_;
766          bool z_;
767          short zh_, zm_;
768        };
769
770        // gyear_month
771        //
772        template <typename C>
773        struct gyear_month_pimpl: virtual gyear_month_pskel<C>
774        {
775          virtual void
776          _pre ();
777
778          virtual void
779          _characters (const ro_string<C>&);
780
781          virtual void
782          _post ();
783
784          virtual gyear_month
785          post_gyear_month ();
786
787        protected:
788          std::basic_string<C> str_;
789          int year_;
790          unsigned short month_;
791          bool z_;
792          short zh_, zm_;
793        };
794
795        // date
796        //
797        template <typename C>
798        struct date_pimpl: virtual date_pskel<C>
799        {
800          virtual void
801          _pre ();
802
803          virtual void
804          _characters (const ro_string<C>&);
805
806          virtual void
807          _post ();
808
809          virtual date
810          post_date ();
811
812        protected:
813          std::basic_string<C> str_;
814          int year_;
815          unsigned short month_;
816          unsigned short day_;
817          bool z_;
818          short zh_, zm_;
819        };
820
821        // time
822        //
823        template <typename C>
824        struct time_pimpl: virtual time_pskel<C>
825        {
826          virtual void
827          _pre ();
828
829          virtual void
830          _characters (const ro_string<C>&);
831
832          virtual void
833          _post ();
834
835          virtual time
836          post_time ();
837
838        protected:
839          std::basic_string<C> str_;
840          unsigned short hours_;
841          unsigned short minutes_;
842          double seconds_;
843          bool z_;
844          short zh_, zm_;
845        };
846
847        // date_time
848        //
849        template <typename C>
850        struct date_time_pimpl: virtual date_time_pskel<C>
851        {
852          virtual void
853          _pre ();
854
855          virtual void
856          _characters (const ro_string<C>&);
857
858          virtual void
859          _post ();
860
861          virtual date_time
862          post_date_time ();
863
864        protected:
865          std::basic_string<C> str_;
866          int year_;
867          unsigned short month_;
868          unsigned short day_;
869          unsigned short hours_;
870          unsigned short minutes_;
871          double seconds_;
872          bool z_;
873          short zh_, zm_;
874        };
875
876        // duration
877        //
878        template <typename C>
879        struct duration_pimpl: virtual duration_pskel<C>
880        {
881          virtual void
882          _pre ();
883
884          virtual void
885          _characters (const ro_string<C>&);
886
887          virtual void
888          _post ();
889
890          virtual duration
891          post_duration ();
892
893        protected:
894          std::basic_string<C> str_;
895          bool negative_;
896          unsigned int years_;
897          unsigned int months_;
898          unsigned int days_;
899          unsigned int hours_;
900          unsigned int minutes_;
901          double seconds_;
902        };
903
904        // Literals.
905        //
906        namespace bits
907        {
908          template<typename C>
909          const C*
910          boolean ();
911
912          template<typename C>
913          const C*
914          byte ();
915
916          template<typename C>
917          const C*
918          unsigned_byte ();
919
920          template<typename C>
921          const C*
922          short_ ();
923
924          template<typename C>
925          const C*
926          unsigned_short ();
927
928          template<typename C>
929          const C*
930          int_ ();
931
932          template<typename C>
933          const C*
934          unsigned_int ();
935
936          template<typename C>
937          const C*
938          long_ ();
939
940          template<typename C>
941          const C*
942          unsigned_long ();
943
944          template<typename C>
945          const C*
946          integer ();
947
948          template<typename C>
949          const C*
950          negative_integer ();
951
952          template<typename C>
953          const C*
954          non_positive_integer ();
955
956          template<typename C>
957          const C*
958          non_negative_integer ();
959
960          template<typename C>
961          const C*
962          positive_integer ();
963
964          template<typename C>
965          const C*
966          float_ ();
967
968          template<typename C>
969          const C*
970          double_ ();
971
972          template<typename C>
973          const C*
974          decimal ();
975
976          template<typename C>
977          const C*
978          name ();
979
980          template<typename C>
981          const C*
982          nmtoken ();
983
984          template<typename C>
985          const C*
986          nmtokens ();
987
988          template<typename C>
989          const C*
990          ncname ();
991
992          template<typename C>
993          const C*
994          idrefs ();
995
996          template<typename C>
997          const C*
998          language ();
999
1000          template<typename C>
1001          const C*
1002          qname ();
1003
1004          template<typename C>
1005          const C*
1006          base64_binary ();
1007
1008          template<typename C>
1009          const C*
1010          hex_binary ();
1011
1012          template<typename C>
1013          const C*
1014          gday ();
1015
1016          template<typename C>
1017          const C*
1018          gmonth ();
1019
1020          template<typename C>
1021          const C*
1022          gyear ();
1023
1024          template<typename C>
1025          const C*
1026          gmonth_day ();
1027
1028          template<typename C>
1029          const C*
1030          gyear_month ();
1031
1032          template<typename C>
1033          const C*
1034          date ();
1035
1036          template<typename C>
1037          const C*
1038          time ();
1039
1040          template<typename C>
1041          const C*
1042          date_time ();
1043
1044          template<typename C>
1045          const C*
1046          duration ();
1047
1048          // float literals: INF -INF NaN
1049          //
1050          template<typename C>
1051          const C*
1052          positive_inf ();
1053
1054          template<typename C>
1055          const C*
1056          negative_inf ();
1057
1058          template<typename C>
1059          const C*
1060          nan ();
1061
1062          // boolean literals
1063          //
1064          template<typename C>
1065          const C*
1066          true_ ();
1067
1068          template<typename C>
1069          const C*
1070          false_ ();
1071
1072          template<typename C>
1073          const C*
1074          one ();
1075
1076          template<typename C>
1077          const C*
1078          zero ();
1079        }
1080      }
1081    }
1082  }
1083}
1084
1085#include <xsd/cxx/parser/validating/xml-schema-pimpl.txx>
1086
1087#endif  // XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PIMPL_HXX
1088
1089#include <xsd/cxx/parser/validating/xml-schema-pimpl.ixx>
Note: See TracBrowser for help on using the browser.