|
Ada 3.4.4
Fast spec-compliant URL parser
|
URL scheme utilities and constants. More...
Namespaces | |
| namespace | details |
| Includes the definitions for scheme specific entities. | |
Enumerations | |
| enum | type : uint8_t { HTTP = 0 , NOT_SPECIAL = 1 , HTTPS = 2 , WS = 3 , FTP = 4 , WSS = 5 , FILE = 6 } |
| Enumeration of URL scheme types. More... | |
Functions | |
| constexpr uint16_t | get_special_port (std::string_view scheme) noexcept |
| constexpr uint16_t | get_special_port (ada::scheme::type type) noexcept |
| constexpr ada::scheme::type | get_scheme_type (std::string_view scheme) noexcept |
URL scheme utilities and constants.
Provides functions for working with URL schemes, including identification of special schemes and retrieval of default port numbers.
Enumeration of URL scheme types.
Special schemes have specific parsing rules and default ports. Using an enum allows efficient scheme comparisons without string operations.
Default ports:
| Enumerator | |
|---|---|
| HTTP | http:// scheme (port 80) |
| NOT_SPECIAL | Non-special scheme (no default port) |
| HTTPS | https:// scheme (port 443) |
| WS | ws:// WebSocket scheme (port 80) |
| FTP | ftp:// scheme (port 21) |
| WSS | wss:// secure WebSocket scheme (port 443) |
| FILE | file:// scheme (no default port) |
|
constexprnoexcept |
Converts a scheme string to its type enum.
| scheme | The scheme string to convert. |
Definition at line 107 of file scheme-inl.h.
References ada::scheme::details::branchless_load5(), ada::scheme::details::is_special_list, NOT_SPECIAL, ada::parse(), and ada::scheme::details::scheme_keys.
|
constexprnoexcept |
Returns the default port for a scheme type.
| type | The scheme type enum value. |
Definition at line 104 of file scheme-inl.h.
References ada::parse(), and ada::scheme::details::special_ports.
Returns the default port for a special scheme string.
| scheme | The scheme string (e.g., "http", "https"). |
Definition at line 90 of file scheme-inl.h.
References ada::scheme::details::branchless_load5(), ada::scheme::details::is_special_list, ada::parse(), ada::scheme::details::scheme_keys, and ada::scheme::details::special_ports.