2009/7/29 Артем Смирнов <[email protected]>

>
> Hi,
>
> can someone help with subj :) Nothing hard with setting callback as
> function, but I can't do same with method.
>
> namespace curlo = cURLpp::Options;
> namespace curlt = cURLpp::Types;
>
> class Foo
> {
>    void bar();
>    double progress_callback(double dltotal, double dlnow, double
> ultotal, double ulnow);
> }
>
> void Foo::bar()
> {
>    cURLpp::Cleanup cleanuper;
>    cURLpp::Easy request;
>    std::stringstream ss;
>
>    request.setOpt(new curlo::Url(url));
>    request.setOpt(new curlo::Verbose(true));
>    request.setOpt(new curlo::NoProgress(0));
>    request.setOpt(new curlo::WriteStream(&ss));
>    // here I want set progress callback
>    // with function it is looks like
>    curlt::ProgressFunctionFunctor functor(<some_callback>);
>    request.setOpt(new curlo::ProgressFunction(functor));
>    // but i need callback as method in my class
>
>    request.perform();
> }
>
> double Foo::progress_callback(double dltotal, double dlnow, double
> ultotal, double ulnow)
> {
>    <some actions>
> }


example17 is the example you're searching for.


>
>
> Thanks.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"curlpp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/curlpp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to