
I've noticed a number of places in the codebase where people have been painstakingly building SVG path strings by hand. There had to be a better way.
And now there is: Inkscape::SVG::PathString. It accumulates SVG path operations and is convertable to a Glib::ustring.
Inkscape::SVG::PathString str;
str.moveTo(0, 0).lineTo(100, 0) .lineTo(100, 100).lineTo(0, 100) .closePath();
return str.c_str();
(You don't have to do all the operations in one go, but you can if you want.)
Check out the before and after of using it in sp-ellipse.cpp:
http://svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/sp-ellipse.cpp...
So, the next time you're tempted to break out a raw SVGOStringStream (or worse, sprintf) to build a path string, consider SVG::PathString instead.
-mental