|
enum | set_code { ok,
set_code::malform_input,
bad_port_number,
unsupported_scheme
} |
|
enum | get_code {
no_scheme,
no_user,
no_passwd,
no_options,
no_host,
no_port,
no_query,
no_fragment
} |
|
using | string = std::unique_ptr< char, curl_string_deleter > |
|
|
auto | set_url (const char *url_arg) noexcept -> Ret_except< set_code, std::bad_alloc > |
|
auto | set_scheme (const char *scheme) noexcept -> Ret_except< set_code, std::bad_alloc > |
|
auto | set_options (const char *options) noexcept -> Ret_except< set_code, std::bad_alloc > |
|
auto | set_query (const char *query) noexcept -> Ret_except< set_code, std::bad_alloc > |
|
auto | get_url () const noexcept -> Ret_except< string, get_code, std::bad_alloc > |
|
auto | get_scheme () const noexcept -> Ret_except< string, get_code, std::bad_alloc > |
|
auto | get_options () const noexcept -> Ret_except< string, get_code, std::bad_alloc > |
|
auto | get_query () const noexcept -> Ret_except< string, get_code, std::bad_alloc > |
|
|
static void | check_url (int code) |
|
- Examples
- curl_easy_get.cc, and curl_url.cc.
Definition at line 24 of file curl_url.hpp.
◆ string
std::unique_ptr for any libcurl-returned string that requires deallocation.
Definition at line 78 of file curl_url.hpp.
◆ set_code
Enumerator |
---|
malform_input | For url, it could be:
- url is longer than 8000000 bytes (7MiB)
- scheme too long (newest libcurl support up to 40 bytes)
- url does not match standard syntax
- lack necessary part, e.g. scheme, host
- contain junk character <= 0x1f || == 0x7f
|
Definition at line 35 of file curl_url.hpp.
◆ get_code
get_code::no_* can be returned by respective get_*() function.
Definition at line 83 of file curl_url.hpp.
◆ set_url()
auto curl::Url_ref_t::set_url |
( |
const char * |
url_arg | ) |
-> Ret_except<set_code, std::bad_alloc> |
|
noexcept |
- Returns
- all of set_code
Definition at line 49 of file curl_url.cc.
51 return curl_urlset_wrapper(
url, CURLUPART_URL, url_arg);
◆ set_scheme()
auto curl::Url_ref_t::set_scheme |
( |
const char * |
scheme | ) |
-> Ret_except<set_code, std::bad_alloc> |
|
noexcept |
- Returns
- only set_code::unsupported_scheme, malform_input, ok
Definition at line 53 of file curl_url.cc.
55 return curl_urlset_wrapper(
url, CURLUPART_SCHEME, scheme);
◆ set_options()
auto curl::Url_ref_t::set_options |
( |
const char * |
options | ) |
-> Ret_except<set_code, std::bad_alloc> |
|
noexcept |
◆ set_query()
auto curl::Url_ref_t::set_query |
( |
const char * |
query | ) |
-> Ret_except<set_code, std::bad_alloc> |
|
noexcept |
◆ get_url()
auto curl::Url_ref_t::get_url |
( |
| ) |
const -> Ret_except<string, get_code, std::bad_alloc> |
|
noexcept |
- Returns
- no_scheme or no_host
Definition at line 104 of file curl_url.cc.
106 return curl_urlget_wrapper(
url, CURLUPART_URL);
◆ url
char* curl::Url_ref_t::url |
If url == nullptr, then calling any member function has undefined behavior.
Definition at line 33 of file curl_url.hpp.
The documentation for this class was generated from the following files: