header_utils
|
Basic functionality for URI encoding and decoding. More...
Classes | |
struct | ghassanpl::decomposed_uri |
Holds the constituents of a URI. More... | |
Typedefs | |
using | ghassanpl::uri = std::string |
URIs are stored in a UTF-8 encoding where both non-ASCII code unit bytes as well as URI-reserved characters (delimiters, etc) are %-encoded. | |
using | ghassanpl::uri_view = std::string_view |
template<typename T > | |
using | ghassanpl::uri_expected = expected< T, uri_error_code > |
using | ghassanpl::uri_error = expected< void, uri_error_code > |
Enumerations | |
enum class | uri_error_code { no_error , unknown_uri_scheme , scheme_malformed , scheme_invalid , scheme_empty , authority_malformed , authority_empty , authority_not_allowed_in_scheme , authority_invalid_for_scheme , authority_required_in_scheme , user_info_malformed , user_info_not_allowed_in_scheme , user_info_invalid_for_scheme , user_info_required_in_scheme , host_malformed , host_not_allowed_in_scheme , host_invalid_for_scheme , host_required_in_scheme , port_malformed , port_not_allowed_in_scheme , port_invalid_for_scheme , port_required_in_scheme , path_malformed , path_element_malformed , query_malformed , query_not_allowed_in_scheme , query_invalid_for_scheme , query_required_in_scheme , fragment_malformed , fragment_not_allowed_in_scheme , fragment_invalid_for_scheme , fragment_required_in_scheme , invalid_percent_encoding , no_scheme_specific_elements , scheme_specific_element_malformed } |
enum class | ghassanpl::uri_decompose_flags { split_query_elements , split_path_elements , ghassanpl::uri_decompose_flags::use_well_known_port_numbers , lowercase_when_appropriate , normalize_path } |
Flags that modify how a URI string is decomposed into ghassanpl::decomposed_uri . More... | |
enum class | uri_compose_flags { path_leading_slash , path_trailing_slash , lowercase_when_appropriate , normalize_path , use_known_scheme } |
Functions | |
uri_expected< uri > | ghassanpl::make_uri_safe_for_display (uri_view uri) |
Removes data that should not be displayed to an untrusted user (user-info after the first ':', perhaps other things) | |
uri_expected< decomposed_uri > | ghassanpl::decompose_uri (uri_view uri, enum_flags< uri_decompose_flags > flags=enum_flags< uri_decompose_flags >::all()) |
This function will decompose URI into its composite elements, which includes percent-decoding all the elements. | |
uri_expected< uri > | ghassanpl::compose_uri (decomposed_uri const &decomposed, enum_flags< uri_compose_flags > flags=enum_flags< uri_compose_flags >::all()) |
uri_expected< uri > | ghassanpl::normalize_uri (uri_view uri) |
known_uri_scheme const * | ghassanpl::query_uri_scheme (std::string_view scheme) |
Basic functionality for URI encoding and decoding.
using ghassanpl::uri = typedef std::string |
Flags that modify how a URI string is decomposed into ghassanpl::decomposed_uri
.
Enumerator | |
---|---|
use_well_known_port_numbers | if a port is not specified in the uri, the result will guess the port based on the scheme |
uri_expected< decomposed_uri > ghassanpl::decompose_uri | ( | uri_view | uri, |
enum_flags< uri_decompose_flags > | flags = enum_flags<uri_decompose_flags>::all() |
||
) |
This function will decompose URI into its composite elements, which includes percent-decoding all the elements.
Definition at line 243 of file uri_impl.h.
known_uri_scheme const * ghassanpl::query_uri_scheme | ( | std::string_view | scheme | ) |
Definition at line 371 of file uri_impl.h.