initial commit

This commit is contained in:
2025-09-01 20:47:58 +08:00
commit 12c51b5ddb
843 changed files with 475321 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#include "sgu_stdafx.h"
#include "sgu_mode_download.h"
#include "sgu_download_ant.h"
#include "sgu_utils.h"
#include "sgu_download_cos.h"
bool downloadFile(const char* szDownloadUrl, const char* szLocalFile)
{
if (szDownloadUrl == nullptr || szLocalFile == nullptr)
{
printf("Error: download url or local file is null.\n");
return false;
}
std::string urlStr = szDownloadUrl;
if (_stricmp(urlStr.substr(0, 6).c_str(), "cos://") == 0)
{
downloadFileFromCOS(urlStr.substr(6).c_str(), szLocalFile);
}
else
{
CDownloadAnt ant;
ant.init(convertAnsiStringToWide(szDownloadUrl).c_str(), convertAnsiStringToWide(szLocalFile).c_str());
// Wait for download to finish
ant.begin(true);
}
return true;
}