From 5e527213a2430bb3018e5eebd909aef294edf9b5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- .../cxx/tree/custom/calendar/xml-schema-custom.cxx | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 xsd-examples/cxx/tree/custom/calendar/xml-schema-custom.cxx (limited to 'xsd-examples/cxx/tree/custom/calendar/xml-schema-custom.cxx') diff --git a/xsd-examples/cxx/tree/custom/calendar/xml-schema-custom.cxx b/xsd-examples/cxx/tree/custom/calendar/xml-schema-custom.cxx new file mode 100644 index 0000000..2bfe0f2 --- /dev/null +++ b/xsd-examples/cxx/tree/custom/calendar/xml-schema-custom.cxx @@ -0,0 +1,56 @@ +// file : cxx/tree/custom/calendar/xml-schema-custom.cxx +// copyright : not copyrighted - public domain + +// Include xml-schema.hxx instead of xml-schema-custom.hxx here. +// +#include "xml-schema.hxx" + +#include // xsd::cxx::xml::transcode +#include // xsd::cxx::tree::text_content + +using namespace boost; +using namespace boost::gregorian; + +namespace xml_schema +{ + date:: + date (const xercesc::DOMElement& e, flags f, container* c) + : simple_type (e, f, c), + gregorian::date ( + from_simple_string ( + xsd::cxx::tree::text_content (e))) + { + } + + date:: + date (const xercesc::DOMAttr& a, flags f, container* c) + : simple_type (a, f, c), + gregorian::date ( + from_simple_string ( + xsd::cxx::xml::transcode (a.getValue ()))) + { + } + + date:: + date (const std::string& s, + const xercesc::DOMElement* e, + flags f, + container* c) + : simple_type (s, e, f, c), + gregorian::date (from_simple_string (s)) + { + } + + date:: + date (const date& d, flags f, container* c) + : simple_type (d, f, c), + gregorian::date (d) + { + } + + date* date:: + _clone (flags f, container* c) const + { + return new date (*this, f, c); + } +} -- cgit v1.1