Skip to content

Commit 182d30f

Browse files
committed
chore: update ada to v2.6.2
1 parent e34a72f commit 182d30f

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

deps/ada.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-08-21 14:44:25 -0400. Do not edit! */
1+
/* auto-generated on 2023-08-25 15:25:45 -0400. Do not edit! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */
@@ -11231,6 +11231,7 @@ bool url::parse_ipv4(std::string_view input) {
1123111231
} else {
1123211232
host = ada::serializers::ipv4(ipv4); // We have to reserialize the address.
1123311233
}
11234+
host_type = IPV4;
1123411235
return true;
1123511236
}
1123611237

@@ -11460,6 +11461,7 @@ bool url::parse_ipv6(std::string_view input) {
1146011461
}
1146111462
host = ada::serializers::ipv6(address);
1146211463
ada_log("parse_ipv6 ", *host);
11464+
host_type = IPV6;
1146311465
return true;
1146411466
}
1146511467

@@ -14020,6 +14022,7 @@ bool url_aggregator::parse_ipv4(std::string_view input) {
1402014022
update_base_hostname(
1402114023
ada::serializers::ipv4(ipv4)); // We have to reserialize the address.
1402214024
}
14025+
host_type = IPV4;
1402314026
ADA_ASSERT_TRUE(validate());
1402414027
return true;
1402514028
}
@@ -14255,6 +14258,7 @@ bool url_aggregator::parse_ipv6(std::string_view input) {
1425514258
update_base_hostname(ada::serializers::ipv6(address));
1425614259
ada_log("parse_ipv6 ", get_hostname());
1425714260
ADA_ASSERT_TRUE(validate());
14261+
host_type = IPV6;
1425814262
return true;
1425914263
}
1426014264

@@ -15006,6 +15010,14 @@ ada_string ada_get_protocol(ada_url result) noexcept {
1500615010
return ada_string_create(out.data(), out.length());
1500715011
}
1500815012

15013+
uint8_t ada_get_url_host_type(ada_url result) noexcept {
15014+
ada::result<ada::url_aggregator>& r = get_instance(result);
15015+
if (!r) {
15016+
return 0;
15017+
}
15018+
return r->host_type;
15019+
}
15020+
1500915021
bool ada_set_href(ada_url result, const char* input, size_t length) noexcept {
1501015022
ada::result<ada::url_aggregator>& r = get_instance(result);
1501115023
if (!r) {

deps/ada.h

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-08-21 14:44:25 -0400. Do not edit! */
1+
/* auto-generated on 2023-08-25 15:25:45 -0400. Do not edit! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -1008,6 +1008,7 @@ ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i) {
10081008
#define ADA_CHECKERS_INL_H
10091009

10101010

1011+
#include <algorithm>
10111012
#include <string_view>
10121013
#include <cstring>
10131014

@@ -1058,7 +1059,7 @@ ada_really_inline constexpr bool begins_with(std::string_view view,
10581059
std::string_view prefix) {
10591060
// in C++20, you have view.begins_with(prefix)
10601061
return view.size() >= prefix.size() &&
1061-
(view.substr(0, prefix.size()) == prefix);
1062+
std::equal(prefix.begin(), prefix.end(), view.begin());
10621063
}
10631064

10641065
} // namespace ada::checkers
@@ -1406,6 +1407,25 @@ constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept;
14061407

14071408
namespace ada {
14081409

1410+
/**
1411+
* Type of URL host as an enum.
1412+
*/
1413+
enum url_host_type : uint8_t {
1414+
/**
1415+
* Represents common URLs such as "https://www.google.com"
1416+
*/
1417+
DEFAULT = 0,
1418+
/**
1419+
* Represents ipv4 addresses such as "http://127.0.0.1"
1420+
*/
1421+
IPV4 = 1,
1422+
/**
1423+
* Represents ipv6 addresses such as
1424+
* "http://[2001:db8:3333:4444:5555:6666:7777:8888]"
1425+
*/
1426+
IPV6 = 2,
1427+
};
1428+
14091429
/**
14101430
* @brief Base class of URL implementations
14111431
*
@@ -1428,6 +1448,11 @@ struct url_base {
14281448
*/
14291449
bool has_opaque_path{false};
14301450

1451+
/**
1452+
* URL hosts type
1453+
*/
1454+
url_host_type host_type = url_host_type::DEFAULT;
1455+
14311456
/**
14321457
* @private
14331458
*/
@@ -6897,14 +6922,14 @@ inline void url_search_params::sort() {
68976922
#ifndef ADA_ADA_VERSION_H
68986923
#define ADA_ADA_VERSION_H
68996924

6900-
#define ADA_VERSION "2.6.1"
6925+
#define ADA_VERSION "2.6.2"
69016926

69026927
namespace ada {
69036928

69046929
enum {
69056930
ADA_VERSION_MAJOR = 2,
69066931
ADA_VERSION_MINOR = 6,
6907-
ADA_VERSION_REVISION = 1,
6932+
ADA_VERSION_REVISION = 2,
69086933
};
69096934

69106935
} // namespace ada

deps/ada_c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ ada_string ada_get_hostname(ada_url result);
6767
ada_string ada_get_pathname(ada_url result);
6868
ada_string ada_get_search(ada_url result);
6969
ada_string ada_get_protocol(ada_url result);
70+
uint8_t ada_get_url_host_type(ada_url result);
7071

7172
// url_aggregator setters
7273
// if ada_is_valid(result)) is false, the setters have no effect

0 commit comments

Comments
 (0)