ReleaseButler 1.0
😙 package manager on GitHub 😙
|
A simple wrapper for libcurl. More...
#include <cppcurl.h>
Public Member Functions | |
CPPCURL () | |
~CPPCURL () | |
CPPCURL (CURL *curl) | |
CPPCURL (const CPPCURL &val) | |
CPPCURL (CPPCURL &&val) noexcept | |
auto | operator= (const CPPCURL &val) -> CPPCURL & |
auto | operator= (CPPCURL &&val) noexcept -> CPPCURL & |
auto | ck4ok () const -> bool |
Detecting errors in the code_ field. | |
auto | empty () const -> bool |
Return (curl_ == nullptr ) | |
auto | reset () -> void |
Simple wrapping of curl_easy_reset() | |
auto | getinfo (CURLINFO flag, int64_t *val) -> void |
Simple encapsulation of curl_easy_getinfo() . | |
auto | getinfo_from_str (CURLINFO flag, std::string &val) -> void |
Simple encapsulation of curl_easy_getinfo() . | |
auto | setopt (CURLoption option, std::string_view val) -> void |
Simple encapsulation of curl_easy_setopt() . | |
auto | store_ass2file (std::string_view url, std::string_view file_name, bool vmod) -> bool |
Access the specified URL and save it to the specified file. | |
auto | perform () -> void |
Simple wrapping of curl_easy_perform() | |
auto | errorMsg () -> std::string_view |
Simple wrapping of curl_easy_strerror() | |
A simple wrapper for libcurl.
This class contains only two private members, CURL *curl_
and CURLcode code_
, and a simple wrapper for some libcurl functions, which I want to be able to use in other source files in a C++ way for web downloads and such.
cppcurl::CPPCURL::CPPCURL | ( | ) |
cppcurl::CPPCURL::~CPPCURL | ( | ) |
|
explicit |
cppcurl::CPPCURL::CPPCURL | ( | const CPPCURL & | val | ) |
|
noexcept |
|
nodiscard |
Detecting errors in the code_
field.
|
nodiscard |
Return (curl_ == nullptr
)
auto cppcurl::CPPCURL::errorMsg | ( | ) | -> std::string_view |
Simple wrapping of curl_easy_strerror()
auto cppcurl::CPPCURL::getinfo | ( | CURLINFO | flag, |
int64_t * | val ) -> void |
Simple encapsulation of curl_easy_getinfo()
.
Call curl_easy_getinfo()
to get the information and put the return value of curl_easy_getinfo()
into the code_ member.
`flag` | Setting the type of information to be extracted. |
`val` | The int that needs to hold the information |
flag
, see https://curl.se/libcurl/c/curl_easy_getinfo.html. auto cppcurl::CPPCURL::getinfo_from_str | ( | CURLINFO | flag, |
std::string & | val ) -> void |
Simple encapsulation of curl_easy_getinfo()
.
Call curl_easy_getinfo()
to get the information and put the return value of curl_easy_getinfo()
into the code_ member.
`flag` | Setting the type of information to be extracted. |
`val` | The std::string that needs to hold the information |
flag
, see https://curl.se/libcurl/c/curl_easy_getinfo.html. auto cppcurl::CPPCURL::perform | ( | ) | -> void |
Simple wrapping of curl_easy_perform()
auto cppcurl::CPPCURL::reset | ( | ) | -> void |
Simple wrapping of curl_easy_reset()
auto cppcurl::CPPCURL::setopt | ( | CURLoption | option, |
std::string_view | val ) -> void |
Simple encapsulation of curl_easy_setopt()
.
Call curl_easy_setopt()
to set the information.
`option` | What information to set |
`val` | std::string holding information |
flag
, see https://curl.se/libcurl/c/curl_easy_setopt.html.
|
nodiscard |
Access the specified URL and save it to the specified file.
`url` | Specified url |
`file_name` | Specified file name |
`vmode` | Whether to output more information (for debugging purposes) |