mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-04-05 18:09:04 +00:00
Reorganize directory structure
This commit is contained in:
26
pipeline/includes/web_client/curl_web_client.h
Normal file
26
pipeline/includes/web_client/curl_web_client.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "web_client/web_client.h"
|
||||
#include <memory>
|
||||
|
||||
// RAII for curl_global_init/cleanup.
|
||||
// An instance of this class should be created in main() before any curl
|
||||
// operations and exist for the lifetime of the application.
|
||||
class CurlGlobalState {
|
||||
public:
|
||||
CurlGlobalState();
|
||||
~CurlGlobalState();
|
||||
CurlGlobalState(const CurlGlobalState &) = delete;
|
||||
CurlGlobalState &operator=(const CurlGlobalState &) = delete;
|
||||
};
|
||||
|
||||
class CURLWebClient : public IWebClient {
|
||||
public:
|
||||
CURLWebClient();
|
||||
~CURLWebClient() override;
|
||||
|
||||
void DownloadToFile(const std::string &url,
|
||||
const std::string &filePath) override;
|
||||
std::string Get(const std::string &url) override;
|
||||
std::string UrlEncode(const std::string &value) override;
|
||||
};
|
||||
Reference in New Issue
Block a user