84 std::optional<std::string> host{};
97 std::optional<std::string> query{};
105 std::optional<std::string> hash{};
112 std::optional<uint16_t> port{};
119 std::string username{};
126 std::string password{};
138 [[nodiscard]] inline
bool has_port() const noexcept;
144 [[nodiscard]] inline
bool has_hostname() const noexcept;
158 [[nodiscard]] std::
string to_string() const override;
179 [[nodiscard]] std::
string get_origin() const override;
194 [[nodiscard]] std::
string get_host() const;
209 [[nodiscard]] constexpr std::string_view
get_pathname() const noexcept;
231 [[nodiscard]] const std::
string&
get_username() const noexcept;
255 bool set_port(std::string_view input);
262 void set_hash(std::string_view input);
285 bool set_host(std::string_view input);
309 bool set_href(std::string_view input);
316 [[nodiscard]] const std::
string&
get_password() const noexcept;
324 [[nodiscard]] std::
string get_port() const;
332 [[nodiscard]] std::
string get_hash() const;
365 [[nodiscard]] constexpr
bool has_hash() const noexcept override;
371 [[nodiscard]] constexpr
bool has_search() const noexcept override;
387 template <class result_type>
390 template <class result_type>
392 std::string_view, result_type&,
ada::
scheme::type, uint32_t,
size_t,
393 size_t,
size_t,
bool);
394 template <class result_type>
399 inline
void update_unencoded_base_hash(std::string_view input);
400 inline
void update_base_hostname(std::string_view input);
401 inline
void update_base_search(std::string_view input,
402 const uint8_t query_percent_encode_set[]);
403 inline
void update_base_search(std::optional<std::
string>&& input);
404 inline
void update_base_pathname(std::string_view input);
405 inline
void update_base_username(std::string_view input);
406 inline
void update_base_password(std::string_view input);
407 inline
void update_base_port(std::optional<uint16_t> input);
413 [[nodiscard]]
bool needs_rollback_snapshot(
size_t input_len) const noexcept;
420 template <
bool override_hostname = false>
421 bool set_host_or_hostname(std::string_view input);
427 [[nodiscard]]
bool parse_ipv4(std::string_view input);
433 [[nodiscard]]
bool parse_ipv6(std::string_view input);
439 [[nodiscard]]
bool parse_opaque_host(std::string_view input);
450 std::
string non_special_scheme{};
456 [[nodiscard]]
inline bool cannot_have_credentials_or_port()
const;
459 std::string_view view,
bool check_trailing_content)
noexcept override;
462 return this->parse_port(view,
false);
475 template <
bool has_state_overr
ide = false>
478 constexpr void clear_pathname()
override;
479 constexpr void clear_search()
override;
480 constexpr void set_protocol_as_file();
499 inline void set_scheme(std::string&& new_scheme)
noexcept;
505 constexpr void copy_scheme(
ada::url&& u);
511 constexpr void copy_scheme(
const ada::url& u);
515inline std::ostream&
operator<<(std::ostream& out,
const ada::url& u);
Declarations for URL specific checkers used within Ada.
Cross-platform compiler macros and common definitions.
#define ada_really_inline
Definitions for helper functions used within Ada.
Includes the definitions for helper functions.
Internal URL parsing implementation.
URL scheme utilities and constants.
std::ostream & operator<<(std::ostream &out, const ada::url &u)
Memory-efficient URL representation using a single buffer.
Abstract base class for URL representations.
Represents a parsed URL with individual string components.
void set_hash(std::string_view input)
bool set_hostname(std::string_view input)
bool set_host(std::string_view input)
url(url &&u) noexcept=default
bool has_empty_hostname() const noexcept
friend bool ada::parser::finish_simple_absolute_with_port(std::string_view, result_type &, ada::scheme::type, uint32_t, size_t, size_t, size_t, bool)
bool has_port() const noexcept
ada_really_inline bool has_credentials() const noexcept
friend ada::url ada::parser::parse_url(std::string_view, const ada::url *)
bool set_password(std::string_view input)
friend bool ada::parser::try_parse_simple_relative(std::string_view, const result_type &, result_type &)
url & operator=(url &&u) noexcept=default
url & operator=(const url &u)=default
void set_search(std::string_view input)
ada_really_inline size_t get_pathname_length() const noexcept
std::string get_search() const
bool set_href(std::string_view input)
std::string get_port() const
std::string get_protocol() const
bool has_hostname() const noexcept
std::string get_host() const
bool set_username(std::string_view input)
constexpr std::string_view get_pathname() const noexcept
url(const url &u)=default
size_t get_href_size() const noexcept
bool set_pathname(std::string_view input)
std::string get_hostname() const
ada_really_inline std::string get_href() const
friend ada::url ada::parser::parse_url_impl(std::string_view, const ada::url *)
std::string get_origin() const override
const std::string & get_password() const noexcept
friend bool ada::parser::try_parse_simple_absolute(std::string_view, result_type &)
ada_really_inline ada::url_components get_components() const
bool set_protocol(std::string_view input)
const std::string & get_username() const noexcept
friend void ada::helpers::strip_trailing_spaces_from_opaque_path(ada::url &url)
bool set_port(std::string_view input)
constexpr bool has_search() const noexcept override
std::string to_string() const override
std::string get_hash() const
constexpr bool has_hash() const noexcept override
bool has_valid_domain() const noexcept override
Base class and common definitions for URL types.
Declaration for the URL Components.