ReleaseButler 1.0
😙 package manager on GitHub 😙
Loading...
Searching...
No Matches
cppcurl.h
Go to the documentation of this file.
1#pragma once
2#include <curl/curl.h>
3
4#include <cstdint>
5#include <string>
6#include <string_view>
7
8namespace cppcurl {
9
18class CPPCURL {
19 private:
20 CURL *curl_;
21 CURLcode code_;
22
23 public:
24 CPPCURL();
25 ~CPPCURL();
26 explicit CPPCURL(CURL *curl);
27 CPPCURL(const CPPCURL &val);
28 CPPCURL(CPPCURL &&val) noexcept;
29 auto operator=(const CPPCURL& val) -> CPPCURL&;
30 auto operator=(CPPCURL &&val) noexcept ->CPPCURL&;
31
35 [[nodiscard]] auto ck4ok() const -> bool;
36
40 [[nodiscard]] auto empty() const -> bool;
41
45 auto reset() -> void;
46
59 auto getinfo(CURLINFO flag, int64_t *val) -> void;
60
73 auto getinfo_from_str(CURLINFO flag, std::string &val) -> void;
74
86 auto setopt(CURLoption option, std::string_view val) -> void;
87
97 [[nodiscard]] auto store_ass2file(std::string_view url,
98 std::string_view file_name, bool vmod)
99 -> bool;
100
104 auto perform() -> void;
105
110 auto errorMsg() -> std::string_view;
111};
112} // namespace cppcurl
A simple wrapper for libcurl.
Definition cppcurl.h:18
auto getinfo(CURLINFO flag, int64_t *val) -> void
Simple encapsulation of curl_easy_getinfo().
Definition cppcurl.cpp:68
auto perform() -> void
Simple wrapping of curl_easy_perform()
Definition cppcurl.cpp:82
auto errorMsg() -> std::string_view
Simple wrapping of curl_easy_strerror()
Definition cppcurl.cpp:86
auto reset() -> void
Simple wrapping of curl_easy_reset()
Definition cppcurl.cpp:66
CPPCURL()
Definition cppcurl.cpp:24
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.
Definition cppcurl.cpp:92
~CPPCURL()
Definition cppcurl.cpp:26
auto setopt(CURLoption option, std::string_view val) -> void
Simple encapsulation of curl_easy_setopt().
Definition cppcurl.cpp:78
auto getinfo_from_str(CURLINFO flag, std::string &val) -> void
Simple encapsulation of curl_easy_getinfo().
Definition cppcurl.cpp:72
auto empty() const -> bool
Return (curl_ == nullptr)
Definition cppcurl.cpp:90
auto operator=(const CPPCURL &val) -> CPPCURL &
Definition cppcurl.cpp:46
auto ck4ok() const -> bool
Detecting errors in the code_ field.
Definition cppcurl.cpp:84
Definition cppcurl.cpp:15