Ada 2.9.2
Fast spec-compliant URL parser
|
Includes the scheme declarations. 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 } |
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 |
Includes the scheme declarations.
enum ada::scheme::type : uint8_t |
Type of the scheme as an enum. Using strings to represent a scheme type is not ideal because checking for types involves string comparisons. It is faster to use a simple integer. In C++11, we are allowed to specify the underlying type of the enum. We pick an 8-bit integer (which allows up to 256 types). Specifying the type of the enum may help integration with other systems if the type variable is exposed (since its value will not depend on the compiler).
Enumerator | |
---|---|
HTTP | |
NOT_SPECIAL | |
HTTPS | |
WS | |
FTP | |
WSS | |
FILE |
|
constexprnoexcept |
Returns the scheme of an input, or NOT_SPECIAL if it's not a special scheme defined by the spec.
Definition at line 72 of file scheme-inl.h.
References ada::scheme::details::is_special_list, and NOT_SPECIAL.
|
constexprnoexcept |
Returns the port number of a special scheme.
Definition at line 69 of file scheme-inl.h.
References ada::scheme::details::special_ports.
|
constexprnoexcept |
A special scheme is an ASCII string that is listed in the first column of the following table. The default port for a special scheme is listed in the second column on the same row. The default port for any other ASCII string is null.
scheme |
Definition at line 57 of file scheme-inl.h.
References ada::scheme::details::is_special_list, and ada::scheme::details::special_ports.