1- /* auto-generated on 2024-07-06 17:38:56 -0400. Do not edit! */
1+ /* auto-generated on 2024-09-02 20:07:32 -0400. Do not edit! */
22/* begin file include/ada.h */
33/* *
44 * @file ada.h
@@ -479,6 +479,18 @@ namespace ada {
479479#define ADA_NEON 1
480480#endif
481481
482+ #ifndef __has_cpp_attribute
483+ #define ada_lifetime_bound
484+ #elif __has_cpp_attribute(msvc::lifetimebound)
485+ #define ada_lifetime_bound [[msvc::lifetimebound]]
486+ #elif __has_cpp_attribute(clang::lifetimebound)
487+ #define ada_lifetime_bound [[clang::lifetimebound]]
488+ #elif __has_cpp_attribute(lifetimebound)
489+ #define ada_lifetime_bound [[lifetimebound]]
490+ #else
491+ #define ada_lifetime_bound
492+ #endif
493+
482494#endif // ADA_COMMON_DEFS_H
483495/* end file include/ada/common_defs.h */
484496#include < cstdint>
@@ -4845,35 +4857,38 @@ struct url_aggregator : url_base {
48454857 * @see https://url.spec.whatwg.org/#dom-url-href
48464858 * @see https://url.spec.whatwg.org/#concept-url-serializer
48474859 */
4848- [[nodiscard]] inline std::string_view get_href () const noexcept ;
4860+ [[nodiscard]] inline std::string_view get_href () const noexcept
4861+ ada_lifetime_bound;
48494862 /* *
48504863 * The username getter steps are to return this's URL's username.
48514864 * This function does not allocate memory.
48524865 * @return a lightweight std::string_view.
48534866 * @see https://url.spec.whatwg.org/#dom-url-username
48544867 */
4855- [[nodiscard]] std::string_view get_username () const noexcept ;
4868+ [[nodiscard]] std::string_view get_username () const noexcept
4869+ ada_lifetime_bound;
48564870 /* *
48574871 * The password getter steps are to return this's URL's password.
48584872 * This function does not allocate memory.
48594873 * @return a lightweight std::string_view.
48604874 * @see https://url.spec.whatwg.org/#dom-url-password
48614875 */
4862- [[nodiscard]] std::string_view get_password () const noexcept ;
4876+ [[nodiscard]] std::string_view get_password () const noexcept
4877+ ada_lifetime_bound;
48634878 /* *
48644879 * Return this's URL's port, serialized.
48654880 * This function does not allocate memory.
48664881 * @return a lightweight std::string_view.
48674882 * @see https://url.spec.whatwg.org/#dom-url-port
48684883 */
4869- [[nodiscard]] std::string_view get_port () const noexcept ;
4884+ [[nodiscard]] std::string_view get_port () const noexcept ada_lifetime_bound ;
48704885 /* *
48714886 * Return U+0023 (#), followed by this's URL's fragment.
48724887 * This function does not allocate memory.
48734888 * @return a lightweight std::string_view..
48744889 * @see https://url.spec.whatwg.org/#dom-url-hash
48754890 */
4876- [[nodiscard]] std::string_view get_hash () const noexcept ;
4891+ [[nodiscard]] std::string_view get_hash () const noexcept ada_lifetime_bound ;
48774892 /* *
48784893 * Return url's host, serialized, followed by U+003A (:) and url's port,
48794894 * serialized.
@@ -4882,23 +4897,25 @@ struct url_aggregator : url_base {
48824897 * @return a lightweight std::string_view.
48834898 * @see https://url.spec.whatwg.org/#dom-url-host
48844899 */
4885- [[nodiscard]] std::string_view get_host () const noexcept ;
4900+ [[nodiscard]] std::string_view get_host () const noexcept ada_lifetime_bound ;
48864901 /* *
48874902 * Return this's URL's host, serialized.
48884903 * This function does not allocate memory.
48894904 * When there is no host, this function returns the empty view.
48904905 * @return a lightweight std::string_view.
48914906 * @see https://url.spec.whatwg.org/#dom-url-hostname
48924907 */
4893- [[nodiscard]] std::string_view get_hostname () const noexcept ;
4908+ [[nodiscard]] std::string_view get_hostname () const noexcept
4909+ ada_lifetime_bound;
48944910 /* *
48954911 * The pathname getter steps are to return the result of URL path serializing
48964912 * this's URL.
48974913 * This function does not allocate memory.
48984914 * @return a lightweight std::string_view.
48994915 * @see https://url.spec.whatwg.org/#dom-url-pathname
49004916 */
4901- [[nodiscard]] std::string_view get_pathname () const noexcept ;
4917+ [[nodiscard]] std::string_view get_pathname () const noexcept
4918+ ada_lifetime_bound;
49024919 /* *
49034920 * Compute the pathname length in bytes without instantiating a view or a
49044921 * string.
@@ -4912,15 +4929,16 @@ struct url_aggregator : url_base {
49124929 * @return a lightweight std::string_view.
49134930 * @see https://url.spec.whatwg.org/#dom-url-search
49144931 */
4915- [[nodiscard]] std::string_view get_search () const noexcept ;
4932+ [[nodiscard]] std::string_view get_search () const noexcept ada_lifetime_bound ;
49164933 /* *
49174934 * The protocol getter steps are to return this's URL's scheme, followed by
49184935 * U+003A (:).
49194936 * This function does not allocate memory.
49204937 * @return a lightweight std::string_view.
49214938 * @see https://url.spec.whatwg.org/#dom-url-protocol
49224939 */
4923- [[nodiscard]] std::string_view get_protocol () const noexcept ;
4940+ [[nodiscard]] std::string_view get_protocol () const noexcept
4941+ ada_lifetime_bound;
49244942
49254943 /* *
49264944 * A URL includes credentials if its username or password is not the empty
@@ -5828,7 +5846,7 @@ inline void url::set_scheme(std::string &&new_scheme) noexcept {
58285846 type = ada::scheme::get_scheme_type (new_scheme);
58295847 // We only move the 'scheme' if it is non-special.
58305848 if (!is_special ()) {
5831- non_special_scheme = new_scheme;
5849+ non_special_scheme = std::move ( new_scheme) ;
58325850 }
58335851}
58345852
@@ -5877,10 +5895,15 @@ inline void url::copy_scheme(const ada::url &u) {
58775895ada_really_inline size_t url::parse_port (std::string_view view,
58785896 bool check_trailing_content) noexcept {
58795897 ada_log (" parse_port('" , view, " ') " , view.size ());
5898+ if (!view.empty () && view[0 ] == ' -' ) {
5899+ ada_log (" parse_port: view[0] == '0' && view.size() > 1" );
5900+ is_valid = false ;
5901+ return 0 ;
5902+ }
58805903 uint16_t parsed_port{};
58815904 auto r = std::from_chars (view.data (), view.data () + view.size (), parsed_port);
58825905 if (r.ec == std::errc::result_out_of_range) {
5883- ada_log (" parse_port: std::errc::result_out_of_range" );
5906+ ada_log (" parse_port: r.ec == std::errc::result_out_of_range" );
58845907 is_valid = false ;
58855908 return 0 ;
58865909 }
@@ -6776,19 +6799,24 @@ inline bool url_aggregator::has_port() const noexcept {
67766799 buffer[components.host_end + 1 ] == ' .' ;
67776800}
67786801
6779- [[nodiscard]] inline std::string_view url_aggregator::get_href ()
6780- const noexcept {
6802+ [[nodiscard]] inline std::string_view url_aggregator::get_href () const noexcept
6803+ ada_lifetime_bound {
67816804 ada_log (" url_aggregator::get_href" );
67826805 return buffer;
67836806}
67846807
67856808ada_really_inline size_t url_aggregator::parse_port (
67866809 std::string_view view, bool check_trailing_content) noexcept {
67876810 ada_log (" url_aggregator::parse_port('" , view, " ') " , view.size ());
6811+ if (!view.empty () && view[0 ] == ' -' ) {
6812+ ada_log (" parse_port: view[0] == '0' && view.size() > 1" );
6813+ is_valid = false ;
6814+ return 0 ;
6815+ }
67886816 uint16_t parsed_port{};
67896817 auto r = std::from_chars (view.data (), view.data () + view.size (), parsed_port);
67906818 if (r.ec == std::errc::result_out_of_range) {
6791- ada_log (" parse_port: std::errc::result_out_of_range" );
6819+ ada_log (" parse_port: r.ec == std::errc::result_out_of_range" );
67926820 is_valid = false ;
67936821 return 0 ;
67946822 }
@@ -7279,14 +7307,14 @@ url_search_params_entries_iter::next() {
72797307#ifndef ADA_ADA_VERSION_H
72807308#define ADA_ADA_VERSION_H
72817309
7282- #define ADA_VERSION " 2.9.0 "
7310+ #define ADA_VERSION " 2.9.2 "
72837311
72847312namespace ada {
72857313
72867314enum {
72877315 ADA_VERSION_MAJOR = 2 ,
72887316 ADA_VERSION_MINOR = 9 ,
7289- ADA_VERSION_REVISION = 0 ,
7317+ ADA_VERSION_REVISION = 2 ,
72907318};
72917319
72927320} // namespace ada
0 commit comments