From 2615896faa646e5830abf2c269150e1165c66515 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- libxsd/xsd/cxx/tree/serialization/double.hxx | 94 ---------------------------- 1 file changed, 94 deletions(-) delete mode 100644 libxsd/xsd/cxx/tree/serialization/double.hxx (limited to 'libxsd/xsd/cxx/tree/serialization/double.hxx') diff --git a/libxsd/xsd/cxx/tree/serialization/double.hxx b/libxsd/xsd/cxx/tree/serialization/double.hxx deleted file mode 100644 index 1375836..0000000 --- a/libxsd/xsd/cxx/tree/serialization/double.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// file : xsd/cxx/tree/serialization/double.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_CXX_TREE_SERIALIZATION_DOUBLE_HXX -#define XSD_CXX_TREE_SERIALIZATION_DOUBLE_HXX - -#include // std::numeric_limits -#include -#include - -#include - -namespace xsd -{ - namespace cxx - { - namespace tree - { - namespace bits - { - // The formula for the number of decimla digits required is given in: - // - // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf - // - template - std::basic_string - insert (const as_double& d) - { - std::basic_string r; - - if (d.x == std::numeric_limits::infinity ()) - r = bits::positive_inf (); - else if (d.x == -std::numeric_limits::infinity ()) - r = bits::negative_inf (); - else if (!(d.x == d.x)) - r = bits::nan (); - else - { - std::basic_ostringstream os; - os.imbue (std::locale::classic ()); - - // Precision. - // -#if defined (XSD_CXX_TREE_DOUBLE_PRECISION_MAX) - os.precision (2 + std::numeric_limits::digits * 301/1000); -#elif defined (XSD_CXX_TREE_DOUBLE_PRECISION) - os.precision (XSD_CXX_TREE_DOUBLE_PRECISION); -#else - os.precision (std::numeric_limits::digits10); -#endif - // Format. - // -#if defined (XSD_CXX_TREE_DOUBLE_FIXED) - os << std::fixed << d.x; -#elif defined (XSD_CXX_TREE_DOUBLE_SCIENTIFIC) - os << std::scientific << d.x; -#else - os << d.x; -#endif - r = os.str (); - } - - return r; - } - } - - template - inline void - operator<< (list_stream& ls, const as_double& d) - { - ls.os_ << bits::insert (d); - } - } - } -} - -namespace XERCES_CPP_NAMESPACE -{ - inline void - operator<< (xercesc::DOMElement& e, - const xsd::cxx::tree::as_double& d) - { - e << xsd::cxx::tree::bits::insert (d); - } - - inline void - operator<< (xercesc::DOMAttr& a, - const xsd::cxx::tree::as_double& d) - { - a << xsd::cxx::tree::bits::insert (d); - } -} - -#endif // XSD_CXX_TREE_SERIALIZATION_DOUBLE_HXX -- cgit v1.1