Ada 3.4.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
scheme.h
Go to the documentation of this file.
1
11#ifndef ADA_SCHEME_H
12#define ADA_SCHEME_H
13
14#include "ada/common_defs.h"
15
16#include <string>
17
25namespace ada::scheme {
26
41enum type : uint8_t {
42 HTTP = 0,
44 HTTPS = 2,
45 WS = 3,
46 FTP = 4,
47 WSS = 5,
48 FILE = 6
49};
50
57ada_really_inline constexpr bool is_special(std::string_view scheme);
58
65constexpr uint16_t get_special_port(std::string_view scheme) noexcept;
66
73constexpr uint16_t get_special_port(ada::scheme::type type) noexcept;
74
80constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept;
81
82} // namespace ada::scheme
83
84#endif // ADA_SCHEME_H
Cross-platform compiler macros and common definitions.
#define ada_really_inline
Definition common_defs.h:85
URL scheme utilities and constants.
Definition scheme-inl.h:10
constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept
Definition scheme-inl.h:72
type
Enumeration of URL scheme types.
Definition scheme.h:41
@ NOT_SPECIAL
Definition scheme.h:43
constexpr uint16_t get_special_port(std::string_view scheme) noexcept
Definition scheme-inl.h:57