cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

Re: [cURLpp] Easy::setOpt improvement

From: Jean-Philippe Barette-LaPierre <jpbarrette_at_gmail.com>
Date: Fri, 14 Nov 2008 16:34:27 -0500

On Fri, Nov 14, 2008 at 4:12 PM, Piotr Dobrogost <curlpp_at_2008.autoera.pl>wrote:

> Jean
>
> Using Easy::setOpt is not as convenient as it should be.
>
> Now we have
>
> std::string address = "http://example.com"
> // Setting the URL to retrive.
> request.setOpt(new cURLpp::Options::Url(address));
>
> Could we do better?
>
> std::string url = "http://example.com"
> // Setting the URL to retrive.
> request.set<url>(address);
>

Well... No... The thing is setOpt wouldn't be able to distinguish between
different "string" options (Url, Proxy, Interface, etc). However:

 using namespace cURLpp::Options

would shorten up the code:
 request.setOpt(new Url(address))
>
>

>
> Regards
> Piotr Dobrogost
>
> _______________________________________________
> cURLpp mailing list
> cURLpp_at_rrette.com
> http://www.rrette.com/mailman/listinfo/curlpp
>

_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2008-11-14

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET