30 #ifndef CURL_MULTI_HXX
31 #define CURL_MULTI_HXX
33 #include <curl/curl.h>
43 CURLM *handle =
nullptr;
52 :handle(curl_multi_init())
54 if (handle ==
nullptr)
55 throw std::runtime_error(
"curl_multi_init() failed");
66 if (handle !=
nullptr)
67 curl_multi_cleanup(handle);
70 operator bool()
const {
71 return handle !=
nullptr;
75 std::swap(handle, src.handle);
85 auto code = curl_multi_setopt(handle, option, value);
87 throw std::runtime_error(curl_multi_strerror(code));
CurlMulti(std::nullptr_t)
Create an empty instance.
CurlMulti()
Allocate a new CURLM*.
CurlMulti & operator=(CurlMulti &&src)
An OO wrapper for a "CURLM*" (a libCURL "multi" handle).
CurlMulti(CurlMulti &&src)
void SetOption(CURLMoption option, T value)