managed to download a tarball
This commit is contained in:
parent
7ac697f111
commit
76bd9a0497
6 changed files with 234 additions and 63 deletions
|
@ -3,10 +3,12 @@
|
|||
#include <string>
|
||||
#include <optional>
|
||||
#include <filesystem>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <list>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <curl/curl.h>
|
||||
|
||||
class Dependency {
|
||||
public:
|
||||
enum class Type {
|
||||
|
@ -31,8 +33,26 @@ public:
|
|||
const std::string path;
|
||||
|
||||
private:
|
||||
static size_t write(void *file, size_t size, size_t nmemb, void *stream);
|
||||
bool download(const std::filesystem::path& destination);
|
||||
static size_t writeFile(void* data, size_t size, size_t nmemb, void* file);
|
||||
static size_t writeString(void* data, size_t size, size_t nmemb, void* mem);
|
||||
static int trace(CURL *handle, curl_infotype type, char *data, size_t size, void *clientp);
|
||||
bool download(const std::string& url, const std::filesystem::path& destination);
|
||||
|
||||
bool downloadRepo(
|
||||
const std::filesystem::path& destination,
|
||||
const std::string& protocol,
|
||||
const std::string& host,
|
||||
const std::string& owner,
|
||||
const std::string& repo
|
||||
);
|
||||
bool repoGiteaApi1(
|
||||
const std::string& protocol,
|
||||
const std::string& host,
|
||||
const std::string& owner,
|
||||
const std::string& repo,
|
||||
nlohmann::json& json
|
||||
);
|
||||
CURLcode httpGet(const std::string& url, std::string& result, const std::list<std::string_view>& headers = {});
|
||||
|
||||
private:
|
||||
Type type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue