Basic foundation done

This commit is contained in:
Anonymous275
2022-01-19 21:36:52 +02:00
parent 62d5936f71
commit 2b73c120a8
9 changed files with 138 additions and 31 deletions

View File

@@ -82,7 +82,7 @@ bool HTTP::ProgressBar(size_t c, size_t t){
static double progress_bar_adv;
progress_bar_adv = round(double(c) / double(t) * 25);
std::cout << "\r";
std::cout << "Progress : [ ";
std::cout << "Progress: [ ";
std::cout << round(double(c) / double(t) * 100);
std::cout << "% ] [";
int i;
@@ -102,15 +102,14 @@ bool HTTP::Download(const std::string &IP, const std::string &Path) {
isDownload = false;
if(Ret.empty())return false;
std::cout << "\n";
std::ofstream File(Path, std::ios::binary);
if(File.is_open()) {
File << Ret;
File.close();
std::cout << "\n";
LOG(INFO) << "Download Complete!";
LOG(INFO) << "Download complete!";
} else {
LOG(INFO) << "Failed to open file directory: " << Path;
LOG(ERROR) << "Failed to open file directory: " << Path;
return false;
}
return true;