27 runtime_error(curl_easy_strerror(num)),
38 runtime_error(msg +
": " + curl_easy_strerror(num)),
49 runtime_error(std::string(msg) +
": " + curl_easy_strerror(num)),
75 curl_easy_cleanup(ptr);
82 using curl = std::unique_ptr<CURL, curl_easy_cleanup_delete>;
94 curl_slist_free_all(ptr);
101 using curl_slist = std::unique_ptr<struct ::curl_slist, curl_slist_free_all_delete>;
116 auto code = curl_global_init(flags);
117 if (code != CURLE_OK) _Unlikely_
128 curl_global_cleanup();
Context scope automatic CURL (un)initialization.
Definition curl.hpp:107
virtual ~curl_initializer()
Uninitializes CURL.
Definition curl.hpp:126
curl_initializer(long flags)
Initializes the CURL library.
Definition curl.hpp:114
CURL runtime error.
Definition curl.hpp:19
curl_runtime_error(CURLcode num, const char *msg)
Constructs an exception.
Definition curl.hpp:48
curl_runtime_error(CURLcode num)
Constructs an exception.
Definition curl.hpp:26
CURLcode m_num
Numeric error code.
Definition curl.hpp:62
CURLcode number() const
Returns the error number.
Definition curl.hpp:56
curl_runtime_error(CURLcode num, const std::string &msg)
Constructs an exception.
Definition curl.hpp:37
Deleter for unique_ptr using curl_easy_cleanup.
Definition curl.hpp:69
void operator()(CURL *ptr) const
Delete a pointer.
Definition curl.hpp:73
Deleter for unique_ptr using curl_slist_free_all.
Definition curl.hpp:88
void operator()(struct ::curl_slist *ptr) const
Delete a pointer.
Definition curl.hpp:92