Proposal for std.path replacement
Lars T. Kyllingstad
public at kyllingen.NOSPAMnet
Fri Mar 4 00:35:41 PST 2011
On Fri, 04 Mar 2011 00:42:53 +0100, spir wrote:
> On 03/03/2011 05:29 PM, Lars T. Kyllingstad wrote:
>> As mentioned in the "std.path.getName(): Screwy by design?" thread, I
>> started working on a rewrite of std.path a long time ago, but I got
>> sidetracked by other things. The recent discussion got me working on
>> it again, and it turned out there wasn't that much left to be done.
>>
>> So here it is, please comment:
>>
>> http://kyllingen.net/code/ltk/doc/path.html
>> https://github.com/kyllingstad/ltk/blob/master/ltk/path.d
>>
>> Features:
>>
>> - Most functions work with all string types, i.e. all permutations of
>> mutable/const/immutable(char/wchar/dchar)[]. Notable exceptions are
>> toAbsolute() and toCanonical, because they rely on std.file.getcwd()
>> which returns an immutable(char)[].
>>
>> - Correct behaviour in corner cases that aren't covered by the current
>> std.path. See the other thread for some examples, or take a look at
>> the unittests for a more complete picture.
>>
>> - Saner naming scheme. (Still not set in stone, of course.)
>>
>> -Lars
>
> Looks very good. Including doc. A real pleasure to explore :-)
Thanks!
> Jonathan: "I'd prefer dirName to directory." Agreed. (The element in
> question is a name, not a piece of data modelling directory.)
> [that's ~ all what I would criticize ;-)]
One more vote for dirName() has been noted. :)
-Lars
More information about the Digitalmars-d
mailing list