From: K. G. <kim...@gm...> - 2008-10-07 10:58:12
|
Hi Glyn, On Tue, Oct 7, 2008 at 12:12, Glyn Matthews <gly...@gm...> wrote: > > I don't know if its worth the hassle of having a distinct class for each > scheme. I was thinking about building URIs using directives in a similar > way to what we have with messages: > > boost::network::uri uri; > uri << scheme("http") > << authority("www.boost.org") > << path("path") > << query("x=5") > << fragment("bananas") > ; It looks nice in a way, but I'm not sure how often you start with components and want to join them into a URI? I think the usual use case is you have a URI string and want to modify parts of it. But this API would allow that too, I suppose. > Is this too simplistic? Do you see any problems with this approach? Depending on the variance of URIs, though, this might not be simplistic enough :-) I think there may be enough format variance to justify a directive-based model, rather than just a simple data class, though. Interesting. - Kim |