]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/io/io.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / io / io.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
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.
6
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
9
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)
13
14 #ifndef BOOST_GEOMETRY_IO_HPP
15 #define BOOST_GEOMETRY_IO_HPP
16
17 #include <boost/geometry/io/wkt/read.hpp>
18 #include <boost/geometry/io/wkt/write.hpp>
19
20 namespace boost { namespace geometry
21 {
22
23 struct format_wkt {};
24 struct format_wkb {}; // TODO
25 struct format_dsv {}; // TODO
26
27 #ifndef DOXYGEN_NO_DISPATCH
28 namespace dispatch
29 {
30 template <typename Tag, typename Geometry>
31 struct read
32 {
33 };
34
35 template <typename Geometry>
36 struct read<format_wkt, Geometry>
37 {
38 static inline void apply(Geometry& geometry, std::string const& wkt)
39 {
40 read_wkt<typename tag<Geometry>::type, Geometry>::apply(wkt, geometry);
41 }
42 };
43
44 } // namespace dispatch
45 #endif // DOXYGEN_NO_DISPATCH
46
47 template <typename Format, typename Geometry>
48 inline void read(Geometry& geometry, std::string const& wkt)
49 {
50 geometry::concepts::check<Geometry>();
51 dispatch::read<Format, Geometry>::apply(geometry, wkt);
52 }
53
54 // TODO: wriite
55
56 }} // namespace boost::geometry
57
58 #endif // BOOST_GEOMETRY_IO_HPP