|
Ada 3.4.0
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.
| enum ada::scheme::type : uint8_t |
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 72 of file scheme-inl.h.
References ada::scheme::details::is_special_list, and NOT_SPECIAL.
|
constexprnoexcept |
Returns the default port for a scheme type.
| type | The scheme type enum value. |
Definition at line 69 of file scheme-inl.h.
References ada::scheme::details::special_ports.
|
constexprnoexcept |
Returns the default port for a special scheme string.
| scheme | The scheme string (e.g., "http", "https"). |
Definition at line 57 of file scheme-inl.h.
References ada::scheme::details::is_special_list, and ada::scheme::details::special_ports.