tv_rename/network.hpp

36 lines
412 B
C++
Raw Normal View History

2019-01-19 12:40:10 +00:00
#ifndef NETWORK_HPP
#define NETWORK_HPP
2019-06-07 11:12:59 +00:00
#include <string>
2019-02-04 16:39:48 +00:00
#ifdef _WIN32
2019-06-01 19:54:45 +00:00
#include <Windows.h>
2019-06-07 11:12:59 +00:00
#include <WinInet.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>
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