I am writing a program that downloads multiple files (at the moment its only 2). I am trying to get it to display a progress bar for each download using the ProgressFunction
callback. The problem I am running into is I cannot figure out a way to differentiate between the progress between the two files. Right now it is switching between the two. I have tried looking for any further documentation but it seems the API link is broken on their site and there is not much other than some basic examples.
//ProgressCalback
double ProgressCallBack(double dltotal, double dlnow, double ultotal, double ulnow){
double progress = (dlnow/dltotal) * 100;
std::ostringstream strs;
float percent = floorf(progress * 100) / 100;
strs << percent;
printf("%s\t%d\t%d\t%d\t%d\n", strs.str().c_str(),dltotal, dlnow, ultotal, ulnow);
return 0;
};
curlpp::options::ProgressFunction progressBar(ProgressCallBack);
request1.setOpt(new curlpp::options::Url(url1));
request1.setOpt(new curlpp::options::Verbose(false));
request1.setOpt(new curlpp::options::NoProgress(0));
request1.setOpt(progressBar);
I am not entirely sure what part of my code would be relevant so here are the parts pertaining to the progress callback. Any help would be appreciated.