Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76484 - in trunk/boost/geometry/multi: . io/dsv util
From: barend.gehrels_at_[hidden]
Date: 2012-01-14 07:09:03


Author: barendgehrels
Date: 2012-01-14 07:09:03 EST (Sat, 14 Jan 2012)
New Revision: 76484
URL: http://svn.boost.org/trac/boost/changeset/76484

Log:
Moved dsv/multi, and fixed used settings and missing separator between single occurances
Added:
   trunk/boost/geometry/multi/io/dsv/write.hpp
      - copied, changed from r76461, /trunk/boost/geometry/multi/util/write_dsv.hpp
Removed:
   trunk/boost/geometry/multi/util/
Text files modified:
   trunk/boost/geometry/multi/io/dsv/write.hpp | 39 ++++++++++++++++++++++-----------------
   trunk/boost/geometry/multi/multi.hpp | 3 +--
   2 files changed, 23 insertions(+), 19 deletions(-)

Copied: trunk/boost/geometry/multi/io/dsv/write.hpp (from r76461, /trunk/boost/geometry/multi/util/write_dsv.hpp)
==============================================================================
--- /trunk/boost/geometry/multi/util/write_dsv.hpp (original)
+++ trunk/boost/geometry/multi/io/dsv/write.hpp 2012-01-14 07:09:03 EST (Sat, 14 Jan 2012)
@@ -11,8 +11,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_MULTI_UTIL_WRITE_DSV_HPP
-#define BOOST_GEOMETRY_MULTI_UTIL_WRITE_DSV_HPP
+#ifndef BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP
+#define BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP
 
 #include <boost/range.hpp>
 
@@ -25,10 +25,24 @@
 namespace detail { namespace dsv
 {
 
-
 template <typename MultiGeometry>
 struct dsv_multi
 {
+ typedef dispatch::dsv
+ <
+ typename single_tag_of
+ <
+ typename tag<MultiGeometry>::type
+ >::type,
+ typename boost::range_value<MultiGeometry>::type
+ > dispatch_one;
+
+ typedef typename boost::range_iterator
+ <
+ MultiGeometry const
+ >::type iterator;
+
+
     template <typename Char, typename Traits>
     static inline void apply(std::basic_ostream<Char, Traits>& os,
                 MultiGeometry const& multi,
@@ -36,23 +50,18 @@
     {
         os << settings.list_open;
 
- typedef typename boost::range_iterator
- <
- MultiGeometry const
- >::type iterator;
+ bool first = true;
         for(iterator it = boost::begin(multi);
             it != boost::end(multi);
- ++it)
+ ++it, first = false)
         {
- os << geometry::dsv(*it);
+ os << (first ? "" : settings.list_separator);
+ dispatch_one::apply(os, *it, settings);
         }
         os << settings.list_close;
     }
 };
 
-
-
-
 }} // namespace detail::dsv
 #endif // DOXYGEN_NO_DETAIL
 
@@ -61,18 +70,14 @@
 namespace dispatch
 {
 
-
 template <typename Geometry>
 struct dsv<multi_tag, Geometry>
     : detail::dsv::dsv_multi<Geometry>
 {};
 
-
 } // namespace dispatch
 #endif // DOXYGEN_NO_DISPATCH
 
-
-
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_MULTI_UTIL_WRITE_DSV_HPP
+#endif // BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP

Modified: trunk/boost/geometry/multi/multi.hpp
==============================================================================
--- trunk/boost/geometry/multi/multi.hpp (original)
+++ trunk/boost/geometry/multi/multi.hpp 2012-01-14 07:09:03 EST (Sat, 14 Jan 2012)
@@ -67,8 +67,7 @@
 #include <boost/geometry/multi/views/detail/range_type.hpp>
 #include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp>
 
-#include <boost/geometry/multi/util/write_dsv.hpp>
-
+#include <boost/geometry/multi/io/dsv/write.hpp>
 #include <boost/geometry/multi/io/wkt/wkt.hpp>
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk