|
|
@ -36,8 +36,8 @@ input_data(istream& in_stream,bool prompt) {
|
|
|
|
in.colors.resize(in.bin_count);
|
|
|
|
in.colors.resize(in.bin_count);
|
|
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < in.bin_count; i++) {
|
|
|
|
for (size_t i = 0; i < in.bin_count; i++) {
|
|
|
|
in_stream >> in.colors[i];
|
|
|
|
//in_stream >> in.colors[i];
|
|
|
|
//in.colors[i]="red";
|
|
|
|
in.colors[i]="red";
|
|
|
|
bool check = check_color(in.colors[i]);
|
|
|
|
bool check = check_color(in.colors[i]);
|
|
|
|
while (!check) {
|
|
|
|
while (!check) {
|
|
|
|
if (prompt) cerr << "Incorrect input. Color doesn't contain # or has spaces." << endl;
|
|
|
|
if (prompt) cerr << "Incorrect input. Color doesn't contain # or has spaces." << endl;
|
|
|
@ -75,10 +75,18 @@ Input download(const string& address) {
|
|
|
|
curl_easy_setopt(curl, CURLOPT_HEADERDATA, NULL);
|
|
|
|
curl_easy_setopt(curl, CURLOPT_HEADERDATA, NULL);
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|
|
|
|
|
|
|
|
if (res != CURLE_OK) {
|
|
|
|
if (res != CURLE_OK) {
|
|
|
|
cout << curl_easy_strerror(res);
|
|
|
|
cout << curl_easy_strerror(res);
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
double *ct;
|
|
|
|
|
|
|
|
res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &ct);
|
|
|
|
|
|
|
|
if((CURLE_OK == res) && ct)
|
|
|
|
|
|
|
|
printf("Time: %f\n",ct);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return input_data(buffer, false);
|
|
|
|
return input_data(buffer, false);
|
|
|
|