tv_rename/network.hpp

35 lines
411 B
C++
Raw Normal View History

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 <Windows.h>
#include <WinInet.h>
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