I'm building a worker class that should download stuff, via cURL.
however, cURL has some oddities in it (using my functions to buffer and send progress, etc) and i'm far from understanding classes and pointers right.
Basically, one of the options requires access to one of my functions (pointer), and it passes it what it downloaded. I'll have to do the rest, like writing it to a file, displaying or processing the data.
It works fine as a 'standard' program, but I have no idea how i should make cURL access a class function. I've tried a few workarounds, but my program crashed everytime.
..and somewhere in the constructor:
int progressUpdater(int* gauge, double dltotal, double dlnow, double ultotal, double ulnow);
int writer(char *data, size_t size, size_t nmemb, std::string *buffer);
I need the last parameter to point individual instance function "writer".
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writer);
None works. How can I do it?