otsdaq_utilities  v2_02_00
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 
315 #include <xsd/cxx/xml/dom/parsing-source.hxx>
316 
317 // Tag_t
318 //
319 
320 Tag_t::
321 Tag_t ()
322 : ::xml_schema::type (),
323  name_ (this)
324 {
325 }
326 
327 Tag_t::
328 Tag_t (const name_type& name)
329 : ::xml_schema::type (),
330  name_ (name, this)
331 {
332 }
333 
334 Tag_t::
335 Tag_t (const Tag_t& x,
336  ::xml_schema::flags f,
337  ::xml_schema::container* c)
338 : ::xml_schema::type (x, f, c),
339  name_ (x.name_, f, this)
340 {
341 }
342 
343 Tag_t::
344 Tag_t (const ::xercesc::DOMElement& e,
345  ::xml_schema::flags f,
346  ::xml_schema::container* c)
347 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
348  name_ (this)
349 {
350  if ((f & ::xml_schema::flags::base) == 0)
351  {
352  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
353  this->parse (p, f);
354  }
355 }
356 
357 void Tag_t::
358 parse (::xsd::cxx::xml::dom::parser< char >& p,
359  ::xml_schema::flags f)
360 {
361  while (p.more_attributes ())
362  {
363  const ::xercesc::DOMAttr& i (p.next_attribute ());
364  const ::xsd::cxx::xml::qualified_name< char > n (
365  ::xsd::cxx::xml::dom::name< char > (i));
366 
367  if (n.name () == "name" && n.namespace_ ().empty ())
368  {
369  this->name_.set (name_traits::create (i, f, this));
370  continue;
371  }
372  }
373 
374  if (!name_.present ())
375  {
376  throw ::xsd::cxx::tree::expected_attribute< char > (
377  "name",
378  "");
379  }
380 }
381 
382 Tag_t* Tag_t::
383 _clone (::xml_schema::flags f,
384  ::xml_schema::container* c) const
385 {
386  return new class Tag_t (*this, f, c);
387 }
388 
389 Tag_t& Tag_t::
390 operator= (const Tag_t& x)
391 {
392  if (this != &x)
393  {
394  static_cast< ::xml_schema::type& > (*this) = x;
395  this->name_ = x.name_;
396  }
397 
398  return *this;
399 }
400 
401 Tag_t::
402 ~Tag_t ()
403 {
404 }
405 
406 // Attachment_t
407 //
408 
409 Attachment_t::
410 Attachment_t ()
411 : ::xml_schema::base64_binary (),
412  type_ (this),
413  filename_ (this)
414 {
415 }
416 
417 Attachment_t::
418 Attachment_t (const type_type& type,
419  const filename_type& filename)
420 : ::xml_schema::base64_binary (),
421  type_ (type, this),
422  filename_ (filename, this)
423 {
424 }
425 
426 Attachment_t::
427 Attachment_t (const ::xml_schema::base64_binary& _xsd_base64_binary_base,
428  const type_type& type,
429  const filename_type& filename)
430 : ::xml_schema::base64_binary (_xsd_base64_binary_base),
431  type_ (type, this),
432  filename_ (filename, this)
433 {
434 }
435 
436 Attachment_t::
437 Attachment_t (const Attachment_t& x,
438  ::xml_schema::flags f,
439  ::xml_schema::container* c)
440 : ::xml_schema::base64_binary (x, f, c),
441  type_ (x.type_, f, this),
442  filename_ (x.filename_, f, this)
443 {
444 }
445 
446 Attachment_t::
447 Attachment_t (const ::xercesc::DOMElement& e,
448  ::xml_schema::flags f,
449  ::xml_schema::container* c)
450 : ::xml_schema::base64_binary (e, f | ::xml_schema::flags::base, c),
451  type_ (this),
452  filename_ (this)
453 {
454  if ((f & ::xml_schema::flags::base) == 0)
455  {
456  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
457  this->parse (p, f);
458  }
459 }
460 
461 void Attachment_t::
462 parse (::xsd::cxx::xml::dom::parser< char >& p,
463  ::xml_schema::flags f)
464 {
465  while (p.more_attributes ())
466  {
467  const ::xercesc::DOMAttr& i (p.next_attribute ());
468  const ::xsd::cxx::xml::qualified_name< char > n (
469  ::xsd::cxx::xml::dom::name< char > (i));
470 
471  if (n.name () == "type" && n.namespace_ ().empty ())
472  {
473  this->type_.set (type_traits::create (i, f, this));
474  continue;
475  }
476 
477  if (n.name () == "filename" && n.namespace_ ().empty ())
478  {
479  this->filename_.set (filename_traits::create (i, f, this));
480  continue;
481  }
482  }
483 
484  if (!type_.present ())
485  {
486  throw ::xsd::cxx::tree::expected_attribute< char > (
487  "type",
488  "");
489  }
490 
491  if (!filename_.present ())
492  {
493  throw ::xsd::cxx::tree::expected_attribute< char > (
494  "filename",
495  "");
496  }
497 }
498 
499 Attachment_t* Attachment_t::
500 _clone (::xml_schema::flags f,
501  ::xml_schema::container* c) const
502 {
503  return new class Attachment_t (*this, f, c);
504 }
505 
506 Attachment_t& Attachment_t::
507 operator= (const Attachment_t& x)
508 {
509  if (this != &x)
510  {
511  static_cast< ::xml_schema::base64_binary& > (*this) = x;
512  this->type_ = x.type_;
513  this->filename_ = x.filename_;
514  }
515 
516  return *this;
517 }
518 
519 Attachment_t::
520 ~Attachment_t ()
521 {
522 }
523 
524 // Field_t
525 //
526 
527 Field_t::
528 Field_t ()
529 : ::xml_schema::string (),
530  name_ (this)
531 {
532 }
533 
534 Field_t::
535 Field_t (const name_type& name)
536 : ::xml_schema::string (),
537  name_ (name, this)
538 {
539 }
540 
541 Field_t::
542 Field_t (const char* _xsd_string_base,
543  const name_type& name)
544 : ::xml_schema::string (_xsd_string_base),
545  name_ (name, this)
546 {
547 }
548 
549 Field_t::
550 Field_t (const ::std::string& _xsd_string_base,
551  const name_type& name)
552 : ::xml_schema::string (_xsd_string_base),
553  name_ (name, this)
554 {
555 }
556 
557 Field_t::
558 Field_t (const ::xml_schema::string& _xsd_string_base,
559  const name_type& name)
560 : ::xml_schema::string (_xsd_string_base),
561  name_ (name, this)
562 {
563 }
564 
565 Field_t::
566 Field_t (const Field_t& x,
567  ::xml_schema::flags f,
568  ::xml_schema::container* c)
569 : ::xml_schema::string (x, f, c),
570  name_ (x.name_, f, this)
571 {
572 }
573 
574 Field_t::
575 Field_t (const ::xercesc::DOMElement& e,
576  ::xml_schema::flags f,
577  ::xml_schema::container* c)
578 : ::xml_schema::string (e, f | ::xml_schema::flags::base, c),
579  name_ (this)
580 {
581  if ((f & ::xml_schema::flags::base) == 0)
582  {
583  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
584  this->parse (p, f);
585  }
586 }
587 
588 void Field_t::
589 parse (::xsd::cxx::xml::dom::parser< char >& p,
590  ::xml_schema::flags f)
591 {
592  while (p.more_attributes ())
593  {
594  const ::xercesc::DOMAttr& i (p.next_attribute ());
595  const ::xsd::cxx::xml::qualified_name< char > n (
596  ::xsd::cxx::xml::dom::name< char > (i));
597 
598  if (n.name () == "name" && n.namespace_ ().empty ())
599  {
600  this->name_.set (name_traits::create (i, f, this));
601  continue;
602  }
603  }
604 
605  if (!name_.present ())
606  {
607  throw ::xsd::cxx::tree::expected_attribute< char > (
608  "name",
609  "");
610  }
611 }
612 
613 Field_t* Field_t::
614 _clone (::xml_schema::flags f,
615  ::xml_schema::container* c) const
616 {
617  return new class Field_t (*this, f, c);
618 }
619 
620 Field_t& Field_t::
621 operator= (const Field_t& x)
622 {
623  if (this != &x)
624  {
625  static_cast< ::xml_schema::string& > (*this) = x;
626  this->name_ = x.name_;
627  }
628 
629  return *this;
630 }
631 
632 Field_t::
633 ~Field_t ()
634 {
635 }
636 
637 // Form_t
638 //
639 
640 Form_t::
641 Form_t ()
642 : ::xml_schema::type (),
643  field_ (this),
644  name_ (this)
645 {
646 }
647 
648 Form_t::
649 Form_t (const name_type& name)
650 : ::xml_schema::type (),
651  field_ (this),
652  name_ (name, this)
653 {
654 }
655 
656 Form_t::
657 Form_t (const Form_t& x,
658  ::xml_schema::flags f,
659  ::xml_schema::container* c)
660 : ::xml_schema::type (x, f, c),
661  field_ (x.field_, f, this),
662  name_ (x.name_, f, this)
663 {
664 }
665 
666 Form_t::
667 Form_t (const ::xercesc::DOMElement& e,
668  ::xml_schema::flags f,
669  ::xml_schema::container* c)
670 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
671  field_ (this),
672  name_ (this)
673 {
674  if ((f & ::xml_schema::flags::base) == 0)
675  {
676  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
677  this->parse (p, f);
678  }
679 }
680 
681 void Form_t::
682 parse (::xsd::cxx::xml::dom::parser< char >& p,
683  ::xml_schema::flags f)
684 {
685  for (; p.more_content (); p.next_content (false))
686  {
687  const ::xercesc::DOMElement& i (p.cur_element ());
688  const ::xsd::cxx::xml::qualified_name< char > n (
689  ::xsd::cxx::xml::dom::name< char > (i));
690 
691  // field
692  //
693  if (n.name () == "field" && n.namespace_ ().empty ())
694  {
695  ::std::unique_ptr< field_type > r (
696  field_traits::create (i, f, this));
697 
698  this->field_.push_back (::std::move (r));
699  continue;
700  }
701 
702  break;
703  }
704 
705  while (p.more_attributes ())
706  {
707  const ::xercesc::DOMAttr& i (p.next_attribute ());
708  const ::xsd::cxx::xml::qualified_name< char > n (
709  ::xsd::cxx::xml::dom::name< char > (i));
710 
711  if (n.name () == "name" && n.namespace_ ().empty ())
712  {
713  this->name_.set (name_traits::create (i, f, this));
714  continue;
715  }
716  }
717 
718  if (!name_.present ())
719  {
720  throw ::xsd::cxx::tree::expected_attribute< char > (
721  "name",
722  "");
723  }
724 }
725 
726 Form_t* Form_t::
727 _clone (::xml_schema::flags f,
728  ::xml_schema::container* c) const
729 {
730  return new class Form_t (*this, f, c);
731 }
732 
733 Form_t& Form_t::
734 operator= (const Form_t& x)
735 {
736  if (this != &x)
737  {
738  static_cast< ::xml_schema::type& > (*this) = x;
739  this->field_ = x.field_;
740  this->name_ = x.name_;
741  }
742 
743  return *this;
744 }
745 
746 Form_t::
747 ~Form_t ()
748 {
749 }
750 
751 // ECLEntry_t
752 //
753 
754 ECLEntry_t::
755 ECLEntry_t ()
756 : ::xml_schema::type (),
757  tag_ (this),
758  attachment_ (this),
759  form_ (this),
760  author_ (this),
761  category_ (this)
762 {
763 }
764 
765 ECLEntry_t::
766 ECLEntry_t (const author_type& author,
767  const category_type& category)
768 : ::xml_schema::type (),
769  tag_ (this),
770  attachment_ (this),
771  form_ (this),
772  author_ (author, this),
773  category_ (category, this)
774 {
775 }
776 
777 ECLEntry_t::
778 ECLEntry_t (const ECLEntry_t& x,
779  ::xml_schema::flags f,
780  ::xml_schema::container* c)
781 : ::xml_schema::type (x, f, c),
782  tag_ (x.tag_, f, this),
783  attachment_ (x.attachment_, f, this),
784  form_ (x.form_, f, this),
785  author_ (x.author_, f, this),
786  category_ (x.category_, f, this)
787 {
788 }
789 
790 ECLEntry_t::
791 ECLEntry_t (const ::xercesc::DOMElement& e,
792  ::xml_schema::flags f,
793  ::xml_schema::container* c)
794 : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
795  tag_ (this),
796  attachment_ (this),
797  form_ (this),
798  author_ (this),
799  category_ (this)
800 {
801  if ((f & ::xml_schema::flags::base) == 0)
802  {
803  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
804  this->parse (p, f);
805  }
806 }
807 
808 void ECLEntry_t::
809 parse (::xsd::cxx::xml::dom::parser< char >& p,
810  ::xml_schema::flags f)
811 {
812  for (; p.more_content (); p.next_content (false))
813  {
814  const ::xercesc::DOMElement& i (p.cur_element ());
815  const ::xsd::cxx::xml::qualified_name< char > n (
816  ::xsd::cxx::xml::dom::name< char > (i));
817 
818  // tag
819  //
820  if (n.name () == "tag" && n.namespace_ ().empty ())
821  {
822  ::std::unique_ptr< tag_type > r (
823  tag_traits::create (i, f, this));
824 
825  this->tag_.push_back (::std::move (r));
826  continue;
827  }
828 
829  // attachment
830  //
831  if (n.name () == "attachment" && n.namespace_ ().empty ())
832  {
833  ::std::unique_ptr< attachment_type > r (
834  attachment_traits::create (i, f, this));
835 
836  this->attachment_.push_back (::std::move (r));
837  continue;
838  }
839 
840  // form
841  //
842  if (n.name () == "form" && n.namespace_ ().empty ())
843  {
844  ::std::unique_ptr< form_type > r (
845  form_traits::create (i, f, this));
846 
847  if (!this->form_)
848  {
849  this->form_.set (::std::move (r));
850  continue;
851  }
852  }
853 
854  break;
855  }
856 
857  while (p.more_attributes ())
858  {
859  const ::xercesc::DOMAttr& i (p.next_attribute ());
860  const ::xsd::cxx::xml::qualified_name< char > n (
861  ::xsd::cxx::xml::dom::name< char > (i));
862 
863  if (n.name () == "author" && n.namespace_ ().empty ())
864  {
865  this->author_.set (author_traits::create (i, f, this));
866  continue;
867  }
868 
869  if (n.name () == "category" && n.namespace_ ().empty ())
870  {
871  this->category_.set (category_traits::create (i, f, this));
872  continue;
873  }
874  }
875 
876  if (!author_.present ())
877  {
878  throw ::xsd::cxx::tree::expected_attribute< char > (
879  "author",
880  "");
881  }
882 
883  if (!category_.present ())
884  {
885  throw ::xsd::cxx::tree::expected_attribute< char > (
886  "category",
887  "");
888  }
889 }
890 
891 ECLEntry_t* ECLEntry_t::
892 _clone (::xml_schema::flags f,
893  ::xml_schema::container* c) const
894 {
895  return new class ECLEntry_t (*this, f, c);
896 }
897 
898 ECLEntry_t& ECLEntry_t::
899 operator= (const ECLEntry_t& x)
900 {
901  if (this != &x)
902  {
903  static_cast< ::xml_schema::type& > (*this) = x;
904  this->tag_ = x.tag_;
905  this->attachment_ = x.attachment_;
906  this->form_ = x.form_;
907  this->author_ = x.author_;
908  this->category_ = x.category_;
909  }
910 
911  return *this;
912 }
913 
914 ECLEntry_t::
915 ~ECLEntry_t ()
916 {
917 }
918 
919 #include <ostream>
920 
921 ::std::ostream&
922 operator<< (::std::ostream& o, const Tag_t& i)
923 {
924  o << ::std::endl << "name: " << i.name ();
925  return o;
926 }
927 
928 ::std::ostream&
929 operator<< (::std::ostream& o, const Attachment_t& i)
930 {
931  o << static_cast< const ::xml_schema::base64_binary& > (i);
932 
933  o << ::std::endl << "type: " << i.type ();
934  o << ::std::endl << "filename: " << i.filename ();
935  return o;
936 }
937 
938 ::std::ostream&
939 operator<< (::std::ostream& o, const Field_t& i)
940 {
941  o << static_cast< const ::xml_schema::string& > (i);
942 
943  o << ::std::endl << "name: " << i.name ();
944  return o;
945 }
946 
947 ::std::ostream&
948 operator<< (::std::ostream& o, const Form_t& i)
949 {
950  for (Form_t::field_const_iterator
951  b (i.field ().begin ()), e (i.field ().end ());
952  b != e; ++b)
953  {
954  o << ::std::endl << "field: " << *b;
955  }
956 
957  o << ::std::endl << "name: " << i.name ();
958  return o;
959 }
960 
961 ::std::ostream&
962 operator<< (::std::ostream& o, const ECLEntry_t& i)
963 {
964  for (ECLEntry_t::tag_const_iterator
965  b (i.tag ().begin ()), e (i.tag ().end ());
966  b != e; ++b)
967  {
968  o << ::std::endl << "tag: " << *b;
969  }
970 
971  for (ECLEntry_t::attachment_const_iterator
972  b (i.attachment ().begin ()), e (i.attachment ().end ());
973  b != e; ++b)
974  {
975  o << ::std::endl << "attachment: " << *b;
976  }
977 
978  if (i.form ())
979  {
980  o << ::std::endl << "form: " << *i.form ();
981  }
982 
983  o << ::std::endl << "author: " << i.author ();
984  o << ::std::endl << "category: " << i.category ();
985  return o;
986 }
987 
988 #include <istream>
989 #include <xsd/cxx/xml/sax/std-input-source.hxx>
990 #include <xsd/cxx/tree/error-handler.hxx>
991 
992 ::std::unique_ptr< ::ECLEntry_t >
993 entry (const ::std::string& u,
994  ::xml_schema::flags f,
995  const ::xml_schema::properties& p)
996 {
997  ::xsd::cxx::xml::auto_initializer i (
998  (f & ::xml_schema::flags::dont_initialize) == 0,
999  (f & ::xml_schema::flags::keep_dom) == 0);
1000 
1001  ::xsd::cxx::tree::error_handler< char > h;
1002 
1003  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1004  ::xsd::cxx::xml::dom::parse< char > (
1005  u, h, p, f));
1006 
1007  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
1008 
1009  return ::std::unique_ptr< ::ECLEntry_t > (
1010  ::entry (
1011  std::move (d), f | ::xml_schema::flags::own_dom, p));
1012 }
1013 
1014 ::std::unique_ptr< ::ECLEntry_t >
1015 entry (const ::std::string& u,
1016  ::xml_schema::error_handler& h,
1017  ::xml_schema::flags f,
1018  const ::xml_schema::properties& p)
1019 {
1020  ::xsd::cxx::xml::auto_initializer i (
1021  (f & ::xml_schema::flags::dont_initialize) == 0,
1022  (f & ::xml_schema::flags::keep_dom) == 0);
1023 
1024  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1025  ::xsd::cxx::xml::dom::parse< char > (
1026  u, h, p, f));
1027 
1028  if (!d.get ())
1029  throw ::xsd::cxx::tree::parsing< char > ();
1030 
1031  return ::std::unique_ptr< ::ECLEntry_t > (
1032  ::entry (
1033  std::move (d), f | ::xml_schema::flags::own_dom, p));
1034 }
1035 
1036 ::std::unique_ptr< ::ECLEntry_t >
1037 entry (const ::std::string& u,
1038  ::xercesc::DOMErrorHandler& h,
1039  ::xml_schema::flags f,
1040  const ::xml_schema::properties& p)
1041 {
1042  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1043  ::xsd::cxx::xml::dom::parse< char > (
1044  u, h, p, f));
1045 
1046  if (!d.get ())
1047  throw ::xsd::cxx::tree::parsing< char > ();
1048 
1049  return ::std::unique_ptr< ::ECLEntry_t > (
1050  ::entry (
1051  std::move (d), f | ::xml_schema::flags::own_dom, p));
1052 }
1053 
1054 ::std::unique_ptr< ::ECLEntry_t >
1055 entry (::std::istream& is,
1056  ::xml_schema::flags f,
1057  const ::xml_schema::properties& p)
1058 {
1059  ::xsd::cxx::xml::auto_initializer i (
1060  (f & ::xml_schema::flags::dont_initialize) == 0,
1061  (f & ::xml_schema::flags::keep_dom) == 0);
1062 
1063  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1064  return ::entry (isrc, f, p);
1065 }
1066 
1067 ::std::unique_ptr< ::ECLEntry_t >
1068 entry (::std::istream& is,
1069  ::xml_schema::error_handler& h,
1070  ::xml_schema::flags f,
1071  const ::xml_schema::properties& p)
1072 {
1073  ::xsd::cxx::xml::auto_initializer i (
1074  (f & ::xml_schema::flags::dont_initialize) == 0,
1075  (f & ::xml_schema::flags::keep_dom) == 0);
1076 
1077  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1078  return ::entry (isrc, h, f, p);
1079 }
1080 
1081 ::std::unique_ptr< ::ECLEntry_t >
1082 entry (::std::istream& is,
1083  ::xercesc::DOMErrorHandler& h,
1084  ::xml_schema::flags f,
1085  const ::xml_schema::properties& p)
1086 {
1087  ::xsd::cxx::xml::sax::std_input_source isrc (is);
1088  return ::entry (isrc, h, f, p);
1089 }
1090 
1091 ::std::unique_ptr< ::ECLEntry_t >
1092 entry (::std::istream& is,
1093  const ::std::string& sid,
1094  ::xml_schema::flags f,
1095  const ::xml_schema::properties& p)
1096 {
1097  ::xsd::cxx::xml::auto_initializer i (
1098  (f & ::xml_schema::flags::dont_initialize) == 0,
1099  (f & ::xml_schema::flags::keep_dom) == 0);
1100 
1101  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1102  return ::entry (isrc, f, p);
1103 }
1104 
1105 ::std::unique_ptr< ::ECLEntry_t >
1106 entry (::std::istream& is,
1107  const ::std::string& sid,
1108  ::xml_schema::error_handler& h,
1109  ::xml_schema::flags f,
1110  const ::xml_schema::properties& p)
1111 {
1112  ::xsd::cxx::xml::auto_initializer i (
1113  (f & ::xml_schema::flags::dont_initialize) == 0,
1114  (f & ::xml_schema::flags::keep_dom) == 0);
1115 
1116  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1117  return ::entry (isrc, h, f, p);
1118 }
1119 
1120 ::std::unique_ptr< ::ECLEntry_t >
1121 entry (::std::istream& is,
1122  const ::std::string& sid,
1123  ::xercesc::DOMErrorHandler& h,
1124  ::xml_schema::flags f,
1125  const ::xml_schema::properties& p)
1126 {
1127  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
1128  return ::entry (isrc, h, f, p);
1129 }
1130 
1131 ::std::unique_ptr< ::ECLEntry_t >
1132 entry (::xercesc::InputSource& i,
1133  ::xml_schema::flags f,
1134  const ::xml_schema::properties& p)
1135 {
1136  ::xsd::cxx::tree::error_handler< char > h;
1137 
1138  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1139  ::xsd::cxx::xml::dom::parse< char > (
1140  i, h, p, f));
1141 
1142  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
1143 
1144  return ::std::unique_ptr< ::ECLEntry_t > (
1145  ::entry (
1146  std::move (d), f | ::xml_schema::flags::own_dom, p));
1147 }
1148 
1149 ::std::unique_ptr< ::ECLEntry_t >
1150 entry (::xercesc::InputSource& i,
1151  ::xml_schema::error_handler& h,
1152  ::xml_schema::flags f,
1153  const ::xml_schema::properties& p)
1154 {
1155  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1156  ::xsd::cxx::xml::dom::parse< char > (
1157  i, h, p, f));
1158 
1159  if (!d.get ())
1160  throw ::xsd::cxx::tree::parsing< char > ();
1161 
1162  return ::std::unique_ptr< ::ECLEntry_t > (
1163  ::entry (
1164  std::move (d), f | ::xml_schema::flags::own_dom, p));
1165 }
1166 
1167 ::std::unique_ptr< ::ECLEntry_t >
1168 entry (::xercesc::InputSource& i,
1169  ::xercesc::DOMErrorHandler& h,
1170  ::xml_schema::flags f,
1171  const ::xml_schema::properties& p)
1172 {
1173  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1174  ::xsd::cxx::xml::dom::parse< char > (
1175  i, h, p, f));
1176 
1177  if (!d.get ())
1178  throw ::xsd::cxx::tree::parsing< char > ();
1179 
1180  return ::std::unique_ptr< ::ECLEntry_t > (
1181  ::entry (
1182  std::move (d), f | ::xml_schema::flags::own_dom, p));
1183 }
1184 
1185 ::std::unique_ptr< ::ECLEntry_t >
1186 entry (const ::xercesc::DOMDocument& doc,
1187  ::xml_schema::flags f,
1188  const ::xml_schema::properties& p)
1189 {
1190  if (f & ::xml_schema::flags::keep_dom)
1191  {
1192  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1193  static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));
1194 
1195  return ::std::unique_ptr< ::ECLEntry_t > (
1196  ::entry (
1197  std::move (d), f | ::xml_schema::flags::own_dom, p));
1198  }
1199 
1200  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
1201  const ::xsd::cxx::xml::qualified_name< char > n (
1202  ::xsd::cxx::xml::dom::name< char > (e));
1203 
1204  if (n.name () == "entry" &&
1205  n.namespace_ () == "")
1206  {
1207  ::std::unique_ptr< ::ECLEntry_t > r (
1208  ::xsd::cxx::tree::traits< ::ECLEntry_t, char >::create (
1209  e, f, 0));
1210  return r;
1211  }
1212 
1213  throw ::xsd::cxx::tree::unexpected_element < char > (
1214  n.name (),
1215  n.namespace_ (),
1216  "entry",
1217  "");
1218 }
1219 
1220 ::std::unique_ptr< ::ECLEntry_t >
1221 entry (::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d,
1222  ::xml_schema::flags f,
1223  const ::xml_schema::properties&)
1224 {
1225  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > c (
1226  ((f & ::xml_schema::flags::keep_dom) &&
1227  !(f & ::xml_schema::flags::own_dom))
1228  ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
1229  : 0);
1230 
1231  ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
1232  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
1233 
1234  const ::xsd::cxx::xml::qualified_name< char > n (
1235  ::xsd::cxx::xml::dom::name< char > (e));
1236 
1237  if (f & ::xml_schema::flags::keep_dom)
1238  doc.setUserData (::xml_schema::dom::tree_node_key,
1239  (c.get () ? &c : &d),
1240  0);
1241 
1242  if (n.name () == "entry" &&
1243  n.namespace_ () == "")
1244  {
1245  ::std::unique_ptr< ::ECLEntry_t > r (
1246  ::xsd::cxx::tree::traits< ::ECLEntry_t, char >::create (
1247  e, f, 0));
1248  return r;
1249  }
1250 
1251  throw ::xsd::cxx::tree::unexpected_element < char > (
1252  n.name (),
1253  n.namespace_ (),
1254  "entry",
1255  "");
1256 }
1257 
1258 #include <ostream>
1259 #include <xsd/cxx/tree/error-handler.hxx>
1260 #include <xsd/cxx/xml/dom/serialization-source.hxx>
1261 
1262 void
1263 entry (::std::ostream& o,
1264  const ::ECLEntry_t& s,
1265  const ::xml_schema::namespace_infomap& m,
1266  const ::std::string& e,
1267  ::xml_schema::flags f)
1268 {
1269  ::xsd::cxx::xml::auto_initializer i (
1270  (f & ::xml_schema::flags::dont_initialize) == 0);
1271 
1272  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1273  ::entry (s, m, f));
1274 
1275  ::xsd::cxx::tree::error_handler< char > h;
1276 
1277  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1278  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1279  {
1280  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
1281  }
1282 }
1283 
1284 void
1285 entry (::std::ostream& o,
1286  const ::ECLEntry_t& s,
1287  ::xml_schema::error_handler& h,
1288  const ::xml_schema::namespace_infomap& m,
1289  const ::std::string& e,
1290  ::xml_schema::flags f)
1291 {
1292  ::xsd::cxx::xml::auto_initializer i (
1293  (f & ::xml_schema::flags::dont_initialize) == 0);
1294 
1295  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1296  ::entry (s, m, f));
1297  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1298  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1299  {
1300  throw ::xsd::cxx::tree::serialization< char > ();
1301  }
1302 }
1303 
1304 void
1305 entry (::std::ostream& o,
1306  const ::ECLEntry_t& s,
1307  ::xercesc::DOMErrorHandler& h,
1308  const ::xml_schema::namespace_infomap& m,
1309  const ::std::string& e,
1310  ::xml_schema::flags f)
1311 {
1312  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1313  ::entry (s, m, f));
1314  ::xsd::cxx::xml::dom::ostream_format_target t (o);
1315  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1316  {
1317  throw ::xsd::cxx::tree::serialization< char > ();
1318  }
1319 }
1320 
1321 void
1322 entry (::xercesc::XMLFormatTarget& t,
1323  const ::ECLEntry_t& s,
1324  const ::xml_schema::namespace_infomap& m,
1325  const ::std::string& e,
1326  ::xml_schema::flags f)
1327 {
1328  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1329  ::entry (s, m, f));
1330 
1331  ::xsd::cxx::tree::error_handler< char > h;
1332 
1333  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1334  {
1335  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
1336  }
1337 }
1338 
1339 void
1340 entry (::xercesc::XMLFormatTarget& t,
1341  const ::ECLEntry_t& s,
1342  ::xml_schema::error_handler& h,
1343  const ::xml_schema::namespace_infomap& m,
1344  const ::std::string& e,
1345  ::xml_schema::flags f)
1346 {
1347  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1348  ::entry (s, m, f));
1349  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1350  {
1351  throw ::xsd::cxx::tree::serialization< char > ();
1352  }
1353 }
1354 
1355 void
1356 entry (::xercesc::XMLFormatTarget& t,
1357  const ::ECLEntry_t& s,
1358  ::xercesc::DOMErrorHandler& h,
1359  const ::xml_schema::namespace_infomap& m,
1360  const ::std::string& e,
1361  ::xml_schema::flags f)
1362 {
1363  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1364  ::entry (s, m, f));
1365  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
1366  {
1367  throw ::xsd::cxx::tree::serialization< char > ();
1368  }
1369 }
1370 
1371 void
1372 entry (::xercesc::DOMDocument& d,
1373  const ::ECLEntry_t& s,
1374  ::xml_schema::flags)
1375 {
1376  ::xercesc::DOMElement& e (*d.getDocumentElement ());
1377  const ::xsd::cxx::xml::qualified_name< char > n (
1378  ::xsd::cxx::xml::dom::name< char > (e));
1379 
1380  if (n.name () == "entry" &&
1381  n.namespace_ () == "")
1382  {
1383  e << s;
1384  }
1385  else
1386  {
1387  throw ::xsd::cxx::tree::unexpected_element < char > (
1388  n.name (),
1389  n.namespace_ (),
1390  "entry",
1391  "");
1392  }
1393 }
1394 
1395 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument >
1396 entry (const ::ECLEntry_t& s,
1397  const ::xml_schema::namespace_infomap& m,
1398  ::xml_schema::flags f)
1399 {
1400  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
1401  ::xsd::cxx::xml::dom::serialize< char > (
1402  "entry",
1403  "",
1404  m, f));
1405 
1406  ::entry (*d, s, f);
1407  return d;
1408 }
1409 
1410 void
1411 operator<< (::xercesc::DOMElement& e, const Tag_t& i)
1412 {
1413  e << static_cast< const ::xml_schema::type& > (i);
1414 
1415  // name
1416  //
1417  {
1418  ::xercesc::DOMAttr& a (
1419  ::xsd::cxx::xml::dom::create_attribute (
1420  "name",
1421  e));
1422 
1423  a << i.name ();
1424  }
1425 }
1426 
1427 void
1428 operator<< (::xercesc::DOMElement& e, const Attachment_t& i)
1429 {
1430  e << static_cast< const ::xml_schema::base64_binary& > (i);
1431 
1432  // type
1433  //
1434  {
1435  ::xercesc::DOMAttr& a (
1436  ::xsd::cxx::xml::dom::create_attribute (
1437  "type",
1438  e));
1439 
1440  a << i.type ();
1441  }
1442 
1443  // filename
1444  //
1445  {
1446  ::xercesc::DOMAttr& a (
1447  ::xsd::cxx::xml::dom::create_attribute (
1448  "filename",
1449  e));
1450 
1451  a << i.filename ();
1452  }
1453 }
1454 
1455 void
1456 operator<< (::xercesc::DOMElement& e, const Field_t& i)
1457 {
1458  e << static_cast< const ::xml_schema::string& > (i);
1459 
1460  // name
1461  //
1462  {
1463  ::xercesc::DOMAttr& a (
1464  ::xsd::cxx::xml::dom::create_attribute (
1465  "name",
1466  e));
1467 
1468  a << i.name ();
1469  }
1470 }
1471 
1472 void
1473 operator<< (::xercesc::DOMElement& e, const Form_t& i)
1474 {
1475  e << static_cast< const ::xml_schema::type& > (i);
1476 
1477  // field
1478  //
1479  for (Form_t::field_const_iterator
1480  b (i.field ().begin ()), n (i.field ().end ());
1481  b != n; ++b)
1482  {
1483  ::xercesc::DOMElement& s (
1484  ::xsd::cxx::xml::dom::create_element (
1485  "field",
1486  e));
1487 
1488  s << *b;
1489  }
1490 
1491  // name
1492  //
1493  {
1494  ::xercesc::DOMAttr& a (
1495  ::xsd::cxx::xml::dom::create_attribute (
1496  "name",
1497  e));
1498 
1499  a << i.name ();
1500  }
1501 }
1502 
1503 void
1504 operator<< (::xercesc::DOMElement& e, const ECLEntry_t& i)
1505 {
1506  e << static_cast< const ::xml_schema::type& > (i);
1507 
1508  // tag
1509  //
1510  for (ECLEntry_t::tag_const_iterator
1511  b (i.tag ().begin ()), n (i.tag ().end ());
1512  b != n; ++b)
1513  {
1514  ::xercesc::DOMElement& s (
1515  ::xsd::cxx::xml::dom::create_element (
1516  "tag",
1517  e));
1518 
1519  s << *b;
1520  }
1521 
1522  // attachment
1523  //
1524  for (ECLEntry_t::attachment_const_iterator
1525  b (i.attachment ().begin ()), n (i.attachment ().end ());
1526  b != n; ++b)
1527  {
1528  ::xercesc::DOMElement& s (
1529  ::xsd::cxx::xml::dom::create_element (
1530  "attachment",
1531  e));
1532 
1533  s << *b;
1534  }
1535 
1536  // form
1537  //
1538  if (i.form ())
1539  {
1540  ::xercesc::DOMElement& s (
1541  ::xsd::cxx::xml::dom::create_element (
1542  "form",
1543  e));
1544 
1545  s << *i.form ();
1546  }
1547 
1548  // author
1549  //
1550  {
1551  ::xercesc::DOMAttr& a (
1552  ::xsd::cxx::xml::dom::create_attribute (
1553  "author",
1554  e));
1555 
1556  a << i.author ();
1557  }
1558 
1559  // category
1560  //
1561  {
1562  ::xercesc::DOMAttr& a (
1563  ::xsd::cxx::xml::dom::create_attribute (
1564  "category",
1565  e));
1566 
1567  a << i.category ();
1568  }
1569 }
1570 
1571 #include <xsd/cxx/post.hxx>
1572 
1573 // Begin epilogue.
1574 //
1575 //
1576 // End epilogue.
1577 
Definition: ECL.hxx:277
Definition: ECL.hxx:547
Definition: ECL.hxx:410
Definition: ECL.hxx:474