1
- /* auto-generated on 2024-07-06 17:38:56 -0400. Do not edit! */
1
+ /* auto-generated on 2024-08-24 20:20:43 -0400. Do not edit! */
2
2
/* begin file include/ada.h */
3
3
/* *
4
4
* @file ada.h
@@ -479,6 +479,18 @@ namespace ada {
479
479
#define ADA_NEON 1
480
480
#endif
481
481
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
+
482
494
#endif // ADA_COMMON_DEFS_H
483
495
/* end file include/ada/common_defs.h */
484
496
#include < cstdint>
@@ -4845,35 +4857,38 @@ struct url_aggregator : url_base {
4845
4857
* @see https://url.spec.whatwg.org/#dom-url-href
4846
4858
* @see https://url.spec.whatwg.org/#concept-url-serializer
4847
4859
*/
4848
- [[nodiscard]] inline std::string_view get_href () const noexcept ;
4860
+ [[nodiscard]] inline std::string_view get_href () const noexcept
4861
+ ada_lifetime_bound;
4849
4862
/* *
4850
4863
* The username getter steps are to return this's URL's username.
4851
4864
* This function does not allocate memory.
4852
4865
* @return a lightweight std::string_view.
4853
4866
* @see https://url.spec.whatwg.org/#dom-url-username
4854
4867
*/
4855
- [[nodiscard]] std::string_view get_username () const noexcept ;
4868
+ [[nodiscard]] std::string_view get_username () const noexcept
4869
+ ada_lifetime_bound;
4856
4870
/* *
4857
4871
* The password getter steps are to return this's URL's password.
4858
4872
* This function does not allocate memory.
4859
4873
* @return a lightweight std::string_view.
4860
4874
* @see https://url.spec.whatwg.org/#dom-url-password
4861
4875
*/
4862
- [[nodiscard]] std::string_view get_password () const noexcept ;
4876
+ [[nodiscard]] std::string_view get_password () const noexcept
4877
+ ada_lifetime_bound;
4863
4878
/* *
4864
4879
* Return this's URL's port, serialized.
4865
4880
* This function does not allocate memory.
4866
4881
* @return a lightweight std::string_view.
4867
4882
* @see https://url.spec.whatwg.org/#dom-url-port
4868
4883
*/
4869
- [[nodiscard]] std::string_view get_port () const noexcept ;
4884
+ [[nodiscard]] std::string_view get_port () const noexcept ada_lifetime_bound ;
4870
4885
/* *
4871
4886
* Return U+0023 (#), followed by this's URL's fragment.
4872
4887
* This function does not allocate memory.
4873
4888
* @return a lightweight std::string_view..
4874
4889
* @see https://url.spec.whatwg.org/#dom-url-hash
4875
4890
*/
4876
- [[nodiscard]] std::string_view get_hash () const noexcept ;
4891
+ [[nodiscard]] std::string_view get_hash () const noexcept ada_lifetime_bound ;
4877
4892
/* *
4878
4893
* Return url's host, serialized, followed by U+003A (:) and url's port,
4879
4894
* serialized.
@@ -4882,23 +4897,25 @@ struct url_aggregator : url_base {
4882
4897
* @return a lightweight std::string_view.
4883
4898
* @see https://url.spec.whatwg.org/#dom-url-host
4884
4899
*/
4885
- [[nodiscard]] std::string_view get_host () const noexcept ;
4900
+ [[nodiscard]] std::string_view get_host () const noexcept ada_lifetime_bound ;
4886
4901
/* *
4887
4902
* Return this's URL's host, serialized.
4888
4903
* This function does not allocate memory.
4889
4904
* When there is no host, this function returns the empty view.
4890
4905
* @return a lightweight std::string_view.
4891
4906
* @see https://url.spec.whatwg.org/#dom-url-hostname
4892
4907
*/
4893
- [[nodiscard]] std::string_view get_hostname () const noexcept ;
4908
+ [[nodiscard]] std::string_view get_hostname () const noexcept
4909
+ ada_lifetime_bound;
4894
4910
/* *
4895
4911
* The pathname getter steps are to return the result of URL path serializing
4896
4912
* this's URL.
4897
4913
* This function does not allocate memory.
4898
4914
* @return a lightweight std::string_view.
4899
4915
* @see https://url.spec.whatwg.org/#dom-url-pathname
4900
4916
*/
4901
- [[nodiscard]] std::string_view get_pathname () const noexcept ;
4917
+ [[nodiscard]] std::string_view get_pathname () const noexcept
4918
+ ada_lifetime_bound;
4902
4919
/* *
4903
4920
* Compute the pathname length in bytes without instantiating a view or a
4904
4921
* string.
@@ -4912,15 +4929,16 @@ struct url_aggregator : url_base {
4912
4929
* @return a lightweight std::string_view.
4913
4930
* @see https://url.spec.whatwg.org/#dom-url-search
4914
4931
*/
4915
- [[nodiscard]] std::string_view get_search () const noexcept ;
4932
+ [[nodiscard]] std::string_view get_search () const noexcept ada_lifetime_bound ;
4916
4933
/* *
4917
4934
* The protocol getter steps are to return this's URL's scheme, followed by
4918
4935
* U+003A (:).
4919
4936
* This function does not allocate memory.
4920
4937
* @return a lightweight std::string_view.
4921
4938
* @see https://url.spec.whatwg.org/#dom-url-protocol
4922
4939
*/
4923
- [[nodiscard]] std::string_view get_protocol () const noexcept ;
4940
+ [[nodiscard]] std::string_view get_protocol () const noexcept
4941
+ ada_lifetime_bound;
4924
4942
4925
4943
/* *
4926
4944
* 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 {
5828
5846
type = ada::scheme::get_scheme_type (new_scheme);
5829
5847
// We only move the 'scheme' if it is non-special.
5830
5848
if (!is_special ()) {
5831
- non_special_scheme = new_scheme;
5849
+ non_special_scheme = std::move ( new_scheme) ;
5832
5850
}
5833
5851
}
5834
5852
@@ -5877,10 +5895,15 @@ inline void url::copy_scheme(const ada::url &u) {
5877
5895
ada_really_inline size_t url::parse_port (std::string_view view,
5878
5896
bool check_trailing_content) noexcept {
5879
5897
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
+ }
5880
5903
uint16_t parsed_port{};
5881
5904
auto r = std::from_chars (view.data (), view.data () + view.size (), parsed_port);
5882
5905
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" );
5884
5907
is_valid = false ;
5885
5908
return 0 ;
5886
5909
}
@@ -6776,19 +6799,24 @@ inline bool url_aggregator::has_port() const noexcept {
6776
6799
buffer[components.host_end + 1 ] == ' .' ;
6777
6800
}
6778
6801
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 {
6781
6804
ada_log (" url_aggregator::get_href" );
6782
6805
return buffer;
6783
6806
}
6784
6807
6785
6808
ada_really_inline size_t url_aggregator::parse_port (
6786
6809
std::string_view view, bool check_trailing_content) noexcept {
6787
6810
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
+ }
6788
6816
uint16_t parsed_port{};
6789
6817
auto r = std::from_chars (view.data (), view.data () + view.size (), parsed_port);
6790
6818
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" );
6792
6820
is_valid = false ;
6793
6821
return 0 ;
6794
6822
}
@@ -7279,14 +7307,14 @@ url_search_params_entries_iter::next() {
7279
7307
#ifndef ADA_ADA_VERSION_H
7280
7308
#define ADA_ADA_VERSION_H
7281
7309
7282
- #define ADA_VERSION " 2.9.0 "
7310
+ #define ADA_VERSION " 2.9.1 "
7283
7311
7284
7312
namespace ada {
7285
7313
7286
7314
enum {
7287
7315
ADA_VERSION_MAJOR = 2 ,
7288
7316
ADA_VERSION_MINOR = 9 ,
7289
- ADA_VERSION_REVISION = 0 ,
7317
+ ADA_VERSION_REVISION = 1 ,
7290
7318
};
7291
7319
7292
7320
} // namespace ada
0 commit comments