[geos-commits] r2769 - trunk/source/geomgraph

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Dec 3 14:24:55 EST 2009


Author: mloskot
Date: 2009-12-03 14:24:55 -0500 (Thu, 03 Dec 2009)
New Revision: 2769

Modified:
   trunk/source/geomgraph/PlanarGraph.cpp
Log:
Part 7 of larger changeset - source/geomgraph:
* Fixed incorrect int to string conversion.

Modified: trunk/source/geomgraph/PlanarGraph.cpp
===================================================================
--- trunk/source/geomgraph/PlanarGraph.cpp	2009-12-03 19:23:05 UTC (rev 2768)
+++ trunk/source/geomgraph/PlanarGraph.cpp	2009-12-03 19:24:55 UTC (rev 2769)
@@ -35,6 +35,7 @@
 #include <geos/algorithm/CGAlgorithms.h>
 
 #include <vector>
+#include <sstream>
 #include <string>
 #include <cassert>
 
@@ -378,17 +379,15 @@
 string
 PlanarGraph::printEdges()
 {
-	string out="Edges: ";
+	
+    std::ostringstream oss;
+    oss << "Edges: ";
 	for(size_t i=0, n=edges->size(); i<n; ++i)
 	{
-		out+="edge ";
-		out+=i;
-		out+=":\n";
-		Edge *e=(*edges)[i];
-		out+=e->print();
-		out+=e->eiList.print();
+        Edge *e=(*edges)[i];
+		oss << "edge " << i << ":\n" << e->print() << e->eiList.print();
 	}
-	return out;
+    return oss.str();
 }
 
 NodeMap*



More information about the geos-commits mailing list