Uri class and parser

Jacob Carlborg doob at me.com
Wed Oct 24 00:38:50 PDT 2012


On 2012-10-23 22:47, Mike van Dongen wrote:
> Hi all!
>
> I've been working on an URI parser which takes a string and then
> separates the parts and puts them in the correct properties.
> If a valid URI was provided, the (static) parser will return an instance
> of Uri.
>
> I've commented all relevant lines of code and tested it using unittests.
>
> Now what I'm wondering is if it meets the phobos requirements and
> standards.
> And of course if you think I should do a pull request on GitHub!
>
> My code can be found here, at the bottom of the already existing file
> uri.d:
> https://github.com/MikevanDongen/phobos/blob/uri-parser/std/uri.d
>
>
> Thanks,
>
> Mike van Dongen.

I would have expected a few additional components, like:

* Domain
* Password
* Username
* Host
* Hash

A way to build an URI base on the components.
It would be nice if there were methods for getting/setting the path 
component as an array. Also methods for getting/setting the query 
component as an associative array.

A few stylistic issues. There are a lot of places where you haven't 
indented the code, at least how it looks like on github.

I wouldn't put the private methods at the top.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list