5#ifndef ADA_URL_AGGREGATOR_H
6#define ADA_URL_AGGREGATOR_H
25struct url_aggregator : url_base {
33 bool set_href(std::string_view input);
34 bool set_host(std::string_view input);
39 bool set_port(std::string_view input);
42 void set_hash(std::string_view input);
51 [[nodiscard]] std::
string get_origin() const noexcept override;
60 [[nodiscard]] inline std::string_view
get_href() const noexcept
68 [[nodiscard]] std::string_view
get_username() const noexcept
76 [[nodiscard]] std::string_view
get_password() const noexcept
108 [[nodiscard]] std::string_view
get_hostname() const noexcept
117 [[nodiscard]] std::string_view
get_pathname() const noexcept
140 [[nodiscard]] std::string_view
get_protocol() const noexcept
175 [[nodiscard]] std::
string to_string() const override;
186 [[nodiscard]]
bool validate() const noexcept;
191 [[nodiscard]] inline
bool has_hostname() const noexcept;
197 [[nodiscard]] inline
bool has_port() const noexcept;
199 [[nodiscard]] inline
bool has_password() const noexcept;
201 [[nodiscard]] inline
bool has_hash() const noexcept override;
203 [[nodiscard]] inline
bool has_search() const noexcept override;
220 std::
string buffer{};
230 inline
void add_authority_slashes_if_needed() noexcept;
236 inline
void reserve(uint32_t capacity);
239 std::string_view view,
bool check_trailing_content) noexcept override;
242 return this->parse_port(view,
false);
251 [[nodiscard]]
bool parse_ipv4(std::string_view input,
bool in_place);
257 [[nodiscard]]
bool parse_ipv6(std::string_view input);
263 [[nodiscard]]
bool parse_opaque_host(std::string_view input);
271 [[nodiscard]]
inline bool cannot_have_credentials_or_port()
const;
273 template <
bool overr
ide_hostname = false>
274 bool set_host_or_hostname(std::string_view input);
278 inline void update_base_authority(std::string_view base_buffer,
280 inline void update_unencoded_base_hash(std::string_view input);
281 inline void update_base_hostname(std::string_view input);
282 inline void update_base_search(std::string_view input);
283 inline void update_base_search(std::string_view input,
284 const uint8_t *query_percent_encode_set);
285 inline void update_base_pathname(std::string_view input);
286 inline void update_base_username(std::string_view input);
287 inline void append_base_username(std::string_view input);
288 inline void update_base_password(std::string_view input);
289 inline void append_base_password(std::string_view input);
290 inline void update_base_port(uint32_t input);
291 inline void append_base_pathname(std::string_view input);
292 [[nodiscard]]
inline uint32_t retrieve_base_port()
const;
293 inline void clear_hostname();
294 inline void clear_password();
295 inline void clear_pathname()
override;
296 [[nodiscard]]
inline bool has_dash_dot() const noexcept;
297 void delete_dash_dot();
298 inline
void consume_prepared_path(std::string_view input);
299 template <
bool has_state_override = false>
301 std::string_view input);
303 std::string_view input);
304 [[nodiscard]] inline
bool has_authority() const noexcept;
305 inline
void set_protocol_as_file();
306 inline
void set_scheme(std::string_view new_scheme) noexcept;
311 inline
void set_scheme_from_view_with_colon(
312 std::string_view new_scheme_with_colon) noexcept;
317inline std::ostream &operator<<(std::ostream &out, const
ada::url &u);
Common definitions for cross-platform compiler support.
#define ada_lifetime_bound
#define ada_really_inline
url_aggregator & operator=(const url_aggregator &u)=default
url_aggregator & operator=(url_aggregator &&u) noexcept=default
bool has_non_empty_username() const noexcept
ada_really_inline const ada::url_components & get_components() const noexcept
void set_hash(std::string_view input)
void clear_search() override
bool has_hostname() const noexcept
std::string_view get_hostname() const noexcept ada_lifetime_bound
bool has_non_empty_password() const noexcept
friend void ada::helpers::strip_trailing_spaces_from_opaque_path(ada::url_aggregator &url) noexcept
ada_really_inline bool has_credentials() const noexcept
friend ada::url_aggregator ada::parser::parse_url(std::string_view, const ada::url_aggregator *)
std::string to_string() const override
std::string_view get_pathname() const noexcept ada_lifetime_bound
std::string_view get_hash() const noexcept ada_lifetime_bound
bool has_empty_hostname() const noexcept
bool has_search() const noexcept override
std::string to_diagram() const
bool set_protocol(std::string_view input)
std::string get_origin() const noexcept override
bool validate() const noexcept
bool has_password() const noexcept
std::string_view get_search() const noexcept ada_lifetime_bound
ada_really_inline uint32_t get_pathname_length() const noexcept
bool has_valid_domain() const noexcept override
bool set_hostname(std::string_view input)
bool set_password(std::string_view input)
~url_aggregator() override=default
bool set_pathname(std::string_view input)
bool has_hash() const noexcept override
std::string_view get_protocol() const noexcept ada_lifetime_bound
std::string_view get_password() const noexcept ada_lifetime_bound
bool set_href(std::string_view input)
void set_search(std::string_view input)
std::string_view get_port() const noexcept ada_lifetime_bound
bool has_port() const noexcept
url_aggregator(url_aggregator &&u) noexcept=default
std::string_view get_href() const noexcept ada_lifetime_bound
friend ada::url_aggregator ada::parser::parse_url_impl(std::string_view, const ada::url_aggregator *)
bool set_host(std::string_view input)
std::string_view get_host() const noexcept ada_lifetime_bound
bool set_port(std::string_view input)
url_aggregator(const url_aggregator &u)=default
std::string_view get_username() const noexcept ada_lifetime_bound
bool set_username(std::string_view input)
URL Component representations using offsets.
Generic URL struct reliant on std::string instantiation.
Declaration for the basic URL definitions.
Declaration for the URL Components.