tdaq-develop-2025-02-12
ECL.cxx
1 // Copyright (c) 2005-2017 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::name() const { return this->name_.get(); }
47 
48 Tag_t::name_type& Tag_t::name() { return this->name_.get(); }
49 
50 void Tag_t::name(const name_type& x) { this->name_.set(x); }
51 
52 void Tag_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
53 
54 // Attachment_t
55 //
56 
57 const Attachment_t::type_type& Attachment_t::type() const { return this->type_.get(); }
58 
59 Attachment_t::type_type& Attachment_t::type() { return this->type_.get(); }
60 
61 void Attachment_t::type(const type_type& x) { this->type_.set(x); }
62 
63 void Attachment_t::type(::std::unique_ptr<type_type> x) { this->type_.set(std::move(x)); }
64 
65 const Attachment_t::filename_type& Attachment_t::filename() const
66 {
67  return this->filename_.get();
68 }
69 
70 Attachment_t::filename_type& Attachment_t::filename() { return this->filename_.get(); }
71 
72 void Attachment_t::filename(const filename_type& x) { this->filename_.set(x); }
73 
74 void Attachment_t::filename(::std::unique_ptr<filename_type> x)
75 {
76  this->filename_.set(std::move(x));
77 }
78 
79 // Field_t
80 //
81 
82 const Field_t::name_type& Field_t::name() const { return this->name_.get(); }
83 
84 Field_t::name_type& Field_t::name() { return this->name_.get(); }
85 
86 void Field_t::name(const name_type& x) { this->name_.set(x); }
87 
88 void Field_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
89 
90 // Form_t
91 //
92 
93 const Form_t::field_sequence& Form_t::field() const { return this->field_; }
94 
95 Form_t::field_sequence& Form_t::field() { return this->field_; }
96 
97 void Form_t::field(const field_sequence& s) { this->field_ = s; }
98 
99 const Form_t::name_type& Form_t::name() const { return this->name_.get(); }
100 
101 Form_t::name_type& Form_t::name() { return this->name_.get(); }
102 
103 void Form_t::name(const name_type& x) { this->name_.set(x); }
104 
105 void Form_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
106 
107 // ECLEntry_t
108 //
109 
110 const ECLEntry_t::tag_sequence& ECLEntry_t::tag() const { return this->tag_; }
111 
112 ECLEntry_t::tag_sequence& ECLEntry_t::tag() { return this->tag_; }
113 
114 void ECLEntry_t::tag(const tag_sequence& s) { this->tag_ = s; }
115 
116 const ECLEntry_t::attachment_sequence& ECLEntry_t::attachment() const
117 {
118  return this->attachment_;
119 }
120 
121 ECLEntry_t::attachment_sequence& ECLEntry_t::attachment() { return this->attachment_; }
122 
123 void ECLEntry_t::attachment(const attachment_sequence& s) { this->attachment_ = s; }
124 
125 const ECLEntry_t::form_optional& ECLEntry_t::form() const { return this->form_; }
126 
127 ECLEntry_t::form_optional& ECLEntry_t::form() { return this->form_; }
128 
129 void ECLEntry_t::form(const form_type& x) { this->form_.set(x); }
130 
131 void ECLEntry_t::form(const form_optional& x) { this->form_ = x; }
132 
133 void ECLEntry_t::form(::std::unique_ptr<form_type> x) { this->form_.set(std::move(x)); }
134 
135 const ECLEntry_t::author_type& ECLEntry_t::author() const { return this->author_.get(); }
136 
137 ECLEntry_t::author_type& ECLEntry_t::author() { return this->author_.get(); }
138 
139 void ECLEntry_t::author(const author_type& x) { this->author_.set(x); }
140 
141 void ECLEntry_t::author(::std::unique_ptr<author_type> x)
142 {
143  this->author_.set(std::move(x));
144 }
145 
146 const ECLEntry_t::category_type& ECLEntry_t::category() const
147 {
148  return this->category_.get();
149 }
150 
151 ECLEntry_t::category_type& ECLEntry_t::category() { return this->category_.get(); }
152 
153 void ECLEntry_t::category(const category_type& x) { this->category_.set(x); }
154 
155 void ECLEntry_t::category(::std::unique_ptr<category_type> x)
156 {
157  this->category_.set(std::move(x));
158 }
159 
160 const ECLEntry_t::subject_optional& ECLEntry_t::subject() const { return this->subject_; }
161 
162 ECLEntry_t::subject_optional& ECLEntry_t::subject() { return this->subject_; }
163 
164 void ECLEntry_t::subject(const subject_type& x) { this->subject_.set(x); }
165 
166 void ECLEntry_t::subject(const subject_optional& x) { this->subject_ = x; }
167 
168 void ECLEntry_t::subject(::std::unique_ptr<subject_type> x)
169 {
170  this->subject_.set(std::move(x));
171 }
172 
173 #include <xsd/cxx/xml/dom/parsing-source.hxx>
174 
175 // Tag_t
176 //
177 
178 Tag_t::Tag_t() : ::xml_schema::type(), name_(this) {}
179 
180 Tag_t::Tag_t(const name_type& name) : ::xml_schema::type(), name_(name, this) {}
181 
182 Tag_t::Tag_t(const Tag_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
183  : ::xml_schema::type(x, f, c), name_(x.name_, f, this)
184 {
185 }
186 
187 Tag_t::Tag_t(const ::xercesc::DOMElement& e,
188  ::xml_schema::flags f,
189  ::xml_schema::container* c)
190  : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), name_(this)
191 {
192  if((f & ::xml_schema::flags::base) == 0)
193  {
194  ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true);
195  this->parse(p, f);
196  }
197 }
198 
199 void Tag_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
200 {
201  while(p.more_attributes())
202  {
203  const ::xercesc::DOMAttr& i(p.next_attribute());
204  const ::xsd::cxx::xml::qualified_name<char> n(
205  ::xsd::cxx::xml::dom::name<char>(i));
206 
207  if(n.name() == "name" && n.namespace_().empty())
208  {
209  this->name_.set(name_traits::create(i, f, this));
210  continue;
211  }
212  }
213 
214  if(!name_.present())
215  {
216  throw ::xsd::cxx::tree::expected_attribute<char>("name", "");
217  }
218 }
219 
220 Tag_t* Tag_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const
221 {
222  return new class Tag_t(*this, f, c);
223 }
224 
225 Tag_t& Tag_t::operator=(const Tag_t& x)
226 {
227  if(this != &x)
228  {
229  static_cast< ::xml_schema::type&>(*this) = x;
230  this->name_ = x.name_;
231  }
232 
233  return *this;
234 }
235 
236 Tag_t::~Tag_t() {}
237 
238 // Attachment_t
239 //
240 
241 Attachment_t::Attachment_t() : ::xml_schema::base64_binary(), type_(this), filename_(this)
242 {
243 }
244 
245 Attachment_t::Attachment_t(const type_type& type, const filename_type& filename)
246  : ::xml_schema::base64_binary(), type_(type, this), filename_(filename, this)
247 {
248 }
249 
250 Attachment_t::Attachment_t(const ::xml_schema::base64_binary& _xsd_base64_binary_base,
251  const type_type& type,
252  const filename_type& filename)
253  : ::xml_schema::base64_binary(_xsd_base64_binary_base)
254  , type_(type, this)
255  , filename_(filename, this)
256 {
257 }
258 
259 Attachment_t::Attachment_t(const Attachment_t& x,
260  ::xml_schema::flags f,
261  ::xml_schema::container* c)
262  : ::xml_schema::base64_binary(x, f, c)
263  , type_(x.type_, f, this)
264  , filename_(x.filename_, f, this)
265 {
266 }
267 
268 Attachment_t::Attachment_t(const ::xercesc::DOMElement& e,
269  ::xml_schema::flags f,
270  ::xml_schema::container* c)
271  : ::xml_schema::base64_binary(e, f | ::xml_schema::flags::base, c)
272  , type_(this)
273  , filename_(this)
274 {
275  if((f & ::xml_schema::flags::base) == 0)
276  {
277  ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true);
278  this->parse(p, f);
279  }
280 }
281 
282 void Attachment_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
283 {
284  while(p.more_attributes())
285  {
286  const ::xercesc::DOMAttr& i(p.next_attribute());
287  const ::xsd::cxx::xml::qualified_name<char> n(
288  ::xsd::cxx::xml::dom::name<char>(i));
289 
290  if(n.name() == "type" && n.namespace_().empty())
291  {
292  this->type_.set(type_traits::create(i, f, this));
293  continue;
294  }
295 
296  if(n.name() == "filename" && n.namespace_().empty())
297  {
298  this->filename_.set(filename_traits::create(i, f, this));
299  continue;
300  }
301  }
302 
303  if(!type_.present())
304  {
305  throw ::xsd::cxx::tree::expected_attribute<char>("type", "");
306  }
307 
308  if(!filename_.present())
309  {
310  throw ::xsd::cxx::tree::expected_attribute<char>("filename", "");
311  }
312 }
313 
314 Attachment_t* Attachment_t::_clone(::xml_schema::flags f,
315  ::xml_schema::container* c) const
316 {
317  return new class Attachment_t(*this, f, c);
318 }
319 
320 Attachment_t& Attachment_t::operator=(const Attachment_t& x)
321 {
322  if(this != &x)
323  {
324  static_cast< ::xml_schema::base64_binary&>(*this) = x;
325  this->type_ = x.type_;
326  this->filename_ = x.filename_;
327  }
328 
329  return *this;
330 }
331 
332 Attachment_t::~Attachment_t() {}
333 
334 // Field_t
335 //
336 
337 Field_t::Field_t() : ::xml_schema::string(), name_(this) {}
338 
339 Field_t::Field_t(const name_type& name) : ::xml_schema::string(), name_(name, this) {}
340 
341 Field_t::Field_t(const char* _xsd_string_base, const name_type& name)
342  : ::xml_schema::string(_xsd_string_base), name_(name, this)
343 {
344 }
345 
346 Field_t::Field_t(const ::std::string& _xsd_string_base, const name_type& name)
347  : ::xml_schema::string(_xsd_string_base), name_(name, this)
348 {
349 }
350 
351 Field_t::Field_t(const ::xml_schema::string& _xsd_string_base, const name_type& name)
352  : ::xml_schema::string(_xsd_string_base), name_(name, this)
353 {
354 }
355 
356 Field_t::Field_t(const Field_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
357  : ::xml_schema::string(x, f, c), name_(x.name_, f, this)
358 {
359 }
360 
361 Field_t::Field_t(const ::xercesc::DOMElement& e,
362  ::xml_schema::flags f,
363  ::xml_schema::container* c)
364  : ::xml_schema::string(e, f | ::xml_schema::flags::base, c), name_(this)
365 {
366  if((f & ::xml_schema::flags::base) == 0)
367  {
368  ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true);
369  this->parse(p, f);
370  }
371 }
372 
373 void Field_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
374 {
375  while(p.more_attributes())
376  {
377  const ::xercesc::DOMAttr& i(p.next_attribute());
378  const ::xsd::cxx::xml::qualified_name<char> n(
379  ::xsd::cxx::xml::dom::name<char>(i));
380 
381  if(n.name() == "name" && n.namespace_().empty())
382  {
383  this->name_.set(name_traits::create(i, f, this));
384  continue;
385  }
386  }
387 
388  if(!name_.present())
389  {
390  throw ::xsd::cxx::tree::expected_attribute<char>("name", "");
391  }
392 }
393 
394 Field_t* Field_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const
395 {
396  return new class Field_t(*this, f, c);
397 }
398 
399 Field_t& Field_t::operator=(const Field_t& x)
400 {
401  if(this != &x)
402  {
403  static_cast< ::xml_schema::string&>(*this) = x;
404  this->name_ = x.name_;
405  }
406 
407  return *this;
408 }
409 
410 Field_t::~Field_t() {}
411 
412 // Form_t
413 //
414 
415 Form_t::Form_t() : ::xml_schema::type(), field_(this), name_(this) {}
416 
417 Form_t::Form_t(const name_type& name)
418  : ::xml_schema::type(), field_(this), name_(name, this)
419 {
420 }
421 
422 Form_t::Form_t(const Form_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
423  : ::xml_schema::type(x, f, c), field_(x.field_, f, this), name_(x.name_, f, this)
424 {
425 }
426 
427 Form_t::Form_t(const ::xercesc::DOMElement& e,
428  ::xml_schema::flags f,
429  ::xml_schema::container* c)
430  : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), field_(this), name_(this)
431 {
432  if((f & ::xml_schema::flags::base) == 0)
433  {
434  ::xsd::cxx::xml::dom::parser<char> p(e, true, false, true);
435  this->parse(p, f);
436  }
437 }
438 
439 void Form_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
440 {
441  for(; p.more_content(); p.next_content(false))
442  {
443  const ::xercesc::DOMElement& i(p.cur_element());
444  const ::xsd::cxx::xml::qualified_name<char> n(
445  ::xsd::cxx::xml::dom::name<char>(i));
446 
447  // field
448  //
449  if(n.name() == "field" && n.namespace_().empty())
450  {
451  ::std::unique_ptr<field_type> r(field_traits::create(i, f, this));
452 
453  this->field_.push_back(::std::move(r));
454  continue;
455  }
456 
457  break;
458  }
459 
460  while(p.more_attributes())
461  {
462  const ::xercesc::DOMAttr& i(p.next_attribute());
463  const ::xsd::cxx::xml::qualified_name<char> n(
464  ::xsd::cxx::xml::dom::name<char>(i));
465 
466  if(n.name() == "name" && n.namespace_().empty())
467  {
468  this->name_.set(name_traits::create(i, f, this));
469  continue;
470  }
471  }
472 
473  if(!name_.present())
474  {
475  throw ::xsd::cxx::tree::expected_attribute<char>("name", "");
476  }
477 }
478 
479 Form_t* Form_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const
480 {
481  return new class Form_t(*this, f, c);
482 }
483 
484 Form_t& Form_t::operator=(const Form_t& x)
485 {
486  if(this != &x)
487  {
488  static_cast< ::xml_schema::type&>(*this) = x;
489  this->field_ = x.field_;
490  this->name_ = x.name_;
491  }
492 
493  return *this;
494 }
495 
496 Form_t::~Form_t() {}
497 
498 // ECLEntry_t
499 //
500 
501 ECLEntry_t::ECLEntry_t()
502  : ::xml_schema::type()
503  , tag_(this)
504  , attachment_(this)
505  , form_(this)
506  , author_(this)
507  , category_(this)
508  , subject_(this)
509 {
510 }
511 
512 ECLEntry_t::ECLEntry_t(const author_type& author, const category_type& category)
513  : ::xml_schema::type()
514  , tag_(this)
515  , attachment_(this)
516  , form_(this)
517  , author_(author, this)
518  , category_(category, this)
519  , subject_(this)
520 {
521 }
522 
523 ECLEntry_t::ECLEntry_t(const ECLEntry_t& x,
524  ::xml_schema::flags f,
525  ::xml_schema::container* c)
526  : ::xml_schema::type(x, f, c)
527  , tag_(x.tag_, f, this)
528  , attachment_(x.attachment_, f, this)
529  , form_(x.form_, f, this)
530  , author_(x.author_, f, this)
531  , category_(x.category_, f, this)
532  , subject_(x.subject_, f, this)
533 {
534 }
535 
536 ECLEntry_t::ECLEntry_t(const ::xercesc::DOMElement& e,
537  ::xml_schema::flags f,
538  ::xml_schema::container* c)
539  : ::xml_schema::type(e, f | ::xml_schema::flags::base, c)
540  , tag_(this)
541  , attachment_(this)
542  , form_(this)
543  , author_(this)
544  , category_(this)
545  , subject_(this)
546 {
547  if((f & ::xml_schema::flags::base) == 0)
548  {
549  ::xsd::cxx::xml::dom::parser<char> p(e, true, false, true);
550  this->parse(p, f);
551  }
552 }
553 
554 void ECLEntry_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
555 {
556  for(; p.more_content(); p.next_content(false))
557  {
558  const ::xercesc::DOMElement& i(p.cur_element());
559  const ::xsd::cxx::xml::qualified_name<char> n(
560  ::xsd::cxx::xml::dom::name<char>(i));
561 
562  // tag
563  //
564  if(n.name() == "tag" && n.namespace_().empty())
565  {
566  ::std::unique_ptr<tag_type> r(tag_traits::create(i, f, this));
567 
568  this->tag_.push_back(::std::move(r));
569  continue;
570  }
571 
572  // attachment
573  //
574  if(n.name() == "attachment" && n.namespace_().empty())
575  {
576  ::std::unique_ptr<attachment_type> r(attachment_traits::create(i, f, this));
577 
578  this->attachment_.push_back(::std::move(r));
579  continue;
580  }
581 
582  // form
583  //
584  if(n.name() == "form" && n.namespace_().empty())
585  {
586  ::std::unique_ptr<form_type> r(form_traits::create(i, f, this));
587 
588  if(!this->form_)
589  {
590  this->form_.set(::std::move(r));
591  continue;
592  }
593  }
594 
595  break;
596  }
597 
598  while(p.more_attributes())
599  {
600  const ::xercesc::DOMAttr& i(p.next_attribute());
601  const ::xsd::cxx::xml::qualified_name<char> n(
602  ::xsd::cxx::xml::dom::name<char>(i));
603 
604  if(n.name() == "author" && n.namespace_().empty())
605  {
606  this->author_.set(author_traits::create(i, f, this));
607  continue;
608  }
609 
610  if(n.name() == "category" && n.namespace_().empty())
611  {
612  this->category_.set(category_traits::create(i, f, this));
613  continue;
614  }
615 
616  if(n.name() == "subject" && n.namespace_().empty())
617  {
618  this->subject_.set(subject_traits::create(i, f, this));
619  continue;
620  }
621  }
622 
623  if(!author_.present())
624  {
625  throw ::xsd::cxx::tree::expected_attribute<char>("author", "");
626  }
627 
628  if(!category_.present())
629  {
630  throw ::xsd::cxx::tree::expected_attribute<char>("category", "");
631  }
632 }
633 
634 ECLEntry_t* ECLEntry_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const
635 {
636  return new class ECLEntry_t(*this, f, c);
637 }
638 
639 ECLEntry_t& ECLEntry_t::operator=(const ECLEntry_t& x)
640 {
641  if(this != &x)
642  {
643  static_cast< ::xml_schema::type&>(*this) = x;
644  this->tag_ = x.tag_;
645  this->attachment_ = x.attachment_;
646  this->form_ = x.form_;
647  this->author_ = x.author_;
648  this->category_ = x.category_;
649  this->subject_ = x.subject_;
650  }
651 
652  return *this;
653 }
654 
655 ECLEntry_t::~ECLEntry_t() {}
656 
657 #include <ostream>
658 
659 ::std::ostream& operator<<(::std::ostream& o, const Tag_t& i)
660 {
661  o << ::std::endl << "name: " << i.name();
662  return o;
663 }
664 
665 ::std::ostream& operator<<(::std::ostream& o, const Attachment_t& i)
666 {
667  o << static_cast<const ::xml_schema::base64_binary&>(i);
668 
669  o << ::std::endl << "type: " << i.type();
670  o << ::std::endl << "filename: " << i.filename();
671  return o;
672 }
673 
674 ::std::ostream& operator<<(::std::ostream& o, const Field_t& i)
675 {
676  o << static_cast<const ::xml_schema::string&>(i);
677 
678  o << ::std::endl << "name: " << i.name();
679  return o;
680 }
681 
682 ::std::ostream& operator<<(::std::ostream& o, const Form_t& i)
683 {
684  for(Form_t::field_const_iterator b(i.field().begin()), e(i.field().end()); b != e;
685  ++b)
686  {
687  o << ::std::endl << "field: " << *b;
688  }
689 
690  o << ::std::endl << "name: " << i.name();
691  return o;
692 }
693 
694 ::std::ostream& operator<<(::std::ostream& o, const ECLEntry_t& i)
695 {
696  for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), e(i.tag().end()); b != e; ++b)
697  {
698  o << ::std::endl << "tag: " << *b;
699  }
700 
701  for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()),
702  e(i.attachment().end());
703  b != e;
704  ++b)
705  {
706  o << ::std::endl << "attachment: " << *b;
707  }
708 
709  if(i.form())
710  {
711  o << ::std::endl << "form: " << *i.form();
712  }
713 
714  o << ::std::endl << "author: " << i.author();
715  o << ::std::endl << "category: " << i.category();
716  if(i.subject())
717  {
718  o << ::std::endl << "subject: " << *i.subject();
719  }
720 
721  return o;
722 }
723 
724 #include <istream>
725 #include <xsd/cxx/tree/error-handler.hxx>
726 #include <xsd/cxx/xml/sax/std-input-source.hxx>
727 
728 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
729  ::xml_schema::flags f,
730  const ::xml_schema::properties& p)
731 {
732  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
733  (f & ::xml_schema::flags::keep_dom) == 0);
734 
735  ::xsd::cxx::tree::error_handler<char> h;
736 
737  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
738  ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
739 
740  h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >();
741 
742  return ::std::unique_ptr< ::ECLEntry_t>(
743  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
744 }
745 
746 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
747  ::xml_schema::error_handler& h,
748  ::xml_schema::flags f,
749  const ::xml_schema::properties& p)
750 {
751  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
752  (f & ::xml_schema::flags::keep_dom) == 0);
753 
754  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
755  ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
756 
757  if(!d.get())
758  throw ::xsd::cxx::tree::parsing<char>();
759 
760  return ::std::unique_ptr< ::ECLEntry_t>(
761  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
762 }
763 
764 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
765  ::xercesc::DOMErrorHandler& h,
766  ::xml_schema::flags f,
767  const ::xml_schema::properties& p)
768 {
769  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
770  ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
771 
772  if(!d.get())
773  throw ::xsd::cxx::tree::parsing<char>();
774 
775  return ::std::unique_ptr< ::ECLEntry_t>(
776  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
777 }
778 
779 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
780  ::xml_schema::flags f,
781  const ::xml_schema::properties& p)
782 {
783  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
784  (f & ::xml_schema::flags::keep_dom) == 0);
785 
786  ::xsd::cxx::xml::sax::std_input_source isrc(is);
787  return ::entry(isrc, f, p);
788 }
789 
790 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
791  ::xml_schema::error_handler& h,
792  ::xml_schema::flags f,
793  const ::xml_schema::properties& p)
794 {
795  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
796  (f & ::xml_schema::flags::keep_dom) == 0);
797 
798  ::xsd::cxx::xml::sax::std_input_source isrc(is);
799  return ::entry(isrc, h, f, p);
800 }
801 
802 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
803  ::xercesc::DOMErrorHandler& h,
804  ::xml_schema::flags f,
805  const ::xml_schema::properties& p)
806 {
807  ::xsd::cxx::xml::sax::std_input_source isrc(is);
808  return ::entry(isrc, h, f, p);
809 }
810 
811 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
812  const ::std::string& sid,
813  ::xml_schema::flags f,
814  const ::xml_schema::properties& p)
815 {
816  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
817  (f & ::xml_schema::flags::keep_dom) == 0);
818 
819  ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
820  return ::entry(isrc, f, p);
821 }
822 
823 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
824  const ::std::string& sid,
825  ::xml_schema::error_handler& h,
826  ::xml_schema::flags f,
827  const ::xml_schema::properties& p)
828 {
829  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
830  (f & ::xml_schema::flags::keep_dom) == 0);
831 
832  ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
833  return ::entry(isrc, h, f, p);
834 }
835 
836 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
837  const ::std::string& sid,
838  ::xercesc::DOMErrorHandler& h,
839  ::xml_schema::flags f,
840  const ::xml_schema::properties& p)
841 {
842  ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
843  return ::entry(isrc, h, f, p);
844 }
845 
846 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
847  ::xml_schema::flags f,
848  const ::xml_schema::properties& p)
849 {
850  ::xsd::cxx::tree::error_handler<char> h;
851 
852  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
853  ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
854 
855  h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >();
856 
857  return ::std::unique_ptr< ::ECLEntry_t>(
858  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
859 }
860 
861 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
862  ::xml_schema::error_handler& h,
863  ::xml_schema::flags f,
864  const ::xml_schema::properties& p)
865 {
866  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
867  ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
868 
869  if(!d.get())
870  throw ::xsd::cxx::tree::parsing<char>();
871 
872  return ::std::unique_ptr< ::ECLEntry_t>(
873  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
874 }
875 
876 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
877  ::xercesc::DOMErrorHandler& h,
878  ::xml_schema::flags f,
879  const ::xml_schema::properties& p)
880 {
881  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
882  ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
883 
884  if(!d.get())
885  throw ::xsd::cxx::tree::parsing<char>();
886 
887  return ::std::unique_ptr< ::ECLEntry_t>(
888  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
889 }
890 
891 ::std::unique_ptr< ::ECLEntry_t> entry(const ::xercesc::DOMDocument& doc,
892  ::xml_schema::flags f,
893  const ::xml_schema::properties& p)
894 {
895  if(f & ::xml_schema::flags::keep_dom)
896  {
897  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
898  static_cast< ::xercesc::DOMDocument*>(doc.cloneNode(true)));
899 
900  return ::std::unique_ptr< ::ECLEntry_t>(
901  ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
902  }
903 
904  const ::xercesc::DOMElement& e(*doc.getDocumentElement());
905  const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
906 
907  if(n.name() == "entry" && n.namespace_() == "")
908  {
909  ::std::unique_ptr< ::ECLEntry_t> r(
910  ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0));
911  return r;
912  }
913 
914  throw ::xsd::cxx::tree::unexpected_element<char>(
915  n.name(), n.namespace_(), "entry", "");
916 }
917 
918 ::std::unique_ptr< ::ECLEntry_t> entry(
919  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d,
920  ::xml_schema::flags f,
921  const ::xml_schema::properties&)
922 {
923  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> c(
924  ((f & ::xml_schema::flags::keep_dom) && !(f & ::xml_schema::flags::own_dom))
925  ? static_cast< ::xercesc::DOMDocument*>(d->cloneNode(true))
926  : 0);
927 
928  ::xercesc::DOMDocument& doc(c.get() ? *c : *d);
929  const ::xercesc::DOMElement& e(*doc.getDocumentElement());
930 
931  const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
932 
933  if(f & ::xml_schema::flags::keep_dom)
934  doc.setUserData(::xml_schema::dom::tree_node_key, (c.get() ? &c : &d), 0);
935 
936  if(n.name() == "entry" && n.namespace_() == "")
937  {
938  ::std::unique_ptr< ::ECLEntry_t> r(
939  ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0));
940  return r;
941  }
942 
943  throw ::xsd::cxx::tree::unexpected_element<char>(
944  n.name(), n.namespace_(), "entry", "");
945 }
946 
947 #include <ostream>
948 #include <xsd/cxx/tree/error-handler.hxx>
949 #include <xsd/cxx/xml/dom/serialization-source.hxx>
950 
951 void entry(::std::ostream& o,
952  const ::ECLEntry_t& s,
953  const ::xml_schema::namespace_infomap& m,
954  const ::std::string& e,
955  ::xml_schema::flags f)
956 {
957  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0);
958 
959  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
960 
961  ::xsd::cxx::tree::error_handler<char> h;
962 
963  ::xsd::cxx::xml::dom::ostream_format_target t(o);
964  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
965  {
966  h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >();
967  }
968 }
969 
970 void entry(::std::ostream& o,
971  const ::ECLEntry_t& s,
972  ::xml_schema::error_handler& h,
973  const ::xml_schema::namespace_infomap& m,
974  const ::std::string& e,
975  ::xml_schema::flags f)
976 {
977  ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0);
978 
979  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
980  ::xsd::cxx::xml::dom::ostream_format_target t(o);
981  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
982  {
983  throw ::xsd::cxx::tree::serialization<char>();
984  }
985 }
986 
987 void entry(::std::ostream& o,
988  const ::ECLEntry_t& s,
989  ::xercesc::DOMErrorHandler& h,
990  const ::xml_schema::namespace_infomap& m,
991  const ::std::string& e,
992  ::xml_schema::flags f)
993 {
994  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
995  ::xsd::cxx::xml::dom::ostream_format_target t(o);
996  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
997  {
998  throw ::xsd::cxx::tree::serialization<char>();
999  }
1000 }
1001 
1002 void entry(::xercesc::XMLFormatTarget& t,
1003  const ::ECLEntry_t& s,
1004  const ::xml_schema::namespace_infomap& m,
1005  const ::std::string& e,
1006  ::xml_schema::flags f)
1007 {
1008  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
1009 
1010  ::xsd::cxx::tree::error_handler<char> h;
1011 
1012  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
1013  {
1014  h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >();
1015  }
1016 }
1017 
1018 void entry(::xercesc::XMLFormatTarget& t,
1019  const ::ECLEntry_t& s,
1020  ::xml_schema::error_handler& h,
1021  const ::xml_schema::namespace_infomap& m,
1022  const ::std::string& e,
1023  ::xml_schema::flags f)
1024 {
1025  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
1026  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
1027  {
1028  throw ::xsd::cxx::tree::serialization<char>();
1029  }
1030 }
1031 
1032 void entry(::xercesc::XMLFormatTarget& t,
1033  const ::ECLEntry_t& s,
1034  ::xercesc::DOMErrorHandler& h,
1035  const ::xml_schema::namespace_infomap& m,
1036  const ::std::string& e,
1037  ::xml_schema::flags f)
1038 {
1039  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
1040  if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
1041  {
1042  throw ::xsd::cxx::tree::serialization<char>();
1043  }
1044 }
1045 
1046 void entry(::xercesc::DOMDocument& d, const ::ECLEntry_t& s, ::xml_schema::flags)
1047 {
1048  ::xercesc::DOMElement& e(*d.getDocumentElement());
1049  const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
1050 
1051  if(n.name() == "entry" && n.namespace_() == "")
1052  {
1053  e << s;
1054  }
1055  else
1056  {
1057  throw ::xsd::cxx::tree::unexpected_element<char>(
1058  n.name(), n.namespace_(), "entry", "");
1059  }
1060 }
1061 
1062 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> entry(
1063  const ::ECLEntry_t& s,
1064  const ::xml_schema::namespace_infomap& m,
1065  ::xml_schema::flags f)
1066 {
1067  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
1068  ::xsd::cxx::xml::dom::serialize<char>("entry", "", m, f));
1069 
1070  ::entry(*d, s, f);
1071  return d;
1072 }
1073 
1074 void operator<<(::xercesc::DOMElement& e, const Tag_t& i)
1075 {
1076  e << static_cast<const ::xml_schema::type&>(i);
1077 
1078  // name
1079  //
1080  {
1081  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e));
1082 
1083  a << i.name();
1084  }
1085 }
1086 
1087 void operator<<(::xercesc::DOMElement& e, const Attachment_t& i)
1088 {
1089  e << static_cast<const ::xml_schema::base64_binary&>(i);
1090 
1091  // type
1092  //
1093  {
1094  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("type", e));
1095 
1096  a << i.type();
1097  }
1098 
1099  // filename
1100  //
1101  {
1102  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("filename", e));
1103 
1104  a << i.filename();
1105  }
1106 }
1107 
1108 void operator<<(::xercesc::DOMElement& e, const Field_t& i)
1109 {
1110  e << static_cast<const ::xml_schema::string&>(i);
1111 
1112  // name
1113  //
1114  {
1115  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e));
1116 
1117  a << i.name();
1118  }
1119 }
1120 
1121 void operator<<(::xercesc::DOMElement& e, const Form_t& i)
1122 {
1123  e << static_cast<const ::xml_schema::type&>(i);
1124 
1125  // field
1126  //
1127  for(Form_t::field_const_iterator b(i.field().begin()), n(i.field().end()); b != n;
1128  ++b)
1129  {
1130  ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("field", e));
1131 
1132  s << *b;
1133  }
1134 
1135  // name
1136  //
1137  {
1138  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e));
1139 
1140  a << i.name();
1141  }
1142 }
1143 
1144 void operator<<(::xercesc::DOMElement& e, const ECLEntry_t& i)
1145 {
1146  e << static_cast<const ::xml_schema::type&>(i);
1147 
1148  // tag
1149  //
1150  for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), n(i.tag().end()); b != n; ++b)
1151  {
1152  ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("tag", e));
1153 
1154  s << *b;
1155  }
1156 
1157  // attachment
1158  //
1159  for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()),
1160  n(i.attachment().end());
1161  b != n;
1162  ++b)
1163  {
1164  ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("attachment", e));
1165 
1166  s << *b;
1167  }
1168 
1169  // form
1170  //
1171  if(i.form())
1172  {
1173  ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("form", e));
1174 
1175  s << *i.form();
1176  }
1177 
1178  // author
1179  //
1180  {
1181  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("author", e));
1182 
1183  a << i.author();
1184  }
1185 
1186  // category
1187  //
1188  {
1189  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("category", e));
1190 
1191  a << i.category();
1192  }
1193 
1194  // subject
1195  //
1196  if(i.subject())
1197  {
1198  ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("subject", e));
1199 
1200  a << *i.subject();
1201  }
1202 }
1203 
1204 #include <xsd/cxx/post.hxx>
1205 
1206 // Begin epilogue.
1207 //
1208 //
1209 // End epilogue.
Definition: ECL.hxx:495
Definition: ECL.hxx:386
Definition: ECL.hxx:436
Definition: ECL.hxx:278