Uri class and parser

Jacob Carlborg doob at me.com
Thu Oct 25 11:51:11 PDT 2012


On 2012-10-25 15:20, Mike van Dongen wrote:

> It's a dirty job, but someone's gotta do it ;)
> I have commented all code that's not straightforward, but nothing for
> the Ddoc.

If think the ddoc is the most important one.

> Can you give me an example of how specific I need to be in the
> documentation?

I would say as specific as possible. But the interface is pretty 
straight forward. It might be enough to have empty ddoc comments for all 
the methods that is a part of the URI, i.e. "username", "port" and so 
on. Then add documentation for the class that shows how to use the 
complete interface. Take a look the "$.mobile.path.parseUrl()" method 
part of jquerymobile:

http://jquerymobile.com/demos/1.2.0/docs/api/methods.html

It shows an example in the bottom what every "method" would return.


> It's not clear to me what you mean by this.
> To clarify: the first 520 lines weren't written by me, and the code I
> have written doesn't use any of those functions.
> Atleast, for now; Moving the functions 'encode' and 'decode' into the
> class Uri may be useful at a later point.
>
> As I'm the new kid on the block, I'm trying not to break others' code. ;)

Oh, Phobos already has a uri module, then you should leave the other 
code. My bad hehe.

I noticed just now that you moved your new code to std.net.uri. I don't 
think it's good to have two uri modules. Either leave the code in 
std.uri or move all code to std.net.uri and add a public import or 
similar to std.uri. But that is still risk of breaking existing code.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list