I would make a suggestion that the Windows version allows forward slash for a dir separator as input. "C:/foo/bar.txt" and "C:\\foo/bar.txt" are both valid paths on Windows.
-Steve ----- Original Message ---- > From: Lars Tandle Kyllingstad <[email protected]> > To: Phobos mailing list <[email protected]> > Sent: Fri, April 23, 2010 10:51:12 AM > Subject: [phobos] std.path proof of concept > > I am convinced that what I've proposed is a good idea, so I made a tiny > proof-of-concept version of the module. In fact, I found an even better > way to do it: Instead of putting the functions inside structs, I just have > one template of which the appropriate instantiation is mixed into the module > scope. So, on Windows, > getDirectory("c:\\foo\\bar.txt") --> > "c:\\foo" Path!Posix.getDirectory("/foo/bar.txt") > --> "/foo" In this way, there is no code duplication and no more > work for the library maintainer, only more flexibility for the user. Check > out the code and documentation if you don't believe me: > http://github.com/kyllingstad/ltk/blob/master/ltk/path.d > http://kyllingen.net/code/ltk/doc/path.html -Lars _______________________________________________ phobos > mailing list > href="mailto:[email protected]">[email protected] http://lists.puremagic.com/mailman/listinfo/phobos _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
