On Jul 1, 2013, at 2:13 PM, Johan Engelen wrote:
On 30-6-2013 2:18, Matthew Petroff wrote:
Since my last update, I have implemented a "Length" class to store a length with its unit and perform unit conversions and have begun porting code to the new class.
http://www.mpetroff.net/archives/2013/06/29/length-class-and-refactoring/
Looks good to start with converting all code to use one unit handling system. Two comments:
- the Length::convert could be a static method of the class, so it can
be used without creating a Length object. 2) Inkscape::Util::Length is pretty lengthy (;-)). You may want to drop the "Util" at least...
Of if you use the 'using declaration' you can keep the namespace but then skip it in the source file(s) using it.
using Inkscape::Util::Length;
...
Length foo;
That way files that include the declaration indirectly will not have any naming collisions, yet the consuming source files can keep brevity.