$treeview $search $mathjax $extrastylesheet
otsdaq_utilities
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 // Copyright (c) 2005-2014 Code Synthesis Tools CC 00002 // 00003 // This program was generated by CodeSynthesis XSD, an XML Schema to 00004 // C++ data binding compiler. 00005 // 00006 // This program is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License version 2 as 00008 // published by the Free Software Foundation. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 // 00019 // In addition, as a special exception, Code Synthesis Tools CC gives 00020 // permission to link this program with the Xerces-C++ library (or with 00021 // modified versions of Xerces-C++ that use the same license as Xerces-C++), 00022 // and distribute linked combinations including the two. You must obey 00023 // the GNU General Public License version 2 in all respects for all of 00024 // the code used other than Xerces-C++. If you modify this copy of the 00025 // program, you may extend this exception to your version of the program, 00026 // but you are not obligated to do so. If you do not wish to do so, delete 00027 // this exception statement from your version. 00028 // 00029 // Furthermore, Code Synthesis Tools CC makes a special exception for 00030 // the Free/Libre and Open Source Software (FLOSS) which is described 00031 // in the accompanying FLOSSE file. 00032 // 00033 00034 // Begin prologue. 00035 // 00036 // 00037 // End prologue. 00038 00039 #include <xsd/cxx/pre.hxx> 00040 00041 #include <otsdaq-utilities/ECLWriter/ECL.hxx> 00042 00043 // Tag_t 00044 // 00045 00046 const Tag_t::name_type& Tag_t::name() const { return this->name_.get(); } 00047 00048 Tag_t::name_type& Tag_t::name() { return this->name_.get(); } 00049 00050 void Tag_t::name(const name_type& x) { this->name_.set(x); } 00051 00052 void Tag_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); } 00053 00054 // Attachment_t 00055 // 00056 00057 const Attachment_t::type_type& Attachment_t::type() const { return this->type_.get(); } 00058 00059 Attachment_t::type_type& Attachment_t::type() { return this->type_.get(); } 00060 00061 void Attachment_t::type(const type_type& x) { this->type_.set(x); } 00062 00063 void Attachment_t::type(::std::unique_ptr<type_type> x) { this->type_.set(std::move(x)); } 00064 00065 const Attachment_t::filename_type& Attachment_t::filename() const 00066 { 00067 return this->filename_.get(); 00068 } 00069 00070 Attachment_t::filename_type& Attachment_t::filename() { return this->filename_.get(); } 00071 00072 void Attachment_t::filename(const filename_type& x) { this->filename_.set(x); } 00073 00074 void Attachment_t::filename(::std::unique_ptr<filename_type> x) 00075 { 00076 this->filename_.set(std::move(x)); 00077 } 00078 00079 // Field_t 00080 // 00081 00082 const Field_t::name_type& Field_t::name() const { return this->name_.get(); } 00083 00084 Field_t::name_type& Field_t::name() { return this->name_.get(); } 00085 00086 void Field_t::name(const name_type& x) { this->name_.set(x); } 00087 00088 void Field_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); } 00089 00090 // Form_t 00091 // 00092 00093 const Form_t::field_sequence& Form_t::field() const { return this->field_; } 00094 00095 Form_t::field_sequence& Form_t::field() { return this->field_; } 00096 00097 void Form_t::field(const field_sequence& s) { this->field_ = s; } 00098 00099 const Form_t::name_type& Form_t::name() const { return this->name_.get(); } 00100 00101 Form_t::name_type& Form_t::name() { return this->name_.get(); } 00102 00103 void Form_t::name(const name_type& x) { this->name_.set(x); } 00104 00105 void Form_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); } 00106 00107 // ECLEntry_t 00108 // 00109 00110 const ECLEntry_t::tag_sequence& ECLEntry_t::tag() const { return this->tag_; } 00111 00112 ECLEntry_t::tag_sequence& ECLEntry_t::tag() { return this->tag_; } 00113 00114 void ECLEntry_t::tag(const tag_sequence& s) { this->tag_ = s; } 00115 00116 const ECLEntry_t::attachment_sequence& ECLEntry_t::attachment() const 00117 { 00118 return this->attachment_; 00119 } 00120 00121 ECLEntry_t::attachment_sequence& ECLEntry_t::attachment() { return this->attachment_; } 00122 00123 void ECLEntry_t::attachment(const attachment_sequence& s) { this->attachment_ = s; } 00124 00125 const ECLEntry_t::form_optional& ECLEntry_t::form() const { return this->form_; } 00126 00127 ECLEntry_t::form_optional& ECLEntry_t::form() { return this->form_; } 00128 00129 void ECLEntry_t::form(const form_type& x) { this->form_.set(x); } 00130 00131 void ECLEntry_t::form(const form_optional& x) { this->form_ = x; } 00132 00133 void ECLEntry_t::form(::std::unique_ptr<form_type> x) { this->form_.set(std::move(x)); } 00134 00135 const ECLEntry_t::author_type& ECLEntry_t::author() const { return this->author_.get(); } 00136 00137 ECLEntry_t::author_type& ECLEntry_t::author() { return this->author_.get(); } 00138 00139 void ECLEntry_t::author(const author_type& x) { this->author_.set(x); } 00140 00141 void ECLEntry_t::author(::std::unique_ptr<author_type> x) 00142 { 00143 this->author_.set(std::move(x)); 00144 } 00145 00146 const ECLEntry_t::category_type& ECLEntry_t::category() const 00147 { 00148 return this->category_.get(); 00149 } 00150 00151 ECLEntry_t::category_type& ECLEntry_t::category() { return this->category_.get(); } 00152 00153 void ECLEntry_t::category(const category_type& x) { this->category_.set(x); } 00154 00155 void ECLEntry_t::category(::std::unique_ptr<category_type> x) 00156 { 00157 this->category_.set(std::move(x)); 00158 } 00159 00160 #include <xsd/cxx/xml/dom/parsing-source.hxx> 00161 00162 // Tag_t 00163 // 00164 00165 Tag_t::Tag_t() : ::xml_schema::type(), name_(this) {} 00166 00167 Tag_t::Tag_t(const name_type& name) : ::xml_schema::type(), name_(name, this) {} 00168 00169 Tag_t::Tag_t(const Tag_t& x, ::xml_schema::flags f, ::xml_schema::container* c) 00170 : ::xml_schema::type(x, f, c), name_(x.name_, f, this) 00171 { 00172 } 00173 00174 Tag_t::Tag_t(const ::xercesc::DOMElement& e, 00175 ::xml_schema::flags f, 00176 ::xml_schema::container* c) 00177 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), name_(this) 00178 { 00179 if((f & ::xml_schema::flags::base) == 0) 00180 { 00181 ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true); 00182 this->parse(p, f); 00183 } 00184 } 00185 00186 void Tag_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f) 00187 { 00188 while(p.more_attributes()) 00189 { 00190 const ::xercesc::DOMAttr& i(p.next_attribute()); 00191 const ::xsd::cxx::xml::qualified_name<char> n( 00192 ::xsd::cxx::xml::dom::name<char>(i)); 00193 00194 if(n.name() == "name" && n.namespace_().empty()) 00195 { 00196 this->name_.set(name_traits::create(i, f, this)); 00197 continue; 00198 } 00199 } 00200 00201 if(!name_.present()) 00202 { 00203 throw ::xsd::cxx::tree::expected_attribute<char>("name", ""); 00204 } 00205 } 00206 00207 Tag_t* Tag_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const 00208 { 00209 return new class Tag_t(*this, f, c); 00210 } 00211 00212 Tag_t& Tag_t::operator=(const Tag_t& x) 00213 { 00214 if(this != &x) 00215 { 00216 static_cast< ::xml_schema::type&>(*this) = x; 00217 this->name_ = x.name_; 00218 } 00219 00220 return *this; 00221 } 00222 00223 Tag_t::~Tag_t() {} 00224 00225 // Attachment_t 00226 // 00227 00228 Attachment_t::Attachment_t() : ::xml_schema::base64_binary(), type_(this), filename_(this) 00229 { 00230 } 00231 00232 Attachment_t::Attachment_t(const type_type& type, const filename_type& filename) 00233 : ::xml_schema::base64_binary(), type_(type, this), filename_(filename, this) 00234 { 00235 } 00236 00237 Attachment_t::Attachment_t(const ::xml_schema::base64_binary& _xsd_base64_binary_base, 00238 const type_type& type, 00239 const filename_type& filename) 00240 : ::xml_schema::base64_binary(_xsd_base64_binary_base) 00241 , type_(type, this) 00242 , filename_(filename, this) 00243 { 00244 } 00245 00246 Attachment_t::Attachment_t(const Attachment_t& x, 00247 ::xml_schema::flags f, 00248 ::xml_schema::container* c) 00249 : ::xml_schema::base64_binary(x, f, c) 00250 , type_(x.type_, f, this) 00251 , filename_(x.filename_, f, this) 00252 { 00253 } 00254 00255 Attachment_t::Attachment_t(const ::xercesc::DOMElement& e, 00256 ::xml_schema::flags f, 00257 ::xml_schema::container* c) 00258 : ::xml_schema::base64_binary(e, f | ::xml_schema::flags::base, c) 00259 , type_(this) 00260 , filename_(this) 00261 { 00262 if((f & ::xml_schema::flags::base) == 0) 00263 { 00264 ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true); 00265 this->parse(p, f); 00266 } 00267 } 00268 00269 void Attachment_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f) 00270 { 00271 while(p.more_attributes()) 00272 { 00273 const ::xercesc::DOMAttr& i(p.next_attribute()); 00274 const ::xsd::cxx::xml::qualified_name<char> n( 00275 ::xsd::cxx::xml::dom::name<char>(i)); 00276 00277 if(n.name() == "type" && n.namespace_().empty()) 00278 { 00279 this->type_.set(type_traits::create(i, f, this)); 00280 continue; 00281 } 00282 00283 if(n.name() == "filename" && n.namespace_().empty()) 00284 { 00285 this->filename_.set(filename_traits::create(i, f, this)); 00286 continue; 00287 } 00288 } 00289 00290 if(!type_.present()) 00291 { 00292 throw ::xsd::cxx::tree::expected_attribute<char>("type", ""); 00293 } 00294 00295 if(!filename_.present()) 00296 { 00297 throw ::xsd::cxx::tree::expected_attribute<char>("filename", ""); 00298 } 00299 } 00300 00301 Attachment_t* Attachment_t::_clone(::xml_schema::flags f, 00302 ::xml_schema::container* c) const 00303 { 00304 return new class Attachment_t(*this, f, c); 00305 } 00306 00307 Attachment_t& Attachment_t::operator=(const Attachment_t& x) 00308 { 00309 if(this != &x) 00310 { 00311 static_cast< ::xml_schema::base64_binary&>(*this) = x; 00312 this->type_ = x.type_; 00313 this->filename_ = x.filename_; 00314 } 00315 00316 return *this; 00317 } 00318 00319 Attachment_t::~Attachment_t() {} 00320 00321 // Field_t 00322 // 00323 00324 Field_t::Field_t() : ::xml_schema::string(), name_(this) {} 00325 00326 Field_t::Field_t(const name_type& name) : ::xml_schema::string(), name_(name, this) {} 00327 00328 Field_t::Field_t(const char* _xsd_string_base, const name_type& name) 00329 : ::xml_schema::string(_xsd_string_base), name_(name, this) 00330 { 00331 } 00332 00333 Field_t::Field_t(const ::std::string& _xsd_string_base, const name_type& name) 00334 : ::xml_schema::string(_xsd_string_base), name_(name, this) 00335 { 00336 } 00337 00338 Field_t::Field_t(const ::xml_schema::string& _xsd_string_base, const name_type& name) 00339 : ::xml_schema::string(_xsd_string_base), name_(name, this) 00340 { 00341 } 00342 00343 Field_t::Field_t(const Field_t& x, ::xml_schema::flags f, ::xml_schema::container* c) 00344 : ::xml_schema::string(x, f, c), name_(x.name_, f, this) 00345 { 00346 } 00347 00348 Field_t::Field_t(const ::xercesc::DOMElement& e, 00349 ::xml_schema::flags f, 00350 ::xml_schema::container* c) 00351 : ::xml_schema::string(e, f | ::xml_schema::flags::base, c), name_(this) 00352 { 00353 if((f & ::xml_schema::flags::base) == 0) 00354 { 00355 ::xsd::cxx::xml::dom::parser<char> p(e, false, false, true); 00356 this->parse(p, f); 00357 } 00358 } 00359 00360 void Field_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f) 00361 { 00362 while(p.more_attributes()) 00363 { 00364 const ::xercesc::DOMAttr& i(p.next_attribute()); 00365 const ::xsd::cxx::xml::qualified_name<char> n( 00366 ::xsd::cxx::xml::dom::name<char>(i)); 00367 00368 if(n.name() == "name" && n.namespace_().empty()) 00369 { 00370 this->name_.set(name_traits::create(i, f, this)); 00371 continue; 00372 } 00373 } 00374 00375 if(!name_.present()) 00376 { 00377 throw ::xsd::cxx::tree::expected_attribute<char>("name", ""); 00378 } 00379 } 00380 00381 Field_t* Field_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const 00382 { 00383 return new class Field_t(*this, f, c); 00384 } 00385 00386 Field_t& Field_t::operator=(const Field_t& x) 00387 { 00388 if(this != &x) 00389 { 00390 static_cast< ::xml_schema::string&>(*this) = x; 00391 this->name_ = x.name_; 00392 } 00393 00394 return *this; 00395 } 00396 00397 Field_t::~Field_t() {} 00398 00399 // Form_t 00400 // 00401 00402 Form_t::Form_t() : ::xml_schema::type(), field_(this), name_(this) {} 00403 00404 Form_t::Form_t(const name_type& name) 00405 : ::xml_schema::type(), field_(this), name_(name, this) 00406 { 00407 } 00408 00409 Form_t::Form_t(const Form_t& x, ::xml_schema::flags f, ::xml_schema::container* c) 00410 : ::xml_schema::type(x, f, c), field_(x.field_, f, this), name_(x.name_, f, this) 00411 { 00412 } 00413 00414 Form_t::Form_t(const ::xercesc::DOMElement& e, 00415 ::xml_schema::flags f, 00416 ::xml_schema::container* c) 00417 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), field_(this), name_(this) 00418 { 00419 if((f & ::xml_schema::flags::base) == 0) 00420 { 00421 ::xsd::cxx::xml::dom::parser<char> p(e, true, false, true); 00422 this->parse(p, f); 00423 } 00424 } 00425 00426 void Form_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f) 00427 { 00428 for(; p.more_content(); p.next_content(false)) 00429 { 00430 const ::xercesc::DOMElement& i(p.cur_element()); 00431 const ::xsd::cxx::xml::qualified_name<char> n( 00432 ::xsd::cxx::xml::dom::name<char>(i)); 00433 00434 // field 00435 // 00436 if(n.name() == "field" && n.namespace_().empty()) 00437 { 00438 ::std::unique_ptr<field_type> r(field_traits::create(i, f, this)); 00439 00440 this->field_.push_back(::std::move(r)); 00441 continue; 00442 } 00443 00444 break; 00445 } 00446 00447 while(p.more_attributes()) 00448 { 00449 const ::xercesc::DOMAttr& i(p.next_attribute()); 00450 const ::xsd::cxx::xml::qualified_name<char> n( 00451 ::xsd::cxx::xml::dom::name<char>(i)); 00452 00453 if(n.name() == "name" && n.namespace_().empty()) 00454 { 00455 this->name_.set(name_traits::create(i, f, this)); 00456 continue; 00457 } 00458 } 00459 00460 if(!name_.present()) 00461 { 00462 throw ::xsd::cxx::tree::expected_attribute<char>("name", ""); 00463 } 00464 } 00465 00466 Form_t* Form_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const 00467 { 00468 return new class Form_t(*this, f, c); 00469 } 00470 00471 Form_t& Form_t::operator=(const Form_t& x) 00472 { 00473 if(this != &x) 00474 { 00475 static_cast< ::xml_schema::type&>(*this) = x; 00476 this->field_ = x.field_; 00477 this->name_ = x.name_; 00478 } 00479 00480 return *this; 00481 } 00482 00483 Form_t::~Form_t() {} 00484 00485 // ECLEntry_t 00486 // 00487 00488 ECLEntry_t::ECLEntry_t() 00489 : ::xml_schema::type() 00490 , tag_(this) 00491 , attachment_(this) 00492 , form_(this) 00493 , author_(this) 00494 , category_(this) 00495 { 00496 } 00497 00498 ECLEntry_t::ECLEntry_t(const author_type& author, const category_type& category) 00499 : ::xml_schema::type() 00500 , tag_(this) 00501 , attachment_(this) 00502 , form_(this) 00503 , author_(author, this) 00504 , category_(category, this) 00505 { 00506 } 00507 00508 ECLEntry_t::ECLEntry_t(const ECLEntry_t& x, 00509 ::xml_schema::flags f, 00510 ::xml_schema::container* c) 00511 : ::xml_schema::type(x, f, c) 00512 , tag_(x.tag_, f, this) 00513 , attachment_(x.attachment_, f, this) 00514 , form_(x.form_, f, this) 00515 , author_(x.author_, f, this) 00516 , category_(x.category_, f, this) 00517 { 00518 } 00519 00520 ECLEntry_t::ECLEntry_t(const ::xercesc::DOMElement& e, 00521 ::xml_schema::flags f, 00522 ::xml_schema::container* c) 00523 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c) 00524 , tag_(this) 00525 , attachment_(this) 00526 , form_(this) 00527 , author_(this) 00528 , category_(this) 00529 { 00530 if((f & ::xml_schema::flags::base) == 0) 00531 { 00532 ::xsd::cxx::xml::dom::parser<char> p(e, true, false, true); 00533 this->parse(p, f); 00534 } 00535 } 00536 00537 void ECLEntry_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f) 00538 { 00539 for(; p.more_content(); p.next_content(false)) 00540 { 00541 const ::xercesc::DOMElement& i(p.cur_element()); 00542 const ::xsd::cxx::xml::qualified_name<char> n( 00543 ::xsd::cxx::xml::dom::name<char>(i)); 00544 00545 // tag 00546 // 00547 if(n.name() == "tag" && n.namespace_().empty()) 00548 { 00549 ::std::unique_ptr<tag_type> r(tag_traits::create(i, f, this)); 00550 00551 this->tag_.push_back(::std::move(r)); 00552 continue; 00553 } 00554 00555 // attachment 00556 // 00557 if(n.name() == "attachment" && n.namespace_().empty()) 00558 { 00559 ::std::unique_ptr<attachment_type> r(attachment_traits::create(i, f, this)); 00560 00561 this->attachment_.push_back(::std::move(r)); 00562 continue; 00563 } 00564 00565 // form 00566 // 00567 if(n.name() == "form" && n.namespace_().empty()) 00568 { 00569 ::std::unique_ptr<form_type> r(form_traits::create(i, f, this)); 00570 00571 if(!this->form_) 00572 { 00573 this->form_.set(::std::move(r)); 00574 continue; 00575 } 00576 } 00577 00578 break; 00579 } 00580 00581 while(p.more_attributes()) 00582 { 00583 const ::xercesc::DOMAttr& i(p.next_attribute()); 00584 const ::xsd::cxx::xml::qualified_name<char> n( 00585 ::xsd::cxx::xml::dom::name<char>(i)); 00586 00587 if(n.name() == "author" && n.namespace_().empty()) 00588 { 00589 this->author_.set(author_traits::create(i, f, this)); 00590 continue; 00591 } 00592 00593 if(n.name() == "category" && n.namespace_().empty()) 00594 { 00595 this->category_.set(category_traits::create(i, f, this)); 00596 continue; 00597 } 00598 } 00599 00600 if(!author_.present()) 00601 { 00602 throw ::xsd::cxx::tree::expected_attribute<char>("author", ""); 00603 } 00604 00605 if(!category_.present()) 00606 { 00607 throw ::xsd::cxx::tree::expected_attribute<char>("category", ""); 00608 } 00609 } 00610 00611 ECLEntry_t* ECLEntry_t::_clone(::xml_schema::flags f, ::xml_schema::container* c) const 00612 { 00613 return new class ECLEntry_t(*this, f, c); 00614 } 00615 00616 ECLEntry_t& ECLEntry_t::operator=(const ECLEntry_t& x) 00617 { 00618 if(this != &x) 00619 { 00620 static_cast< ::xml_schema::type&>(*this) = x; 00621 this->tag_ = x.tag_; 00622 this->attachment_ = x.attachment_; 00623 this->form_ = x.form_; 00624 this->author_ = x.author_; 00625 this->category_ = x.category_; 00626 } 00627 00628 return *this; 00629 } 00630 00631 ECLEntry_t::~ECLEntry_t() {} 00632 00633 #include <ostream> 00634 00635 ::std::ostream& operator<<(::std::ostream& o, const Tag_t& i) 00636 { 00637 o << ::std::endl << "name: " << i.name(); 00638 return o; 00639 } 00640 00641 ::std::ostream& operator<<(::std::ostream& o, const Attachment_t& i) 00642 { 00643 o << static_cast<const ::xml_schema::base64_binary&>(i); 00644 00645 o << ::std::endl << "type: " << i.type(); 00646 o << ::std::endl << "filename: " << i.filename(); 00647 return o; 00648 } 00649 00650 ::std::ostream& operator<<(::std::ostream& o, const Field_t& i) 00651 { 00652 o << static_cast<const ::xml_schema::string&>(i); 00653 00654 o << ::std::endl << "name: " << i.name(); 00655 return o; 00656 } 00657 00658 ::std::ostream& operator<<(::std::ostream& o, const Form_t& i) 00659 { 00660 for(Form_t::field_const_iterator b(i.field().begin()), e(i.field().end()); b != e; 00661 ++b) 00662 { 00663 o << ::std::endl << "field: " << *b; 00664 } 00665 00666 o << ::std::endl << "name: " << i.name(); 00667 return o; 00668 } 00669 00670 ::std::ostream& operator<<(::std::ostream& o, const ECLEntry_t& i) 00671 { 00672 for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), e(i.tag().end()); b != e; ++b) 00673 { 00674 o << ::std::endl << "tag: " << *b; 00675 } 00676 00677 for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()), 00678 e(i.attachment().end()); 00679 b != e; 00680 ++b) 00681 { 00682 o << ::std::endl << "attachment: " << *b; 00683 } 00684 00685 if(i.form()) 00686 { 00687 o << ::std::endl << "form: " << *i.form(); 00688 } 00689 00690 o << ::std::endl << "author: " << i.author(); 00691 o << ::std::endl << "category: " << i.category(); 00692 return o; 00693 } 00694 00695 #include <istream> 00696 #include <xsd/cxx/tree/error-handler.hxx> 00697 #include <xsd/cxx/xml/sax/std-input-source.hxx> 00698 00699 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u, 00700 ::xml_schema::flags f, 00701 const ::xml_schema::properties& p) 00702 { 00703 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00704 (f & ::xml_schema::flags::keep_dom) == 0); 00705 00706 ::xsd::cxx::tree::error_handler<char> h; 00707 00708 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00709 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f)); 00710 00711 h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >(); 00712 00713 return ::std::unique_ptr< ::ECLEntry_t>( 00714 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00715 } 00716 00717 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u, 00718 ::xml_schema::error_handler& h, 00719 ::xml_schema::flags f, 00720 const ::xml_schema::properties& p) 00721 { 00722 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00723 (f & ::xml_schema::flags::keep_dom) == 0); 00724 00725 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00726 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f)); 00727 00728 if(!d.get()) 00729 throw ::xsd::cxx::tree::parsing<char>(); 00730 00731 return ::std::unique_ptr< ::ECLEntry_t>( 00732 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00733 } 00734 00735 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u, 00736 ::xercesc::DOMErrorHandler& h, 00737 ::xml_schema::flags f, 00738 const ::xml_schema::properties& p) 00739 { 00740 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00741 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f)); 00742 00743 if(!d.get()) 00744 throw ::xsd::cxx::tree::parsing<char>(); 00745 00746 return ::std::unique_ptr< ::ECLEntry_t>( 00747 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00748 } 00749 00750 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00751 ::xml_schema::flags f, 00752 const ::xml_schema::properties& p) 00753 { 00754 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00755 (f & ::xml_schema::flags::keep_dom) == 0); 00756 00757 ::xsd::cxx::xml::sax::std_input_source isrc(is); 00758 return ::entry(isrc, f, p); 00759 } 00760 00761 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00762 ::xml_schema::error_handler& h, 00763 ::xml_schema::flags f, 00764 const ::xml_schema::properties& p) 00765 { 00766 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00767 (f & ::xml_schema::flags::keep_dom) == 0); 00768 00769 ::xsd::cxx::xml::sax::std_input_source isrc(is); 00770 return ::entry(isrc, h, f, p); 00771 } 00772 00773 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00774 ::xercesc::DOMErrorHandler& h, 00775 ::xml_schema::flags f, 00776 const ::xml_schema::properties& p) 00777 { 00778 ::xsd::cxx::xml::sax::std_input_source isrc(is); 00779 return ::entry(isrc, h, f, p); 00780 } 00781 00782 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00783 const ::std::string& sid, 00784 ::xml_schema::flags f, 00785 const ::xml_schema::properties& p) 00786 { 00787 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00788 (f & ::xml_schema::flags::keep_dom) == 0); 00789 00790 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid); 00791 return ::entry(isrc, f, p); 00792 } 00793 00794 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00795 const ::std::string& sid, 00796 ::xml_schema::error_handler& h, 00797 ::xml_schema::flags f, 00798 const ::xml_schema::properties& p) 00799 { 00800 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0, 00801 (f & ::xml_schema::flags::keep_dom) == 0); 00802 00803 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid); 00804 return ::entry(isrc, h, f, p); 00805 } 00806 00807 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is, 00808 const ::std::string& sid, 00809 ::xercesc::DOMErrorHandler& h, 00810 ::xml_schema::flags f, 00811 const ::xml_schema::properties& p) 00812 { 00813 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid); 00814 return ::entry(isrc, h, f, p); 00815 } 00816 00817 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i, 00818 ::xml_schema::flags f, 00819 const ::xml_schema::properties& p) 00820 { 00821 ::xsd::cxx::tree::error_handler<char> h; 00822 00823 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00824 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f)); 00825 00826 h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >(); 00827 00828 return ::std::unique_ptr< ::ECLEntry_t>( 00829 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00830 } 00831 00832 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i, 00833 ::xml_schema::error_handler& h, 00834 ::xml_schema::flags f, 00835 const ::xml_schema::properties& p) 00836 { 00837 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00838 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f)); 00839 00840 if(!d.get()) 00841 throw ::xsd::cxx::tree::parsing<char>(); 00842 00843 return ::std::unique_ptr< ::ECLEntry_t>( 00844 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00845 } 00846 00847 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i, 00848 ::xercesc::DOMErrorHandler& h, 00849 ::xml_schema::flags f, 00850 const ::xml_schema::properties& p) 00851 { 00852 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00853 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f)); 00854 00855 if(!d.get()) 00856 throw ::xsd::cxx::tree::parsing<char>(); 00857 00858 return ::std::unique_ptr< ::ECLEntry_t>( 00859 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00860 } 00861 00862 ::std::unique_ptr< ::ECLEntry_t> entry(const ::xercesc::DOMDocument& doc, 00863 ::xml_schema::flags f, 00864 const ::xml_schema::properties& p) 00865 { 00866 if(f & ::xml_schema::flags::keep_dom) 00867 { 00868 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 00869 static_cast< ::xercesc::DOMDocument*>(doc.cloneNode(true))); 00870 00871 return ::std::unique_ptr< ::ECLEntry_t>( 00872 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p)); 00873 } 00874 00875 const ::xercesc::DOMElement& e(*doc.getDocumentElement()); 00876 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e)); 00877 00878 if(n.name() == "entry" && n.namespace_() == "") 00879 { 00880 ::std::unique_ptr< ::ECLEntry_t> r( 00881 ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0)); 00882 return r; 00883 } 00884 00885 throw ::xsd::cxx::tree::unexpected_element<char>( 00886 n.name(), n.namespace_(), "entry", ""); 00887 } 00888 00889 ::std::unique_ptr< ::ECLEntry_t> entry( 00890 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d, 00891 ::xml_schema::flags f, 00892 const ::xml_schema::properties&) 00893 { 00894 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> c( 00895 ((f & ::xml_schema::flags::keep_dom) && !(f & ::xml_schema::flags::own_dom)) 00896 ? static_cast< ::xercesc::DOMDocument*>(d->cloneNode(true)) 00897 : 0); 00898 00899 ::xercesc::DOMDocument& doc(c.get() ? *c : *d); 00900 const ::xercesc::DOMElement& e(*doc.getDocumentElement()); 00901 00902 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e)); 00903 00904 if(f & ::xml_schema::flags::keep_dom) 00905 doc.setUserData(::xml_schema::dom::tree_node_key, (c.get() ? &c : &d), 0); 00906 00907 if(n.name() == "entry" && n.namespace_() == "") 00908 { 00909 ::std::unique_ptr< ::ECLEntry_t> r( 00910 ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0)); 00911 return r; 00912 } 00913 00914 throw ::xsd::cxx::tree::unexpected_element<char>( 00915 n.name(), n.namespace_(), "entry", ""); 00916 } 00917 00918 #include <ostream> 00919 #include <xsd/cxx/tree/error-handler.hxx> 00920 #include <xsd/cxx/xml/dom/serialization-source.hxx> 00921 00922 void entry(::std::ostream& o, 00923 const ::ECLEntry_t& s, 00924 const ::xml_schema::namespace_infomap& m, 00925 const ::std::string& e, 00926 ::xml_schema::flags f) 00927 { 00928 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0); 00929 00930 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 00931 00932 ::xsd::cxx::tree::error_handler<char> h; 00933 00934 ::xsd::cxx::xml::dom::ostream_format_target t(o); 00935 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 00936 { 00937 h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >(); 00938 } 00939 } 00940 00941 void entry(::std::ostream& o, 00942 const ::ECLEntry_t& s, 00943 ::xml_schema::error_handler& h, 00944 const ::xml_schema::namespace_infomap& m, 00945 const ::std::string& e, 00946 ::xml_schema::flags f) 00947 { 00948 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0); 00949 00950 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 00951 ::xsd::cxx::xml::dom::ostream_format_target t(o); 00952 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 00953 { 00954 throw ::xsd::cxx::tree::serialization<char>(); 00955 } 00956 } 00957 00958 void entry(::std::ostream& o, 00959 const ::ECLEntry_t& s, 00960 ::xercesc::DOMErrorHandler& h, 00961 const ::xml_schema::namespace_infomap& m, 00962 const ::std::string& e, 00963 ::xml_schema::flags f) 00964 { 00965 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 00966 ::xsd::cxx::xml::dom::ostream_format_target t(o); 00967 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 00968 { 00969 throw ::xsd::cxx::tree::serialization<char>(); 00970 } 00971 } 00972 00973 void entry(::xercesc::XMLFormatTarget& t, 00974 const ::ECLEntry_t& s, 00975 const ::xml_schema::namespace_infomap& m, 00976 const ::std::string& e, 00977 ::xml_schema::flags f) 00978 { 00979 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 00980 00981 ::xsd::cxx::tree::error_handler<char> h; 00982 00983 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 00984 { 00985 h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >(); 00986 } 00987 } 00988 00989 void entry(::xercesc::XMLFormatTarget& t, 00990 const ::ECLEntry_t& s, 00991 ::xml_schema::error_handler& h, 00992 const ::xml_schema::namespace_infomap& m, 00993 const ::std::string& e, 00994 ::xml_schema::flags f) 00995 { 00996 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 00997 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 00998 { 00999 throw ::xsd::cxx::tree::serialization<char>(); 01000 } 01001 } 01002 01003 void entry(::xercesc::XMLFormatTarget& t, 01004 const ::ECLEntry_t& s, 01005 ::xercesc::DOMErrorHandler& h, 01006 const ::xml_schema::namespace_infomap& m, 01007 const ::std::string& e, 01008 ::xml_schema::flags f) 01009 { 01010 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f)); 01011 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f)) 01012 { 01013 throw ::xsd::cxx::tree::serialization<char>(); 01014 } 01015 } 01016 01017 void entry(::xercesc::DOMDocument& d, const ::ECLEntry_t& s, ::xml_schema::flags) 01018 { 01019 ::xercesc::DOMElement& e(*d.getDocumentElement()); 01020 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e)); 01021 01022 if(n.name() == "entry" && n.namespace_() == "") 01023 { 01024 e << s; 01025 } 01026 else 01027 { 01028 throw ::xsd::cxx::tree::unexpected_element<char>( 01029 n.name(), n.namespace_(), "entry", ""); 01030 } 01031 } 01032 01033 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> entry( 01034 const ::ECLEntry_t& s, 01035 const ::xml_schema::namespace_infomap& m, 01036 ::xml_schema::flags f) 01037 { 01038 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d( 01039 ::xsd::cxx::xml::dom::serialize<char>("entry", "", m, f)); 01040 01041 ::entry(*d, s, f); 01042 return d; 01043 } 01044 01045 void operator<<(::xercesc::DOMElement& e, const Tag_t& i) 01046 { 01047 e << static_cast<const ::xml_schema::type&>(i); 01048 01049 // name 01050 // 01051 { 01052 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e)); 01053 01054 a << i.name(); 01055 } 01056 } 01057 01058 void operator<<(::xercesc::DOMElement& e, const Attachment_t& i) 01059 { 01060 e << static_cast<const ::xml_schema::base64_binary&>(i); 01061 01062 // type 01063 // 01064 { 01065 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("type", e)); 01066 01067 a << i.type(); 01068 } 01069 01070 // filename 01071 // 01072 { 01073 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("filename", e)); 01074 01075 a << i.filename(); 01076 } 01077 } 01078 01079 void operator<<(::xercesc::DOMElement& e, const Field_t& i) 01080 { 01081 e << static_cast<const ::xml_schema::string&>(i); 01082 01083 // name 01084 // 01085 { 01086 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e)); 01087 01088 a << i.name(); 01089 } 01090 } 01091 01092 void operator<<(::xercesc::DOMElement& e, const Form_t& i) 01093 { 01094 e << static_cast<const ::xml_schema::type&>(i); 01095 01096 // field 01097 // 01098 for(Form_t::field_const_iterator b(i.field().begin()), n(i.field().end()); b != n; 01099 ++b) 01100 { 01101 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("field", e)); 01102 01103 s << *b; 01104 } 01105 01106 // name 01107 // 01108 { 01109 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("name", e)); 01110 01111 a << i.name(); 01112 } 01113 } 01114 01115 void operator<<(::xercesc::DOMElement& e, const ECLEntry_t& i) 01116 { 01117 e << static_cast<const ::xml_schema::type&>(i); 01118 01119 // tag 01120 // 01121 for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), n(i.tag().end()); b != n; ++b) 01122 { 01123 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("tag", e)); 01124 01125 s << *b; 01126 } 01127 01128 // attachment 01129 // 01130 for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()), 01131 n(i.attachment().end()); 01132 b != n; 01133 ++b) 01134 { 01135 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("attachment", e)); 01136 01137 s << *b; 01138 } 01139 01140 // form 01141 // 01142 if(i.form()) 01143 { 01144 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("form", e)); 01145 01146 s << *i.form(); 01147 } 01148 01149 // author 01150 // 01151 { 01152 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("author", e)); 01153 01154 a << i.author(); 01155 } 01156 01157 // category 01158 // 01159 { 01160 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute("category", e)); 01161 01162 a << i.category(); 01163 } 01164 } 01165 01166 #include <xsd/cxx/post.hxx> 01167 01168 // Begin epilogue. 01169 // 01170 // 01171 // End epilogue.