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

Revision 111, 15.7 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/non-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_NON_VALIDATING_XML_SCHEMA_PIMPL_HXX
7#define XSD_CXX_PARSER_NON_VALIDATING_XML_SCHEMA_PIMPL_HXX
8
9#include <string>
10
11#include <xsd/cxx/parser/non-validating/xml-schema-pskel.hxx>
12
13namespace xsd
14{
15  namespace cxx
16  {
17    namespace parser
18    {
19      namespace non_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 bool
51          post_boolean ();
52
53        protected:
54          std::basic_string<C> str_;
55        };
56
57
58        // 8-bit
59        //
60        template <typename C>
61        struct byte_pimpl: virtual byte_pskel<C>
62        {
63          virtual void
64          _pre ();
65
66          virtual void
67          _characters (const ro_string<C>&);
68
69          virtual signed char
70          post_byte ();
71
72        protected:
73          std::basic_string<C> str_;
74        };
75
76
77        template <typename C>
78        struct unsigned_byte_pimpl: virtual unsigned_byte_pskel<C>
79        {
80          virtual void
81          _pre ();
82
83          virtual void
84          _characters (const ro_string<C>&);
85
86          virtual unsigned char
87          post_unsigned_byte ();
88
89        protected:
90          std::basic_string<C> str_;
91        };
92
93
94        // 16-bit
95        //
96        template <typename C>
97        struct short_pimpl: virtual short_pskel<C>
98        {
99          virtual void
100          _pre ();
101
102          virtual void
103          _characters (const ro_string<C>&);
104
105          virtual short
106          post_short ();
107
108        protected:
109          std::basic_string<C> str_;
110        };
111
112
113        template <typename C>
114        struct unsigned_short_pimpl: virtual unsigned_short_pskel<C>
115        {
116          virtual void
117          _pre ();
118
119          virtual void
120          _characters (const ro_string<C>&);
121
122          virtual unsigned short
123          post_unsigned_short ();
124
125        protected:
126          std::basic_string<C> str_;
127        };
128
129
130        // 32-bit
131        //
132        template <typename C>
133        struct int_pimpl: virtual int_pskel<C>
134        {
135          virtual void
136          _pre ();
137
138          virtual void
139          _characters (const ro_string<C>&);
140
141          virtual int
142          post_int ();
143
144        protected:
145          std::basic_string<C> str_;
146        };
147
148
149        template <typename C>
150        struct unsigned_int_pimpl: virtual unsigned_int_pskel<C>
151        {
152          virtual void
153          _pre ();
154
155          virtual void
156          _characters (const ro_string<C>&);
157
158          virtual unsigned int
159          post_unsigned_int ();
160
161        protected:
162          std::basic_string<C> str_;
163        };
164
165
166        // 64-bit
167        //
168        template <typename C>
169        struct long_pimpl: virtual long_pskel<C>
170        {
171          virtual void
172          _pre ();
173
174          virtual void
175          _characters (const ro_string<C>&);
176
177          virtual long long
178          post_long ();
179
180        protected:
181          std::basic_string<C> str_;
182        };
183
184
185        template <typename C>
186        struct unsigned_long_pimpl: virtual unsigned_long_pskel<C>
187        {
188          virtual void
189          _pre ();
190
191          virtual void
192          _characters (const ro_string<C>&);
193
194          virtual unsigned long long
195          post_unsigned_long ();
196
197        protected:
198          std::basic_string<C> str_;
199        };
200
201
202        // Arbitrary-length integers.
203        //
204        template <typename C>
205        struct integer_pimpl: virtual integer_pskel<C>
206        {
207          virtual void
208          _pre ();
209
210          virtual void
211          _characters (const ro_string<C>&);
212
213          virtual long long
214          post_integer ();
215
216        protected:
217          std::basic_string<C> str_;
218        };
219
220        template <typename C>
221        struct negative_integer_pimpl: virtual negative_integer_pskel<C>
222        {
223          virtual void
224          _pre ();
225
226          virtual void
227          _characters (const ro_string<C>&);
228
229          virtual long long
230          post_negative_integer ();
231
232        protected:
233          std::basic_string<C> str_;
234        };
235
236        template <typename C>
237        struct non_positive_integer_pimpl: virtual non_positive_integer_pskel<C>
238        {
239          virtual void
240          _pre ();
241
242          virtual void
243          _characters (const ro_string<C>&);
244
245          virtual long long
246          post_non_positive_integer ();
247
248        protected:
249          std::basic_string<C> str_;
250        };
251
252        template <typename C>
253        struct positive_integer_pimpl: virtual positive_integer_pskel<C>
254        {
255          virtual void
256          _pre ();
257
258          virtual void
259          _characters (const ro_string<C>&);
260
261          virtual unsigned long long
262          post_positive_integer ();
263
264        protected:
265          std::basic_string<C> str_;
266        };
267
268        template <typename C>
269        struct non_negative_integer_pimpl: virtual non_negative_integer_pskel<C>
270        {
271          virtual void
272          _pre ();
273
274          virtual void
275          _characters (const ro_string<C>&);
276
277          virtual unsigned long long
278          post_non_negative_integer ();
279
280        protected:
281          std::basic_string<C> str_;
282        };
283
284
285        // Floats.
286        //
287        template <typename C>
288        struct float_pimpl: virtual float_pskel<C>
289        {
290          virtual void
291          _pre ();
292
293          virtual void
294          _characters (const ro_string<C>&);
295
296          virtual float
297          post_float ();
298
299        protected:
300          std::basic_string<C> str_;
301        };
302
303
304        template <typename C>
305        struct double_pimpl: virtual double_pskel<C>
306        {
307          virtual void
308          _pre ();
309
310          virtual void
311          _characters (const ro_string<C>&);
312
313          virtual double
314          post_double ();
315
316        protected:
317          std::basic_string<C> str_;
318        };
319
320
321        template <typename C>
322        struct decimal_pimpl: virtual decimal_pskel<C>
323        {
324          virtual void
325          _pre ();
326
327          virtual void
328          _characters (const ro_string<C>&);
329
330          virtual double
331          post_decimal ();
332
333        protected:
334          std::basic_string<C> str_;
335        };
336
337
338        // Strings.
339        //
340        template <typename C>
341        struct string_pimpl: virtual string_pskel<C>
342        {
343          virtual void
344          _pre ();
345
346          virtual void
347          _characters (const ro_string<C>&);
348
349          virtual std::basic_string<C>
350          post_string ();
351
352        protected:
353          std::basic_string<C> str_;
354        };
355
356        template <typename C>
357        struct normalized_string_pimpl: virtual normalized_string_pskel<C>
358        {
359          virtual void
360          _pre ();
361
362          virtual void
363          _characters (const ro_string<C>&);
364
365          virtual std::basic_string<C>
366          post_normalized_string ();
367
368        protected:
369          std::basic_string<C> str_;
370        };
371
372        template <typename C>
373        struct token_pimpl: virtual token_pskel<C>
374        {
375          virtual void
376          _pre ();
377
378          virtual void
379          _characters (const ro_string<C>&);
380
381          virtual std::basic_string<C>
382          post_token ();
383
384        protected:
385          std::basic_string<C> str_;
386        };
387
388        template <typename C>
389        struct name_pimpl: virtual name_pskel<C>
390        {
391          virtual void
392          _pre ();
393
394          virtual void
395          _characters (const ro_string<C>&);
396
397          virtual std::basic_string<C>
398          post_name ();
399
400        protected:
401          std::basic_string<C> str_;
402        };
403
404        template <typename C>
405        struct nmtoken_pimpl: virtual nmtoken_pskel<C>
406        {
407          virtual void
408          _pre ();
409
410          virtual void
411          _characters (const ro_string<C>&);
412
413          virtual std::basic_string<C>
414          post_nmtoken ();
415
416        protected:
417          std::basic_string<C> str_;
418        };
419
420        template <typename C>
421        struct nmtokens_pimpl: virtual nmtokens_pskel<C>
422        {
423          virtual void
424          _pre ();
425
426          virtual void
427          _xsd_parse_item (const ro_string<C>&);
428
429          virtual string_sequence<C>
430          post_nmtokens ();
431
432        protected:
433          string_sequence<C> seq_;
434          nmtoken_pimpl<C> parser_;
435        };
436
437        template <typename C>
438        struct ncname_pimpl: virtual ncname_pskel<C>
439        {
440          virtual void
441          _pre ();
442
443          virtual void
444          _characters (const ro_string<C>&);
445
446          virtual std::basic_string<C>
447          post_ncname ();
448
449        protected:
450          std::basic_string<C> str_;
451        };
452
453        template <typename C>
454        struct id_pimpl: virtual id_pskel<C>, ncname_pimpl<C>
455        {
456          virtual std::basic_string<C>
457          post_id ();
458        };
459
460        template <typename C>
461        struct idref_pimpl: virtual idref_pskel<C>, ncname_pimpl<C>
462        {
463          virtual std::basic_string<C>
464          post_idref ();
465        };
466
467        template <typename C>
468        struct idrefs_pimpl: virtual idrefs_pskel<C>
469        {
470          virtual void
471          _pre ();
472
473          virtual void
474          _xsd_parse_item (const ro_string<C>&);
475
476          virtual string_sequence<C>
477          post_idrefs ();
478
479        protected:
480          string_sequence<C> seq_;
481          idref_pimpl<C> parser_;
482        };
483
484        // language
485        //
486        template <typename C>
487        struct language_pimpl: virtual language_pskel<C>
488        {
489          virtual void
490          _pre ();
491
492          virtual void
493          _characters (const ro_string<C>&);
494
495          virtual std::basic_string<C>
496          post_language ();
497
498        protected:
499          std::basic_string<C> str_;
500        };
501
502        // anyURI
503        //
504        template <typename C>
505        struct uri_pimpl: virtual uri_pskel<C>
506        {
507          virtual void
508          _pre ();
509
510          virtual void
511          _characters (const ro_string<C>&);
512
513          virtual std::basic_string<C>
514          post_uri ();
515
516        protected:
517          std::basic_string<C> str_;
518        };
519
520        // QName
521        //
522        template <typename C>
523        struct qname_pimpl: virtual qname_pskel<C>
524        {
525          virtual void
526          _pre ();
527
528          virtual void
529          _characters (const ro_string<C>&);
530
531          virtual qname<C>
532          post_qname ();
533
534        protected:
535          std::basic_string<C> str_;
536        };
537
538        // base64Binary
539        //
540        template <typename C>
541        struct base64_binary_pimpl: virtual base64_binary_pskel<C>
542        {
543          virtual void
544          _pre ();
545
546          virtual void
547          _characters (const ro_string<C>&);
548
549          virtual std::auto_ptr<buffer>
550          post_base64_binary ();
551
552        protected:
553          std::basic_string<C> str_;
554        };
555
556        // hexBinary
557        //
558        template <typename C>
559        struct hex_binary_pimpl: virtual hex_binary_pskel<C>
560        {
561          virtual void
562          _pre ();
563
564          virtual void
565          _characters (const ro_string<C>&);
566
567          virtual std::auto_ptr<buffer>
568          post_hex_binary ();
569
570        protected:
571          std::basic_string<C> str_;
572        };
573
574        // gday
575        //
576        template <typename C>
577        struct gday_pimpl: virtual gday_pskel<C>
578        {
579          virtual void
580          _pre ();
581
582          virtual void
583          _characters (const ro_string<C>&);
584
585          virtual gday
586          post_gday ();
587
588        protected:
589          std::basic_string<C> str_;
590        };
591
592        // gmonth
593        //
594        template <typename C>
595        struct gmonth_pimpl: virtual gmonth_pskel<C>
596        {
597          virtual void
598          _pre ();
599
600          virtual void
601          _characters (const ro_string<C>&);
602
603          virtual gmonth
604          post_gmonth ();
605
606        protected:
607          std::basic_string<C> str_;
608        };
609
610        // gyear
611        //
612        template <typename C>
613        struct gyear_pimpl: virtual gyear_pskel<C>
614        {
615          virtual void
616          _pre ();
617
618          virtual void
619          _characters (const ro_string<C>&);
620
621          virtual gyear
622          post_gyear ();
623
624        protected:
625          std::basic_string<C> str_;
626        };
627
628        // gmonth_day
629        //
630        template <typename C>
631        struct gmonth_day_pimpl: virtual gmonth_day_pskel<C>
632        {
633          virtual void
634          _pre ();
635
636          virtual void
637          _characters (const ro_string<C>&);
638
639          virtual gmonth_day
640          post_gmonth_day ();
641
642        protected:
643          std::basic_string<C> str_;
644        };
645
646        // gyear_month
647        //
648        template <typename C>
649        struct gyear_month_pimpl: virtual gyear_month_pskel<C>
650        {
651          virtual void
652          _pre ();
653
654          virtual void
655          _characters (const ro_string<C>&);
656
657          virtual gyear_month
658          post_gyear_month ();
659
660        protected:
661          std::basic_string<C> str_;
662        };
663
664        // date
665        //
666        template <typename C>
667        struct date_pimpl: virtual date_pskel<C>
668        {
669          virtual void
670          _pre ();
671
672          virtual void
673          _characters (const ro_string<C>&);
674
675          virtual date
676          post_date ();
677
678        protected:
679          std::basic_string<C> str_;
680        };
681
682        // time
683        //
684        template <typename C>
685        struct time_pimpl: virtual time_pskel<C>
686        {
687          virtual void
688          _pre ();
689
690          virtual void
691          _characters (const ro_string<C>&);
692
693          virtual time
694          post_time ();
695
696        protected:
697          std::basic_string<C> str_;
698        };
699
700        // date_time
701        //
702        template <typename C>
703        struct date_time_pimpl: virtual date_time_pskel<C>
704        {
705          virtual void
706          _pre ();
707
708          virtual void
709          _characters (const ro_string<C>&);
710
711          virtual date_time
712          post_date_time ();
713
714        protected:
715          std::basic_string<C> str_;
716        };
717
718        // duration
719        //
720        template <typename C>
721        struct duration_pimpl: virtual duration_pskel<C>
722        {
723          virtual void
724          _pre ();
725
726          virtual void
727          _characters (const ro_string<C>&);
728
729          virtual duration
730          post_duration ();
731
732        protected:
733          std::basic_string<C> str_;
734        };
735
736        //
737        //
738        namespace bits
739        {
740          // float literals: INF -INF NaN
741          //
742          template<typename C>
743          const C*
744          positive_inf ();
745
746          template<typename C>
747          const C*
748          negative_inf ();
749
750          template<typename C>
751          const C*
752          nan ();
753
754          // boolean literals
755          //
756          template<typename C>
757          const C*
758          true_ ();
759
760          template<typename C>
761          const C*
762          one ();
763        }
764      }
765    }
766  }
767}
768
769#include <xsd/cxx/parser/non-validating/xml-schema-pimpl.txx>
770
771#endif  // XSD_CXX_PARSER_NON_VALIDATING_XML_SCHEMA_PIMPL_HXX
772
773#include <xsd/cxx/parser/non-validating/xml-schema-pimpl.ixx>
Note: See TracBrowser for help on using the browser.