From: Glyn M. <gly...@gm...> - 2008-10-07 10:23:08
|
Kim, 2008/10/7 Kim Gräsman <kim...@gm...> > I think I was having problems with the different shapes of different > types of URIs, and that each scheme should probably be represented by > its own class. I'm not sure, for example, what the HTTP client should > do if it's presented with an FTP URL. > 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") ; boost::network::http::request request(uri); OR boost::network::http::request request(uri.string()); And for parsing: std::string scheme = boost::network::uri::scheme(uri); std::string authority = boost::network::uri::authority(uri); etc. Is this too simplistic? Do you see any problems with this approach? Glyn |