otsdaq_utilities  v2_05_02_indev
ECL.cxx
1 // Copyright (c) 2005-2014 Code Synthesis Tools CC
2 //
3 // This program was generated by CodeSynthesis XSD, an XML Schema to
4 // C++ data binding compiler.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License version 2 as
8 // published by the Free Software Foundation.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // In addition, as a special exception, Code Synthesis Tools CC gives
20 // permission to link this program with the Xerces-C++ library (or with
21 // modified versions of Xerces-C++ that use the same license as Xerces-C++),
22 // and distribute linked combinations including the two. You must obey
23 // the GNU General Public License version 2 in all respects for all of
24 // the code used other than Xerces-C++. If you modify this copy of the
25 // program, you may extend this exception to your version of the program,
26 // but you are not obligated to do so. If you do not wish to do so, delete
27 // this exception statement from your version.
28 //
29 // Furthermore, Code Synthesis Tools CC makes a special exception for
30 // the Free/Libre and Open Source Software (FLOSS) which is described
31 // in the accompanying FLOSSE file.
32 //
33 
34 // Begin prologue.
35 //
36 //
37 // End prologue.
38 
39 #include <xsd/cxx/pre.hxx>
40 
41 #include "otsdaq-utilities/ECLWriter/ECL.hxx"
42 
43 // Tag_t
44 //
45 
46 const Tag_t::name_type& Tag_t::
47 name () const
48 {
49  return this->name_.get ();
50 }
51 
52 Tag_t::name_type& Tag_t::
53 name ()
54 {
55  return this->name_.get ();
56 }
57 
58 void Tag_t::
59 name (const name_type& x)
60 {
61  this->name_.set (x);
62 }
63 
64 void Tag_t::
65 name (::std::unique_ptr< name_type > x)
66 {
67  this->name_.set (std::move (x));
68 }
69 
70 
71 // Attachment_t
72 //
73 
74 const Attachment_t::type_type& Attachment_t::
75 type () const
76 {
77  return this->type_.get ();
78 }
79 
80 Attachment_t::type_type& Attachment_t::
81 type ()
82 {
83  return this->type_.get ();
84 }
85 
86 void Attachment_t::
87 type (const type_type& x)
88 {
89  this->type_.set (x);
90 }
91 
92 void Attachment_t::
93 type (::std::unique_ptr< type_type > x)
94 {
95  this->type_.set (std::move (x));
96 }
97 
98 const Attachment_t::filename_type& Attachment_t::
99 filename () const
100 {
101  return this->filename_.get ();
102 }
103 
104 Attachment_t::filename_type& Attachment_t::
105 filename ()
106 {
107  return this->filename_.get ();
108 }
109 
110 void Attachment_t::
111 filename (const filename_type& x)
112 {
113  this->filename_.set (x);
114 }
115 
116 void Attachment_t::
117 filename (::std::unique_ptr< filename_type > x)
118 {
119  this->filename_.set (std::move (x));
120 }
121 
122 
123 // Field_t
124 //
125 
126 const Field_t::name_type& Field_t::
127 name () const
128 {
129  return this->name_.get ();
130 }
131 
132 Field_t::name_type& Field_t::
133 name ()
134 {
135  return this->name_.get ();
136 }
137 
138 void Field_t::
139 name (const name_type& x)
140 {
141  this->name_.set (x);
142 }
143 
144 void Field_t::
145 name (::std::unique_ptr< name_type > x)
146 {
147  this->name_.set (std::move (x));
148 }
149 
150 
151 // Form_t
152 //
153 
154 const Form_t::field_sequence& Form_t::
155 field () const
156 {
157  return this->field_;
158 }
159 
160 Form_t::field_sequence& Form_t::
161 field ()
162 {
163  return this->field_;
164 }
165 
166 void Form_t::
167 field (const field_sequence& s)
168 {
169  this->field_ = s;
170 }
171 
172 const Form_t::name_type& Form_t::
173 name () const
174 {
175  return this->name_.get ();
176 }
177 
178 Form_t::name_type& Form_t::
179 name ()
180 {
181  return this->name_.get ();
182 }
183 
184 void Form_t::
185 name (const name_type& x)
186 {
187  this->name_.set (x);
188 }
189 
190 void Form_t::
191 name (::std::unique_ptr< name_type > x)
192 {
193  this->name_.set (std::move (x));
194 }
195 
196 
197 // ECLEntry_t
198 //
199 
200 const ECLEntry_t::tag_sequence& ECLEntry_t::
201 tag () const
202 {
203  return this->tag_;
204 }
205 
206 ECLEntry_t::tag_sequence& ECLEntry_t::
207 tag ()
208 {
209  return this->tag_;
210 }
211 
212 void ECLEntry_t::
213 tag (const tag_sequence& s)
214 {
215  this->tag_ = s;
216 }
217 
218 const ECLEntry_t::attachment_sequence& ECLEntry_t::
219 attachment () const
220 {
221  return this->attachment_;
222 }
223 
224 ECLEntry_t::attachment_sequence& ECLEntry_t::
225 attachment ()
226 {
227  return this->attachment_;
228 }
229 
230 void ECLEntry_t::
231 attachment (const attachment_sequence& s)
232 {
233  this->attachment_ = s;
234 }
235 
236 const ECLEntry_t::form_optional& ECLEntry_t::
237 form () const
238 {
239  return this->form_;
240 }
241 
242 ECLEntry_t::form_optional& ECLEntry_t::
243 form ()
244 {
245  return this->form_;
246 }
247 
248 void ECLEntry_t::
249 form (const form_type& x)
250 {
251  this->form_.set (x);
252 }
253 
254 void ECLEntry_t::
255 form (const form_optional& x)
256 {
257  this->form_ = x;
258 }
259 
260 void ECLEntry_t::
261 form (::std::unique_ptr< form_type > x)
262 {
263  this->form_.set (std::move (x));
264 }
265 
266 const ECLEntry_t::author_type& ECLEntry_t::
267 author () const
268 {
269  return this->author_.get ();
270 }
271 
272 ECLEntry_t::author_type& ECLEntry_t::
273 author ()
274 {
275  return this->author_.get ();
276 }
277 
278 void ECLEntry_t::
279 author (const author_type& x)
280 {
281  this->author_.set (x);
282 }
283 
284 void ECLEntry_t::
285 author (::std::unique_ptr< author_type > x)
286 {
287  this->author_.set (std::move (x));
288 }
289 
290 const ECLEntry_t::category_type& ECLEntry_t::
291 category () const
292 {
293  return this->category_.get ();
294 }
295 
296 ECLEntry_t::category_type& ECLEntry_t::
297 category ()
298 {
299  return this->category_.get ();
300 }
301 
302 void ECLEntry_t::
303 category (const category_type& x)
304 {
305  this->category_.set (x);
306 }
307 
308 void ECLEntry_t::
309 category (::std::unique_ptr< category_type > x)
310 {
311  this->category_.set (std::move (x));
312 }
313 
314 const ECLEntry_t::subject_optional& ECLEntry_t::
315 subject () const
316 {
317  return this->subject_;
318 }
319 
320 ECLEntry_t::subject_optional& ECLEntry_t::
321 subject ()
322 {
323  return this->subject_;
324 }
325 
326 void ECLEntry_t::
327 subject (const subject_type& x)
328 {
329  this->subject_.set (x);
330 }
331 
332 void ECLEntry_t::
333 subject (const subject_optional& x)
334 {
335  this->subject_ = x;
336 }
337 
338 void ECLEntry_t::
339 subject (::std::unique_ptr< subject_type > x)
340 {
341  this->subject_.set (std::move (x));
342 }
343 
344 
345 #include <xsd/cxx/xml/dom/parsing-source.hxx>
346 
347 // Tag_t
348 //
349 
350 Tag_t::
351 Tag_t ()
352 : ::xml_schema::type (),
353  name_ (this)
354 {
355 }
356 
357 Tag_t::
358 Tag_t (const name_type& name)
359 : ::xml_schema::type (),
360  name_ (name, this)
361 {
362 }
363 
364 Tag_t::
365 Tag_t (const Tag_t& x,
366  ::xml_schema::flags f,
367  ::xml_schema::container* c)
368 : ::xml_schema::type (x, f, c),
369  name_ (x.name_, f, this)
370 {
371 }
372 
373 Tag_t::
374 Tag_t (const ::xercesc::DOMElement& e,
375  ::xml_schema::flags f,
376  ::xml_schema::container* c)
377 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
378  name_ (this)
379 {
380  if ((f & ::xml_schema::flags::base) == 0)
381  {
382  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
383  this->parse (p, f);
384  }
385 }
386 
387 void Tag_t::
388 parse (::xsd::cxx::xml::dom::parser< char >& p,
389  ::xml_schema::flags f)
390 {
391  while (p.more_attributes ())
392  {
393  const ::xercesc::DOMAttr& i (p.next_attribute ());
394  const ::xsd::cxx::xml::qualified_name< char > n (
395  ::xsd::cxx::xml::dom::name< char > (i));
396 
397  if (n.name () == "name" && n.namespace_ ().empty ())
398  {
399  this->name_.set (name_traits::create (i, f, this));
400  continue;
401  }
402  }
403 
404  if (!name_.present ())
405  {
406  throw ::xsd::cxx::tree::expected_attribute< char > (
407  "name",
408  "");
409  }
410 }
411 
412 Tag_t* Tag_t::
413 _clone (::xml_schema::flags f,
414  ::xml_schema::container* c) const
415 {
416  return new class Tag_t (*this, f, c);
417 }
418 
419 Tag_t& Tag_t::
420 operator= (const Tag_t& x)
421 {
422  if (this != &x)
423  {
424  static_cast< ::xml_schema::type& > (*this) = x;
425  this->name_ = x.name_;
426  }
427 
428  return *this;
429 }
430 
431 Tag_t::
432 ~Tag_t ()
433 {
434 }
435 
436 // Attachment_t
437 //
438 
439 Attachment_t::
440 Attachment_t ()
441 : ::xml_schema::base64_binary (),
442  type_ (this),
443  filename_ (this)
444 {
445 }
446 
447 Attachment_t::
448 Attachment_t (const type_type& type,
449  const filename_type& filename)
450 : ::xml_schema::base64_binary (),
451  type_ (type, this),
452  filename_ (filename, this)
453 {
454 }
455 
456 Attachment_t::
457 Attachment_t (const ::xml_schema::base64_binary& _xsd_base64_binary_base,
458  const type_type& type,
459  const filename_type& filename)
460 : ::xml_schema::base64_binary (_xsd_base64_binary_base),
461  type_ (type, this),
462  filename_ (filename, this)
463 {
464 }
465 
466 Attachment_t::
467 Attachment_t (const Attachment_t& x,
468  ::xml_schema::flags f,
469  ::xml_schema::container* c)
470 : ::xml_schema::base64_binary (x, f, c),
471  type_ (x.type_, f, this),
472  filename_ (x.filename_, f, this)
473 {
474 }
475 
476 Attachment_t::
477 Attachment_t (const ::xercesc::DOMElement& e,
478  ::xml_schema::flags f,
479  ::xml_schema::container* c)
480 : ::xml_schema::base64_binary (e, f | ::xml_schema::flags::base, c),
481  type_ (this),
482  filename_ (this)
483 {
484  if ((f & ::xml_schema::flags::base) == 0)
485  {
486  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
487  this->parse (p, f);
488  }
489 }
490 
491 void Attachment_t::
492 parse (::xsd::cxx::xml::dom::parser< char >& p,
493  ::xml_schema::flags f)
494 {
495  while (p.more_attributes ())
496  {
497  const ::xercesc::DOMAttr& i (p.next_attribute ());
498  const ::xsd::cxx::xml::qualified_name< char > n (
499  ::xsd::cxx::xml::dom::name< char > (i));
500 
501  if (n.name () == "type" && n.namespace_ ().empty ())
502  {
503  this->type_.set (type_traits::create (i, f, this));
504  continue;
505  }
506 
507  if (n.name () == "filename" && n.namespace_ ().empty ())
508  {
509  this->filename_.set (filename_traits::create (i, f, this));
510  continue;
511  }
512  }
513 
514  if (!type_.present ())
515  {
516  throw ::xsd::cxx::tree::expected_attribute< char > (
517  "type",
518  "");
519  }
520 
521  if (!filename_.present ())
522  {
523  throw ::xsd::cxx::tree::expected_attribute< char > (
524  "filename",
525  "");
526  }
527 }
528 
529 Attachment_t* Attachment_t::
530 _clone (::xml_schema::flags f,
531  ::xml_schema::container* c) const
532 {
533  return new class Attachment_t (*this, f, c);
534 }
535 
536 Attachment_t& Attachment_t::
537 operator= (const Attachment_t& x)
538 {
539  if (this != &x)
540  {
541  static_cast< ::xml_schema::base64_binary& > (*this) = x;
542  this->type_ = x.type_;
543  this->filename_ = x.filename_;
544  }
545 
546  return *this;
547 }
548 
549 Attachment_t::
550 ~Attachment_t ()
551 {
552 }
553 
554 // Field_t
555 //
556 
557 Field_t::
558 Field_t ()
559 : ::xml_schema::string (),
560  name_ (this)
561 {
562 }
563 
564 Field_t::
565 Field_t (const name_type& name)
566 : ::xml_schema::string (),
567  name_ (name, this)
568 {
569 }
570 
571 Field_t::
572 Field_t (const char* _xsd_string_base,
573  const name_type& name)
574 : ::xml_schema::string (_xsd_string_base),
575  name_ (name, this)
576 {
577 }
578 
579 Field_t::
580 Field_t (const ::std::string& _xsd_string_base,
581  const name_type& name)
582 : ::xml_schema::string (_xsd_string_base),
583  name_ (name, this)
584 {
585 }
586 
587 Field_t::
588 Field_t (const ::xml_schema::string& _xsd_string_base,
589  const name_type& name)
590 : ::xml_schema::string (_xsd_string_base),
591  name_ (name, this)
592 {
593 }
594 
595 Field_t::
596 Field_t (const Field_t& x,
597  ::xml_schema::flags f,
598  ::xml_schema::container* c)
599 : ::xml_schema::string (x, f, c),
600  name_ (x.name_, f, this)
601 {
602 }
603 
604 Field_t::
605 Field_t (const ::xercesc::DOMElement& e,
606  ::xml_schema::flags f,
607  ::xml_schema::container* c)
608 : ::xml_schema::string (e, f | ::xml_schema::flags::base, c),
609  name_ (this)
610 {
611  if ((f & ::xml_schema::flags::base) == 0)
612  {
613  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
614  this->parse (p, f);
615  }
616 }
617 
618 void Field_t::
619 parse (::xsd::cxx::xml::dom::parser< char >& p,
620  ::xml_schema::flags f)
621 {
622  while (p.more_attributes ())
623  {
624  const ::xercesc::DOMAttr& i (p.next_attribute ());
625  const ::xsd::cxx::xml::qualified_name< char > n (
626  ::xsd::cxx::xml::dom::name< char > (i));
627 
628  if (n.name () == "name" && n.namespace_ ().empty ())
629  {
630  this->name_.set (name_traits::create (i, f, this));
631  continue;
632  }
633  }
634 
635  if (!name_.present ())
636  {
637  throw ::xsd::cxx::tree::expected_attribute< char > (
638  "name",
639  "");
640  }
641 }
642 
643 Field_t* Field_t::
644 _clone (::xml_schema::flags f,
645  ::xml_schema::container* c) const
646 {
647  return new class Field_t (*this, f, c);
648 }
649 
650 Field_t& Field_t::
651 operator= (const Field_t& x)
652 {
653  if (this != &x)
654  {
655  static_cast< ::xml_schema::string& > (*this) = x;
656  this->name_ = x.name_;
657  }
658 
659  return *this;
660 }
661 
662 Field_t::
663 ~Field_t ()
664 {
665 }
666 
667 // Form_t
668 //
669 
670 Form_t::
671 Form_t ()
672 : ::xml_schema::type (),
673  field_ (this),
674  name_ (this)
675 {
676 }
677 
678 Form_t::
679 Form_t (const name_type& name)
680 : ::xml_schema::type (),
681  field_ (this),
682  name_ (name, this)
683 {
684 }
685 
686 Form_t::
687 Form_t (const Form_t& x,
688  ::xml_schema::flags f,
689  ::xml_schema::container* c)
690 : ::xml_schema::type (x, f, c),
691  field_ (x.field_, f, this),
692  name_ (x.name_, f, this)
693 {
694 }
695 
696 Form_t::
697 Form_t (const ::xercesc::DOMElement& e,
698  ::xml_schema::flags f,
699  ::xml_schema::container* c)
700 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
701  field_ (this),
702  name_ (this)
703 {
704  if ((f & ::xml_schema::flags::base) == 0)
705  {
706  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
707  this->parse (p, f);
708  }
709 }
710 
711 void Form_t::
712 parse (::xsd::cxx::xml::dom::parser< char >& p,
713  ::xml_schema::flags f)
714 {
715  for (; p.more_content (); p.next_content (false))
716  {
717  const ::xercesc::DOMElement& i (p.cur_element ());
718  const ::xsd::cxx::xml::qualified_name< char > n (
719  ::xsd::cxx::xml::dom::name< char > (i));
720 
721  // field
722  //
723  if (n.name () == "field" && n.namespace_ ().empty ())
724  {
725  ::std::unique_ptr< field_type > r (
726  field_traits::create (i, f, this));
727 
728  this->field_.push_back (::std::move (r));
729  continue;
730  }
731 
732  break;
733  }
734 
735  while (p.more_attributes ())
736  {
737  const ::xercesc::DOMAttr& i (p.next_attribute ());
738  const ::xsd::cxx::xml::qualified_name< char > n (
739  ::xsd::cxx::xml::dom::name< char > (i));
740 
741  if (n.name () == "name" && n.namespace_ ().empty ())
742  {
743  this->name_.set (name_traits::create (i, f, this));
744  continue;
745  }
746  }
747 
748  if (!name_.present ())
749  {
750  throw ::xsd::cxx::tree::expected_attribute< char > (
751  "name",
752  "");
753  }
754 }
755 
756 Form_t* Form_t::
757 _clone (::xml_schema::flags f,
758  ::xml_schema::container* c) const
759 {
760  return new class Form_t (*this, f, c);
761 }
762 
763 Form_t& Form_t::
764 operator= (const Form_t& x)
765 {
766  if (this != &x)
767  {
768  static_cast< ::xml_schema::type& > (*this) = x;
769  this->field_ = x.field_;
770  this->name_ = x.name_;
771  }
772 
773  return *this;
774 }
775 
776 Form_t::
777 ~Form_t ()
778 {
779 }
780 
781 // ECLEntry_t
782 //
783 
784 ECLEntry_t::
785 ECLEntry_t ()
786 : ::xml_schema::type (),
787  tag_ (this),
788  attachment_ (this),
789  form_ (this),
790  author_ (this),
791  category_ (this),
792  subject_ (this)
793 {
794 }
795 
796 ECLEntry_t::
797 ECLEntry_t (const author_type& author,
798  const category_type& category)
799 : ::xml_schema::type (),
800  tag_ (this),
801  attachment_ (this),
802  form_ (this),
803  author_ (author, this),
804  category_ (category, this),
805  subject_ (this)
806 {
807 }
808 
809 ECLEntry_t::
810 ECLEntry_t (const ECLEntry_t& x,
811  ::xml_schema::flags f,
812  ::xml_schema::container* c)
813 : ::xml_schema::type (x, f, c),
814  tag_ (x.tag_, f, this),
815  attachment_ (x.attachment_, f, this),
816  form_ (x.form_, f, this),
817  author_ (x.author_, f, this),
818  category_ (x.category_, f, this),
819  subject_ (x.subject_, f, this)
820 {
821 }
822 
823 ECLEntry_t::
824 ECLEntry_t (const ::xercesc::DOMElement& e,
825  ::xml_schema::flags f,
826  ::xml_schema::container* c)
827 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
828  tag_ (this),
829  attachment_ (this),
830  form_ (this),
831  author_ (this),
832  category_ (this),
833  subject_ (this)
834 {
835  if ((f & ::xml_schema::flags::base) == 0)
836  {
837  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
838  this->parse (p, f);
839  }
840 }
841 
842 void ECLEntry_t::
843 parse (::xsd::cxx::xml::dom::parser< char >& p,
844  ::xml_schema::flags f)
845 {
846  for (; p.more_content (); p.next_content (false))
847  {
848  const ::xercesc::DOMElement& i (p.cur_element ());
849  const ::xsd::cxx::xml::qualified_name< char > n (
850  ::xsd::cxx::xml::dom::name< char > (i));
851 
852  // tag
853  //
854  if (n.name () == "tag" && n.namespace_ ().empty ())
855  {
856  ::std::unique_ptr< tag_type > r (
857  tag_traits::create (i, f, this));
858 
859  this->tag_.push_back (::std::move (r));
860  continue;
861  }
862 
863  // attachment
864  //
865  if (n.name () == "attachment" && n.namespace_ ().empty ())
866  {
867  ::std::unique_ptr< attachment_type > r (
868  attachment_traits::create (i, f, this));
869 
870  this->attachment_.push_back (::std::move (r));
871  continue;
872  }
873 
874  // form
875  //
876  if (n.name () == "form" && n.namespace_ ().empty ())
877  {
878  ::std::unique_ptr< form_type > r (
879  form_traits::create (i, f, this));
880 
881  if (!this->form_)
882  {
883  this->form_.set (::std::move (r));
884  continue;
885  }
886  }
887 
888  break;
889  }
890 
891  while (p.more_attributes ())
892  {
893  const ::xercesc::DOMAttr& i (p.next_attribute ());
894  const ::xsd::cxx::xml::qualified_name< char > n (
895  ::xsd::cxx::xml::dom::name< char > (i));
896 
897  if (n.name () == "author" && n.namespace_ ().empty ())
898  {
899  this->author_.set (author_traits::create (i, f, this));
900  continue;
901  }
902 
903  if (n.name () == "category" && n.namespace_ ().empty ())
904  {
905  this->category_.set (category_traits::create (i, f, this));
906  continue;
907  }
908 
909  if (n.name () == "subject" && n.namespace_ ().empty ())
910  {
911  this->subject_.set (subject_traits::create (i, f, this));
912  continue;
913  }
914  }
915 
916  if (!author_.present ())
917  {
918  throw ::xsd::cxx::tree::expected_attribute< char > (
919  "author",
920  "");
921  }
922 
923  if (!category_.present ())
924  {
925  throw ::xsd::cxx::tree::expected_attribute< char > (
926  "category",
927  "");
928  }
929 }
930 
931 ECLEntry_t* ECLEntry_t::
932 _clone (::xml_schema::flags f,
933  ::xml_schema::container* c) const
934 {
935  return new class ECLEntry_t (*this, f, c);
936 }
937 
938 ECLEntry_t& ECLEntry_t::
939 operator= (const ECLEntry_t& x)
940 {
941  if (this != &x)
942  {
943  static_cast< ::xml_schema::type& > (*this) = x;
944  this->tag_ = x.tag_;
945  this->attachment_ = x.attachment_;
946  this->form_ = x.form_;
947  this->author_ = x.author_;
948  this->category_ = x.category_;
949  this->subject_ = x.subject_;
950  }
951 
952  return *this;
953 }
954 
955 ECLEntry_t::
956 ~ECLEntry_t ()
957 {
958 }
959 
960 #include <ostream>
961 
962 ::std::ostream&
963 operator<< (::std::ostream& o, const Tag_t& i)
964 {
965  o << ::std::endl << "name: " << i.name ();
966  return o;
967 }
968 
969 ::std::ostream&
970 operator<< (::std::ostream& o, const Attachment_t& i)
971 {
972  o << static_cast< const ::xml_schema::base64_binary& > (i);
973 
974  o << ::std::endl << "type: " << i.type ();
975  o << ::std::endl << "filename: " << i.filename ();
976  return o;
977 }
978 
979 ::std::ostream&
980 operator<< (::std::ostream& o, const Field_t& i)
981 {
982  o << static_cast< const ::xml_schema::string& > (i);
983 
984  o << ::std::endl << "name: " << i.name ();
985  return o;
986 }
987 
988 ::std::ostream&
989 operator<< (::std::ostream& o, const Form_t& i)
990 {
991  for (Form_t::field_const_iterator
992  b (i.field ().begin ()), e (i.field ().end ());
993  b != e; ++b)
994  {
995  o << ::std::endl << "field: " << *b;
996  }
997 
998  o << ::std::endl << "name: " << i.name ();
999  return o;
1000 }
1001 
1002 ::std::ostream&
1003 operator<< (::std::ostream& o, const ECLEntry_t& i)
1004 {
1005  for (ECLEntry_t::tag_const_iterator
1006  b (i.tag ().begin ()), e (i.tag ().end ());
1007  b != e; ++b)
1008  {
1009  o << ::std::endl << "tag: " << *b;
1010  }
1011 
1012  for (ECLEntry_t::attachment_const_iterator
1013  b (i.attachment ().begin ()), e (i.attachment ().end ());
1014  b != e; ++b)
1015  {
1016  o << ::std::endl << "attachment: " << *b;
1017  }
1018 
1019  if (i.form ())
1020  {
1021  o << ::std::endl << "form: " << *i.form ();
1022  }
1023 
1024  o << ::std::endl << "author: " << i.author ();
1025  o << ::std::endl << "category: " << i.category ();
1026  if (i.subject ())
1027  {
1028  o << ::std::endl << "subject: " << *i.subject ();
1029  }
1030 
1031  return o;
1032 }
1033 
1034 #include <istream>
1035 #include <xsd/cxx/xml/sax/std-input-source.hxx>
1036 #include <xsd/cxx/tree/error-handler.hxx>
1037 
1038 ::std::unique_ptr< ::ECLEntry_t >
1039 entry (const ::std::string& u,
1040  ::xml_schema::flags f,
1041  const ::xml_schema::properties& p)
1042 {
1043  ::xsd::cxx::xml::auto_initializer i (
1044  (f & ::xml_schema::flags::dont_initialize) == 0,
1045  (f & ::xml_schema::flags::keep_dom) == 0);
1046 
1047  ::xsd::cxx::tree::error_handler< char > h;
1048 
1049  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1050  ::xsd::cxx::xml::dom::parse< char > (
1051  u, h, p, f));
1052 
1053  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
1054 
1055  return ::std::unique_ptr< ::ECLEntry_t > (
1056  ::entry (
1057  std::move (d), f | ::xml_schema::flags::own_dom, p));
1058 }
1059 
1060 ::std::unique_ptr< ::ECLEntry_t >
1061 entry (const ::std::string& u,
1062  ::xml_schema::error_handler& h,
1063  ::xml_schema::flags f,
1064  const ::xml_schema::properties& p)
1065 {
1066  ::xsd::cxx::xml::auto_initializer i (
1067  (f & ::xml_schema::flags::dont_initialize) == 0,
1068  (f & ::xml_schema::flags::keep_dom) == 0);
1069 
1070  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1071  ::xsd::cxx::xml::dom::parse< char > (
1072  u, h, p, f));
1073 
1074  if (!d.get ())
1075  throw ::xsd::cxx::tree::parsing< char > ();
1076 
1077  return ::std::unique_ptr< ::ECLEntry_t > (
1078  ::entry (
1079  std::move (d), f | ::xml_schema::flags::own_dom, p));
1080 }
1081 
1082 ::std::unique_ptr< ::ECLEntry_t >
1083 entry (const ::std::string& u,
1084  ::xercesc::DOMErrorHandler& h,
1085  ::xml_schema::flags f,
1086  const ::xml_schema::properties& p)
1087 {
1088  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1089  ::xsd::cxx::xml::dom::parse< char > (
1090  u, h, p, f));
1091 
1092  if (!d.get ())
1093  throw ::xsd::cxx::tree::parsing< char > ();
1094 
1095  return ::std::unique_ptr< ::ECLEntry_t > (
1096  ::entry (
1097  std::move (d), f | ::xml_schema::flags::own_dom, p));
1098 }
1099 
1100 ::std::unique_ptr< ::ECLEntry_t >
1101 entry (::std::istream& is,
1102  ::xml_schema::flags f,
1103  const ::xml_schema::properties& p)
1104 {
1105  ::xsd::cxx::xml::auto_initializer i (
1106  (f & ::xml_schema::flags::dont_initialize) == 0,
1107  (f & ::xml_schema::flags::keep_dom) == 0);
1108 
1109  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1110  return ::entry (isrc, f, p);
1111 }
1112 
1113 ::std::unique_ptr< ::ECLEntry_t >
1114 entry (::std::istream& is,
1115  ::xml_schema::error_handler& h,
1116  ::xml_schema::flags f,
1117  const ::xml_schema::properties& p)
1118 {
1119  ::xsd::cxx::xml::auto_initializer i (
1120  (f & ::xml_schema::flags::dont_initialize) == 0,
1121  (f & ::xml_schema::flags::keep_dom) == 0);
1122 
1123  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1124  return ::entry (isrc, h, f, p);
1125 }
1126 
1127 ::std::unique_ptr< ::ECLEntry_t >
1128 entry (::std::istream& is,
1129  ::xercesc::DOMErrorHandler& h,
1130  ::xml_schema::flags f,
1131  const ::xml_schema::properties& p)
1132 {
1133  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1134  return ::entry (isrc, h, f, p);
1135 }
1136 
1137 ::std::unique_ptr< ::ECLEntry_t >
1138 entry (::std::istream& is,
1139  const ::std::string& sid,
1140  ::xml_schema::flags f,
1141  const ::xml_schema::properties& p)
1142 {
1143  ::xsd::cxx::xml::auto_initializer i (
1144  (f & ::xml_schema::flags::dont_initialize) == 0,
1145  (f & ::xml_schema::flags::keep_dom) == 0);
1146 
1147  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1148  return ::entry (isrc, f, p);
1149 }
1150 
1151 ::std::unique_ptr< ::ECLEntry_t >
1152 entry (::std::istream& is,
1153  const ::std::string& sid,
1154  ::xml_schema::error_handler& h,
1155  ::xml_schema::flags f,
1156  const ::xml_schema::properties& p)
1157 {
1158  ::xsd::cxx::xml::auto_initializer i (
1159  (f & ::xml_schema::flags::dont_initialize) == 0,
1160  (f & ::xml_schema::flags::keep_dom) == 0);
1161 
1162  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1163  return ::entry (isrc, h, f, p);
1164 }
1165 
1166 ::std::unique_ptr< ::ECLEntry_t >
1167 entry (::std::istream& is,
1168  const ::std::string& sid,
1169  ::xercesc::DOMErrorHandler& h,
1170  ::xml_schema::flags f,
1171  const ::xml_schema::properties& p)
1172 {
1173  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1174  return ::entry (isrc, h, f, p);
1175 }
1176 
1177 ::std::unique_ptr< ::ECLEntry_t >
1178 entry (::xercesc::InputSource& i,
1179  ::xml_schema::flags f,
1180  const ::xml_schema::properties& p)
1181 {
1182  ::xsd::cxx::tree::error_handler< char > h;
1183 
1184  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1185  ::xsd::cxx::xml::dom::parse< char > (
1186  i, h, p, f));
1187 
1188  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
1189 
1190  return ::std::unique_ptr< ::ECLEntry_t > (
1191  ::entry (
1192  std::move (d), f | ::xml_schema::flags::own_dom, p));
1193 }
1194 
1195 ::std::unique_ptr< ::ECLEntry_t >
1196 entry (::xercesc::InputSource& i,
1197  ::xml_schema::error_handler& h,
1198  ::xml_schema::flags f,
1199  const ::xml_schema::properties& p)
1200 {
1201  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1202  ::xsd::cxx::xml::dom::parse< char > (
1203  i, h, p, f));
1204 
1205  if (!d.get ())
1206  throw ::xsd::cxx::tree::parsing< char > ();
1207 
1208  return ::std::unique_ptr< ::ECLEntry_t > (
1209  ::entry (
1210  std::move (d), f | ::xml_schema::flags::own_dom, p));
1211 }
1212 
1213 ::std::unique_ptr< ::ECLEntry_t >
1214 entry (::xercesc::InputSource& i,
1215  ::xercesc::DOMErrorHandler& h,
1216  ::xml_schema::flags f,
1217  const ::xml_schema::properties& p)
1218 {
1219  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1220  ::xsd::cxx::xml::dom::parse< char > (
1221  i, h, p, f));
1222 
1223  if (!d.get ())
1224  throw ::xsd::cxx::tree::parsing< char > ();
1225 
1226  return ::std::unique_ptr< ::ECLEntry_t > (
1227  ::entry (
1228  std::move (d), f | ::xml_schema::flags::own_dom, p));
1229 }
1230 
1231 ::std::unique_ptr< ::ECLEntry_t >
1232 entry (const ::xercesc::DOMDocument& doc,
1233  ::xml_schema::flags f,
1234  const ::xml_schema::properties& p)
1235 {
1236  if (f & ::xml_schema::flags::keep_dom)
1237  {
1238  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1239  static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));
1240 
1241  return ::std::unique_ptr< ::ECLEntry_t > (
1242  ::entry (
1243  std::move (d), f | ::xml_schema::flags::own_dom, p));
1244  }
1245 
1246  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
1247  const ::xsd::cxx::xml::qualified_name< char > n (
1248  ::xsd::cxx::xml::dom::name< char > (e));
1249 
1250  if (n.name () == "entry" &&
1251  n.namespace_ () == "")
1252  {
1253  ::std::unique_ptr< ::ECLEntry_t > r (
1254  ::xsd::cxx::tree::traits< ::ECLEntry_t, char >::create (
1255  e, f, 0));
1256  return r;
1257  }
1258 
1259  throw ::xsd::cxx::tree::unexpected_element < char > (
1260  n.name (),
1261  n.namespace_ (),
1262  "entry",
1263  "");
1264 }
1265 
1266 ::std::unique_ptr< ::ECLEntry_t >
1267 entry (::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d,
1268  ::xml_schema::flags f,
1269  const ::xml_schema::properties&)
1270 {
1271  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > c (
1272  ((f & ::xml_schema::flags::keep_dom) &&
1273  !(f & ::xml_schema::flags::own_dom))
1274  ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
1275  : 0);
1276 
1277  ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
1278  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
1279 
1280  const ::xsd::cxx::xml::qualified_name< char > n (
1281  ::xsd::cxx::xml::dom::name< char > (e));
1282 
1283  if (f & ::xml_schema::flags::keep_dom)
1284  doc.setUserData (::xml_schema::dom::tree_node_key,
1285  (c.get () ? &c : &d),
1286  0);
1287 
1288  if (n.name () == "entry" &&
1289  n.namespace_ () == "")
1290  {
1291  ::std::unique_ptr< ::ECLEntry_t > r (
1292  ::xsd::cxx::tree::traits< ::ECLEntry_t, char >::create (
1293  e, f, 0));
1294  return r;
1295  }
1296 
1297  throw ::xsd::cxx::tree::unexpected_element < char > (
1298  n.name (),
1299  n.namespace_ (),
1300  "entry",
1301  "");
1302 }
1303 
1304 #include <ostream>
1305 #include <xsd/cxx/tree/error-handler.hxx>
1306 #include <xsd/cxx/xml/dom/serialization-source.hxx>
1307 
1308 void
1309 entry (::std::ostream& o,
1310  const ::ECLEntry_t& s,
1311  const ::xml_schema::namespace_infomap& m,
1312  const ::std::string& e,
1313  ::xml_schema::flags f)
1314 {
1315  ::xsd::cxx::xml::auto_initializer i (
1316  (f & ::xml_schema::flags::dont_initialize) == 0);
1317 
1318  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1319  ::entry (s, m, f));
1320 
1321  ::xsd::cxx::tree::error_handler< char > h;
1322 
1323  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1324  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1325  {
1326  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
1327  }
1328 }
1329 
1330 void
1331 entry (::std::ostream& o,
1332  const ::ECLEntry_t& s,
1333  ::xml_schema::error_handler& h,
1334  const ::xml_schema::namespace_infomap& m,
1335  const ::std::string& e,
1336  ::xml_schema::flags f)
1337 {
1338  ::xsd::cxx::xml::auto_initializer i (
1339  (f & ::xml_schema::flags::dont_initialize) == 0);
1340 
1341  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1342  ::entry (s, m, f));
1343  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1344  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1345  {
1346  throw ::xsd::cxx::tree::serialization< char > ();
1347  }
1348 }
1349 
1350 void
1351 entry (::std::ostream& o,
1352  const ::ECLEntry_t& s,
1353  ::xercesc::DOMErrorHandler& h,
1354  const ::xml_schema::namespace_infomap& m,
1355  const ::std::string& e,
1356  ::xml_schema::flags f)
1357 {
1358  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1359  ::entry (s, m, f));
1360  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1361  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1362  {
1363  throw ::xsd::cxx::tree::serialization< char > ();
1364  }
1365 }
1366 
1367 void
1368 entry (::xercesc::XMLFormatTarget& t,
1369  const ::ECLEntry_t& s,
1370  const ::xml_schema::namespace_infomap& m,
1371  const ::std::string& e,
1372  ::xml_schema::flags f)
1373 {
1374  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1375  ::entry (s, m, f));
1376 
1377  ::xsd::cxx::tree::error_handler< char > h;
1378 
1379  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1380  {
1381  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
1382  }
1383 }
1384 
1385 void
1386 entry (::xercesc::XMLFormatTarget& t,
1387  const ::ECLEntry_t& s,
1388  ::xml_schema::error_handler& h,
1389  const ::xml_schema::namespace_infomap& m,
1390  const ::std::string& e,
1391  ::xml_schema::flags f)
1392 {
1393  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1394  ::entry (s, m, f));
1395  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1396  {
1397  throw ::xsd::cxx::tree::serialization< char > ();
1398  }
1399 }
1400 
1401 void
1402 entry (::xercesc::XMLFormatTarget& t,
1403  const ::ECLEntry_t& s,
1404  ::xercesc::DOMErrorHandler& h,
1405  const ::xml_schema::namespace_infomap& m,
1406  const ::std::string& e,
1407  ::xml_schema::flags f)
1408 {
1409  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1410  ::entry (s, m, f));
1411  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1412  {
1413  throw ::xsd::cxx::tree::serialization< char > ();
1414  }
1415 }
1416 
1417 void
1418 entry (::xercesc::DOMDocument& d,
1419  const ::ECLEntry_t& s,
1420  ::xml_schema::flags)
1421 {
1422  ::xercesc::DOMElement& e (*d.getDocumentElement ());
1423  const ::xsd::cxx::xml::qualified_name< char > n (
1424  ::xsd::cxx::xml::dom::name< char > (e));
1425 
1426  if (n.name () == "entry" &&
1427  n.namespace_ () == "")
1428  {
1429  e << s;
1430  }
1431  else
1432  {
1433  throw ::xsd::cxx::tree::unexpected_element < char > (
1434  n.name (),
1435  n.namespace_ (),
1436  "entry",
1437  "");
1438  }
1439 }
1440 
1441 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument >
1442 entry (const ::ECLEntry_t& s,
1443  const ::xml_schema::namespace_infomap& m,
1444  ::xml_schema::flags f)
1445 {
1446  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1447  ::xsd::cxx::xml::dom::serialize< char > (
1448  "entry",
1449  "",
1450  m, f));
1451 
1452  ::entry (*d, s, f);
1453  return d;
1454 }
1455 
1456 void
1457 operator<< (::xercesc::DOMElement& e, const Tag_t& i)
1458 {
1459  e << static_cast< const ::xml_schema::type& > (i);
1460 
1461  // name
1462  //
1463  {
1464  ::xercesc::DOMAttr& a (
1465  ::xsd::cxx::xml::dom::create_attribute (
1466  "name",
1467  e));
1468 
1469  a << i.name ();
1470  }
1471 }
1472 
1473 void
1474 operator<< (::xercesc::DOMElement& e, const Attachment_t& i)
1475 {
1476  e << static_cast< const ::xml_schema::base64_binary& > (i);
1477 
1478  // type
1479  //
1480  {
1481  ::xercesc::DOMAttr& a (
1482  ::xsd::cxx::xml::dom::create_attribute (
1483  "type",
1484  e));
1485 
1486  a << i.type ();
1487  }
1488 
1489  // filename
1490  //
1491  {
1492  ::xercesc::DOMAttr& a (
1493  ::xsd::cxx::xml::dom::create_attribute (
1494  "filename",
1495  e));
1496 
1497  a << i.filename ();
1498  }
1499 }
1500 
1501 void
1502 operator<< (::xercesc::DOMElement& e, const Field_t& i)
1503 {
1504  e << static_cast< const ::xml_schema::string& > (i);
1505 
1506  // name
1507  //
1508  {
1509  ::xercesc::DOMAttr& a (
1510  ::xsd::cxx::xml::dom::create_attribute (
1511  "name",
1512  e));
1513 
1514  a << i.name ();
1515  }
1516 }
1517 
1518 void
1519 operator<< (::xercesc::DOMElement& e, const Form_t& i)
1520 {
1521  e << static_cast< const ::xml_schema::type& > (i);
1522 
1523  // field
1524  //
1525  for (Form_t::field_const_iterator
1526  b (i.field ().begin ()), n (i.field ().end ());
1527  b != n; ++b)
1528  {
1529  ::xercesc::DOMElement& s (
1530  ::xsd::cxx::xml::dom::create_element (
1531  "field",
1532  e));
1533 
1534  s << *b;
1535  }
1536 
1537  // name
1538  //
1539  {
1540  ::xercesc::DOMAttr& a (
1541  ::xsd::cxx::xml::dom::create_attribute (
1542  "name",
1543  e));
1544 
1545  a << i.name ();
1546  }
1547 }
1548 
1549 void
1550 operator<< (::xercesc::DOMElement& e, const ECLEntry_t& i)
1551 {
1552  e << static_cast< const ::xml_schema::type& > (i);
1553 
1554  // tag
1555  //
1556  for (ECLEntry_t::tag_const_iterator
1557  b (i.tag ().begin ()), n (i.tag ().end ());
1558  b != n; ++b)
1559  {
1560  ::xercesc::DOMElement& s (
1561  ::xsd::cxx::xml::dom::create_element (
1562  "tag",
1563  e));
1564 
1565  s << *b;
1566  }
1567 
1568  // attachment
1569  //
1570  for (ECLEntry_t::attachment_const_iterator
1571  b (i.attachment ().begin ()), n (i.attachment ().end ());
1572  b != n; ++b)
1573  {
1574  ::xercesc::DOMElement& s (
1575  ::xsd::cxx::xml::dom::create_element (
1576  "attachment",
1577  e));
1578 
1579  s << *b;
1580  }
1581 
1582  // form
1583  //
1584  if (i.form ())
1585  {
1586  ::xercesc::DOMElement& s (
1587  ::xsd::cxx::xml::dom::create_element (
1588  "form",
1589  e));
1590 
1591  s << *i.form ();
1592  }
1593 
1594  // author
1595  //
1596  {
1597  ::xercesc::DOMAttr& a (
1598  ::xsd::cxx::xml::dom::create_attribute (
1599  "author",
1600  e));
1601 
1602  a << i.author ();
1603  }
1604 
1605  // category
1606  //
1607  {
1608  ::xercesc::DOMAttr& a (
1609  ::xsd::cxx::xml::dom::create_attribute (
1610  "category",
1611  e));
1612 
1613  a << i.category ();
1614  }
1615 
1616  // subject
1617  //
1618  if (i.subject ())
1619  {
1620  ::xercesc::DOMAttr& a (
1621  ::xsd::cxx::xml::dom::create_attribute (
1622  "subject",
1623  e));
1624 
1625  a << *i.subject ();
1626  }
1627 }
1628 
1629 #include <xsd/cxx/post.hxx>
1630 
1631 // Begin epilogue.
1632 //
1633 //
1634 // End epilogue.
1635 
Definition: ECL.hxx:277
Definition: ECL.hxx:547
Definition: ECL.hxx:410
Definition: ECL.hxx:474