35 lines
411 B
C++
35 lines
411 B
C++
#ifndef NETWORK_HPP
|
|
#define NETWORK_HPP
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <Windows.h>
|
|
#include <WinInet.h>
|
|
|
|
using string = std::wstring;
|
|
|
|
#else
|
|
|
|
#include <curl/curl.h>
|
|
#include <string>
|
|
|
|
using string = std::string;
|
|
|
|
#endif
|
|
|
|
class Curl {
|
|
public:
|
|
Curl();
|
|
~Curl();
|
|
std::string execute( const string &url );
|
|
|
|
private:
|
|
#ifdef _WIN32
|
|
HINTERNET connect = nullptr;
|
|
#else
|
|
CURL *curl_handle;
|
|
#endif
|
|
};
|
|
|
|
#endif
|