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 --- examples/cxx/tree/custom/double/double-custom.cxx | 96 ----------------------- 1 file changed, 96 deletions(-) delete mode 100644 examples/cxx/tree/custom/double/double-custom.cxx (limited to 'examples/cxx/tree/custom/double/double-custom.cxx') diff --git a/examples/cxx/tree/custom/double/double-custom.cxx b/examples/cxx/tree/custom/double/double-custom.cxx deleted file mode 100644 index 6aad908..0000000 --- a/examples/cxx/tree/custom/double/double-custom.cxx +++ /dev/null @@ -1,96 +0,0 @@ -// file : examples/cxx/tree/custom/double/double-custom.cxx -// copyright : not copyrighted - public domain - -// Include xml-schema.hxx instead of double-custom.hxx here. -// -#include "xml-schema.hxx" - -#include -#include -#include - -#include -#include - -using namespace std; - -// Parsing. -// -namespace xsd -{ - namespace cxx - { - namespace tree - { - double traits:: - create (const std::string& s, - const xercesc::DOMElement*, - flags, - type*) - { - // This type cannot have whitespaces in its values. As result we - // don't need to waste time collapsing whitespaces. All we need to - // do is trim the string representation which can be done without - // copying. - // - ro_string tmp (s); - trim (tmp); - - zc_istream is (tmp); - is.imbue (locale::classic ()); - - double t; - is >> t; - - return t; - } - } - } -} - -// Serialization. -// -namespace XERCES_CPP_NAMESPACE -{ - void - operator<< (xercesc::DOMElement& e, const xml_schema::as_double& d) - { - ostringstream os; - os.imbue (locale::classic ()); - - os.precision (2); - os << fixed << d.x; - - e << os.str (); - } - - void - operator<< (xercesc::DOMAttr& a, const xml_schema::as_double& d) - { - ostringstream os; - os.imbue (locale::classic ()); - - os.precision (2); - os << fixed << d.x; - - a << os.str (); - } -} - -namespace xsd -{ - namespace cxx - { - namespace tree - { - void - operator<< (xml_schema::list_stream& ls, - const xml_schema::as_double& d) - { - ls.os_.imbue (locale::classic ()); - ls.os_.precision (2); - ls.os_ << fixed << d.x; - } - } - } -} -- cgit v1.1