13namespace hi::inline
v1 {
15constexpr char native_path_seperator = (operating_system::current == operating_system::windows) ?
'\\' :
'/';
17constexpr bool is_urlchar_alpha(
char c)
19 return (c >=
'a' && c <=
'z') || (
c >=
'A' &&
c <=
'Z');
22constexpr bool is_urlchar_digit(
char c)
24 return (c >=
'0' && c <=
'9');
27constexpr bool is_urlchar_gen_delims(
char c)
29 return c ==
':' ||
c ==
'/' ||
c ==
'?' ||
c ==
'#' ||
c ==
'[' ||
c ==
']' ||
c ==
'@';
32constexpr bool is_urlchar_sub_delims(
char c)
34 return c ==
'!' ||
c ==
'$' ||
c ==
'&' ||
c ==
'\'' ||
c ==
'(' ||
c ==
')' ||
c ==
'*' ||
c ==
'+' ||
c ==
',' ||
38constexpr bool is_urlchar_unreserved(
char c)
40 return is_urlchar_alpha(c) || is_urlchar_digit(c) ||
c ==
'-' ||
c ==
'.' ||
c ==
'_' ||
c ==
'~';
43constexpr bool is_urlchar_reserved(
char c)
45 return is_urlchar_gen_delims(c) || is_urlchar_sub_delims(c);
48constexpr bool is_urlchar_pchar(
char c)
50 return is_urlchar_unreserved(c) || is_urlchar_sub_delims(c) ||
c ==
':' ||
c ==
'@';
53constexpr bool is_urlchar_pchar_forward(
char c)
55 return is_urlchar_pchar(c) ||
c ==
'/';
58constexpr bool is_urlchar_pchar_backward(
char c)
60 return is_urlchar_pchar(c) ||
c ==
'\\';
71inline std::string url_encode(std::string_view input)
noexcept
91 std::string_view scheme;
92 std::string_view authority;
93 std::string_view drive;
96 std::string_view query;
97 std::string_view fragment;
125std::
string generate_native_path(
url_parts const &parts) noexcept;
133std::
string normalize_url(
std::string_view url) noexcept;
143std::
string concatenate_url_path(
std::string_view lhs,
std::string_view rhs) noexcept;
151std::
string concatenate_url_filename(
std::string_view lhs,
std::string_view rhs) noexcept;
155std::
string filename_from_path(
std::string_view path) noexcept;
Functions and macros for handling architectural difference between compilers, CPUs and operating syst...
DOXYGEN BUG.
Definition algorithm.hpp:15
std::string url_decode(std::string_view input, bool plus_to_space=false) noexcept
url_parts parse_path(std::string_view path, std::string &encodedPath) noexcept
std::string url_encode_part(std::string_view input, std::function< bool(char)> unreserved_char_check) noexcept
url_parts parse_url(std::string_view url) noexcept
Definition url_parser.hpp:90