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