1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
14 #ifndef GEOMETRY_TEST_STRING_FROM_TYPE_HPP
15 #define GEOMETRY_TEST_STRING_FROM_TYPE_HPP
19 #if defined(HAVE_TTMATH)
20 # include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
23 #if defined(HAVE_CLN) || defined(HAVE_GMP)
24 # include <boost/numeric_adaptor/numeric_adaptor.hpp>
29 # include <boost/numeric_adaptor/gmp_value_type.hpp>
32 # include <boost/numeric_adaptor/cln_value_type.hpp>
38 struct string_from_type {};
40 template <> struct string_from_type<void>
41 { static std::string name() { return "v"; } };
43 template <> struct string_from_type<float>
44 { static std::string name() { return "f"; } };
46 template <> struct string_from_type<double>
47 { static std::string name() { return "d"; } };
49 template <> struct string_from_type<long double>
50 { static std::string name() { return "e"; } };
52 template <> struct string_from_type<short int>
53 { static std::string name() { return "s"; } };
55 template <> struct string_from_type<int>
56 { static std::string name() { return "i"; } };
58 template <> struct string_from_type<boost::long_long_type>
59 { static std::string name() { return "l"; } };
61 #if defined(HAVE_TTMATH)
62 template <> struct string_from_type<ttmath_big>
63 { static std::string name() { return "t"; } };
66 #if defined(BOOST_RATIONAL_HPP)
67 template <typename T> struct string_from_type<boost::rational<T> >
68 { static std::string name() { return "r"; } };
73 template <> struct string_from_type<boost::numeric_adaptor::gmp_value_type>
74 { static std::string name() { return "g"; } };
78 template <> struct string_from_type<boost::numeric_adaptor::cln_value_type>
79 { static std::string name() { return "c"; } };
83 #endif // GEOMETRY_TEST_STRING_FROM_TYPE_HPP