2019-01-19 12:40:10 +00:00
|
|
|
#ifndef NETWORK_HPP
|
|
|
|
#define NETWORK_HPP
|
|
|
|
|
2019-02-04 16:39:48 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#include <WinInet.h>
|
2019-06-01 19:54:45 +00:00
|
|
|
#include <Windows.h>
|
2019-02-04 16:39:48 +00:00
|
|
|
|
|
|
|
using string = std::wstring;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2019-01-19 12:40:10 +00:00
|
|
|
#include <curl/curl.h>
|
|
|
|
#include <string>
|
|
|
|
|
2019-02-04 16:39:48 +00:00
|
|
|
using string = std::string;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-01-19 12:40:10 +00:00
|
|
|
class Curl {
|
|
|
|
public:
|
|
|
|
Curl();
|
|
|
|
~Curl();
|
2019-02-04 16:39:48 +00:00
|
|
|
std::string execute( const string &url );
|
|
|
|
|
2019-01-19 12:40:10 +00:00
|
|
|
private:
|
2019-02-04 16:39:48 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
HINTERNET connect = nullptr;
|
|
|
|
#else
|
2019-01-19 12:40:10 +00:00
|
|
|
CURL *curl_handle;
|
2019-02-04 16:39:48 +00:00
|
|
|
#endif
|
2019-01-19 12:40:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|