73 const char* base,
size_t base_length)
noexcept {
82 std::string_view(input, input_length), &base_out.value()));
90 const char* base,
size_t base_length)
noexcept {
91 std::string_view base_view(base, base_length);
92 return ada::can_parse(std::string_view(input, input_length), &base_view);
107 return r.has_value();
115 owned.data =
nullptr;
119 std::string out = r->get_origin();
120 owned.
length = out.size();
121 owned.data =
new char[owned.length];
122 memcpy((
void*)owned.data, out.data(), owned.length);
135 std::string_view out = r->get_href();
144 std::string_view out = r->get_username();
153 std::string_view out = r->get_password();
162 std::string_view out = r->get_port();
171 std::string_view out = r->get_hash();
180 std::string_view out = r->get_host();
189 std::string_view out = r->get_hostname();
198 std::string_view out = r->get_pathname();
207 std::string_view out = r->get_search();
216 std::string_view out = r->get_protocol();
241 return r->set_href(std::string_view(input, length));
249 return r->set_host(std::string_view(input, length));
253 size_t length)
noexcept {
258 return r->set_hostname(std::string_view(input, length));
262 size_t length)
noexcept {
267 return r->set_protocol(std::string_view(input, length));
271 size_t length)
noexcept {
276 return r->set_username(std::string_view(input, length));
280 size_t length)
noexcept {
285 return r->set_password(std::string_view(input, length));
293 return r->set_port(std::string_view(input, length));
297 size_t length)
noexcept {
302 return r->set_pathname(std::string_view(input, length));
315 r->set_search(std::string_view(input, length));
329 r->set_hash(std::string_view(input, length));
371 return r->has_credentials();
379 return r->has_empty_hostname();
387 return r->has_hostname();
395 return r->has_non_empty_username();
403 return r->has_non_empty_password();
411 return r->has_port();
419 return r->has_password();
427 return r->has_hash();
435 return r->has_search();
451 owned.
length = out.length();
452 owned.data =
new char[owned.length];
453 memcpy((
void*)owned.data, out.data(), owned.length);
460 owned.
length = out.size();
461 owned.data =
new char[owned.length];
462 memcpy((
void*)owned.data, out.data(), owned.length);
481 std::string out = r->to_string();
483 owned.
length = out.size();
484 owned.data =
new char[owned.length];
485 memcpy((
void*)owned.data, out.data(), owned.length);
511 r->reset(std::string_view(input, length));
516 size_t key_length,
const char* value,
517 size_t value_length) {
521 r->append(std::string_view(key, key_length),
522 std::string_view(value, value_length));
527 size_t key_length,
const char* value,
528 size_t value_length) {
532 r->set(std::string_view(key, key_length),
533 std::string_view(value, value_length));
542 r->remove(std::string_view(key, key_length));
547 const char* key,
size_t key_length,
548 const char* value,
size_t value_length) {
552 r->remove(std::string_view(key, key_length),
553 std::string_view(value, value_length));
564 return r->has(std::string_view(key, key_length));
568 size_t key_length,
const char* value,
569 size_t value_length) {
575 return r->has(std::string_view(key, key_length),
576 std::string_view(value, value_length));
586 auto found = r->get(std::string_view(key, key_length));
587 if (!found.has_value()) {
594 const char* key,
size_t key_length) {
599 std::vector<std::string>());
602 r->get_all(std::string_view(key, key_length)));
656 std::string_view view = (*r)->at(index);
671 auto next = (*r)->next();
672 if (!next.has_value()) {
684 return (*r)->has_next();
699 auto next = (*r)->next();
700 if (!next.has_value()) {
712 return (*r)->has_next();
725 auto next = (*r)->next();
726 if (!next.has_value()) {
740 return (*r)->has_next();
Includes all definitions for Ada.
ada_url_search_params ada_parse_search_params(const char *input, size_t length)
ada_string ada_get_search(ada_url result) noexcept
ada_strings ada_search_params_get_all(ada_url_search_params result, const char *key, size_t key_length)
uint8_t ada_get_scheme_type(ada_url result) noexcept
bool ada_has_search(ada_url result) noexcept
void ada_free_search_params_entries_iter(ada_url_search_params_entries_iter result)
bool ada_search_params_keys_iter_has_next(ada_url_search_params_keys_iter result)
ada_string ada_search_params_values_iter_next(ada_url_search_params_values_iter result)
void ada_free_search_params_keys_iter(ada_url_search_params_keys_iter result)
void ada_clear_hash(ada_url result) noexcept
bool ada_search_params_has_value(ada_url_search_params result, const char *key, size_t key_length, const char *value, size_t value_length)
void ada_free_strings(ada_strings result)
void ada_search_params_append(ada_url_search_params result, const char *key, size_t key_length, const char *value, size_t value_length)
ada_url_search_params_entries_iter ada_search_params_get_entries(ada_url_search_params result)
void * ada_url_search_params_entries_iter
ada_string ada_search_params_get(ada_url_search_params result, const char *key, size_t key_length)
void ada_free(ada_url result) noexcept
bool ada_can_parse_with_base(const char *input, size_t input_length, const char *base, size_t base_length) noexcept
void ada_free_owned_string(ada_owned_string owned) noexcept
ada_url ada_parse(const char *input, size_t length) noexcept
uint8_t ada_get_host_type(ada_url result) noexcept
ada_string ada_get_protocol(ada_url result) noexcept
void ada_search_params_sort(ada_url_search_params result)
bool ada_has_credentials(ada_url result) noexcept
bool ada_set_pathname(ada_url result, const char *input, size_t length) noexcept
ada_string ada_get_host(ada_url result) noexcept
bool ada_set_password(ada_url result, const char *input, size_t length) noexcept
ada_string ada_get_port(ada_url result) noexcept
ada_string ada_string_create(const char *data, size_t length)
ada::result< ada::url_aggregator > & get_instance(void *result) noexcept
ada_owned_string ada_idna_to_unicode(const char *input, size_t length)
ada_string ada_get_hash(ada_url result) noexcept
ada_owned_string ada_get_origin(ada_url result) noexcept
void ada_search_params_remove_value(ada_url_search_params result, const char *key, size_t key_length, const char *value, size_t value_length)
ada_string ada_get_hostname(ada_url result) noexcept
void ada_free_search_params(ada_url_search_params result)
bool ada_set_username(ada_url result, const char *input, size_t length) noexcept
bool ada_has_empty_hostname(ada_url result) noexcept
bool ada_has_hash(ada_url result) noexcept
ada_string ada_get_href(ada_url result) noexcept
ada_string ada_get_password(ada_url result) noexcept
void * ada_url_search_params
bool ada_set_protocol(ada_url result, const char *input, size_t length) noexcept
bool ada_can_parse(const char *input, size_t length) noexcept
bool ada_is_valid(ada_url result) noexcept
ada_owned_string ada_search_params_to_string(ada_url_search_params result)
ada_string ada_strings_get(ada_strings result, size_t index)
void ada_set_search(ada_url result, const char *input, size_t length) noexcept
const ada_url_components * ada_get_components(ada_url result) noexcept
bool ada_search_params_entries_iter_has_next(ada_url_search_params_entries_iter result)
size_t ada_search_params_size(ada_url_search_params result)
ada_string ada_get_pathname(ada_url result) noexcept
void ada_free_search_params_values_iter(ada_url_search_params_values_iter result)
ada_url ada_parse_with_base(const char *input, size_t input_length, const char *base, size_t base_length) noexcept
ada_string ada_search_params_keys_iter_next(ada_url_search_params_keys_iter result)
void ada_clear_port(ada_url result) noexcept
bool ada_set_hostname(ada_url result, const char *input, size_t length) noexcept
bool ada_has_hostname(ada_url result) noexcept
ada_string_pair ada_search_params_entries_iter_next(ada_url_search_params_entries_iter result)
ada_url_search_params_keys_iter ada_search_params_get_keys(ada_url_search_params result)
ada_owned_string ada_idna_to_ascii(const char *input, size_t length)
bool ada_has_non_empty_password(ada_url result) noexcept
bool ada_set_href(ada_url result, const char *input, size_t length) noexcept
ada_url ada_copy(ada_url input) noexcept
bool ada_has_password(ada_url result) noexcept
void * ada_url_search_params_keys_iter
bool ada_search_params_values_iter_has_next(ada_url_search_params_values_iter result)
bool ada_set_port(ada_url result, const char *input, size_t length) noexcept
bool ada_has_port(ada_url result) noexcept
void ada_search_params_set(ada_url_search_params result, const char *key, size_t key_length, const char *value, size_t value_length)
bool ada_set_host(ada_url result, const char *input, size_t length) noexcept
size_t ada_strings_size(ada_strings result)
ada_url_search_params_values_iter ada_search_params_get_values(ada_url_search_params result)
void ada_set_hash(ada_url result, const char *input, size_t length) noexcept
bool ada_search_params_has(ada_url_search_params result, const char *key, size_t key_length)
bool ada_has_non_empty_username(ada_url result) noexcept
void * ada_url_search_params_values_iter
void ada_search_params_reset(ada_url_search_params result, const char *input, size_t length)
void ada_search_params_remove(ada_url_search_params result, const char *key, size_t key_length)
void ada_clear_search(ada_url result) noexcept
ada_string ada_get_username(ada_url result) noexcept
void * ada_url_search_params_entries_iter
void * ada_url_search_params
void * ada_url_search_params_keys_iter
void * ada_url_search_params_values_iter
std::string to_ascii(std::string_view ut8_string)
std::string to_unicode(std::string_view input)
bool can_parse(std::string_view input, const std::string_view *base_input=nullptr)
tl::expected< result_type, ada::errors > result
ada_warn_unused ada::result< result_type > parse(std::string_view input, const result_type *base_url=nullptr)
URL Component representations using offsets.