annotate DEPENDENCIES/generic/include/boost/geometry/multi/io/wkt/write.hpp @ 46:d572322e2efe

Fix to .cat file check (was susceptible to DOS line-endings) and subrepo update
author Chris Cannam
date Thu, 07 Aug 2014 14:39:38 +0100
parents 2665513ce2d3
children c530137014c0
rev   line source
Chris@16 1 // Boost.Geometry (aka GGL, Generic Geometry Library)
Chris@16 2
Chris@16 3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
Chris@16 4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
Chris@16 5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
Chris@16 6
Chris@16 7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
Chris@16 8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
Chris@16 9
Chris@16 10 // Use, modification and distribution is subject to the Boost Software License,
Chris@16 11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 12 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 13
Chris@16 14 #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP
Chris@16 15 #define BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP
Chris@16 16
Chris@16 17 #include <boost/geometry/multi/core/tags.hpp>
Chris@16 18 #include <boost/geometry/multi/geometries/concepts/check.hpp>
Chris@16 19 #include <boost/geometry/multi/io/wkt/detail/prefix.hpp>
Chris@16 20 #include <boost/geometry/io/wkt/write.hpp>
Chris@16 21
Chris@16 22 namespace boost { namespace geometry
Chris@16 23 {
Chris@16 24
Chris@16 25 #ifndef DOXYGEN_NO_DETAIL
Chris@16 26 namespace detail { namespace wkt
Chris@16 27 {
Chris@16 28
Chris@16 29 template <typename Multi, typename StreamPolicy, typename PrefixPolicy>
Chris@16 30 struct wkt_multi
Chris@16 31 {
Chris@16 32 template <typename Char, typename Traits>
Chris@16 33 static inline void apply(std::basic_ostream<Char, Traits>& os,
Chris@16 34 Multi const& geometry)
Chris@16 35 {
Chris@16 36 os << PrefixPolicy::apply();
Chris@16 37 // TODO: check EMPTY here
Chris@16 38 os << "(";
Chris@16 39
Chris@16 40 for (typename boost::range_iterator<Multi const>::type
Chris@16 41 it = boost::begin(geometry);
Chris@16 42 it != boost::end(geometry);
Chris@16 43 ++it)
Chris@16 44 {
Chris@16 45 if (it != boost::begin(geometry))
Chris@16 46 {
Chris@16 47 os << ",";
Chris@16 48 }
Chris@16 49 StreamPolicy::apply(os, *it);
Chris@16 50 }
Chris@16 51
Chris@16 52 os << ")";
Chris@16 53 }
Chris@16 54 };
Chris@16 55
Chris@16 56 }} // namespace wkt::impl
Chris@16 57 #endif
Chris@16 58
Chris@16 59 #ifndef DOXYGEN_NO_DISPATCH
Chris@16 60 namespace dispatch
Chris@16 61 {
Chris@16 62
Chris@16 63 template <typename Multi>
Chris@16 64 struct wkt<Multi, multi_point_tag>
Chris@16 65 : detail::wkt::wkt_multi
Chris@16 66 <
Chris@16 67 Multi,
Chris@16 68 detail::wkt::wkt_point
Chris@16 69 <
Chris@16 70 typename boost::range_value<Multi>::type,
Chris@16 71 detail::wkt::prefix_null
Chris@16 72 >,
Chris@16 73 detail::wkt::prefix_multipoint
Chris@16 74 >
Chris@16 75 {};
Chris@16 76
Chris@16 77 template <typename Multi>
Chris@16 78 struct wkt<Multi, multi_linestring_tag>
Chris@16 79 : detail::wkt::wkt_multi
Chris@16 80 <
Chris@16 81 Multi,
Chris@16 82 detail::wkt::wkt_sequence
Chris@16 83 <
Chris@16 84 typename boost::range_value<Multi>::type
Chris@16 85 >,
Chris@16 86 detail::wkt::prefix_multilinestring
Chris@16 87 >
Chris@16 88 {};
Chris@16 89
Chris@16 90 template <typename Multi>
Chris@16 91 struct wkt<Multi, multi_polygon_tag>
Chris@16 92 : detail::wkt::wkt_multi
Chris@16 93 <
Chris@16 94 Multi,
Chris@16 95 detail::wkt::wkt_poly
Chris@16 96 <
Chris@16 97 typename boost::range_value<Multi>::type,
Chris@16 98 detail::wkt::prefix_null
Chris@16 99 >,
Chris@16 100 detail::wkt::prefix_multipolygon
Chris@16 101 >
Chris@16 102 {};
Chris@16 103
Chris@16 104 } // namespace dispatch
Chris@16 105 #endif
Chris@16 106
Chris@16 107 }} // namespace boost::geometry
Chris@16 108
Chris@16 109 #endif // BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP