Ada 4.1.1
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 <cstdint>
17#include <string>
18#include <string_view>
19
27namespace ada::scheme {
28
43enum type : uint8_t {
44 HTTP = 0,
46 HTTPS = 2,
47 WS = 3,
48 FTP = 4,
49 WSS = 5,
50 FILE = 6
51};
52
59ada_really_inline constexpr bool is_special(std::string_view scheme);
60
67constexpr uint16_t get_special_port(std::string_view scheme) noexcept;
68
75constexpr uint16_t get_special_port(ada::scheme::type type) noexcept;
76
82constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept;
83
84} // namespace ada::scheme
85
86#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:14
constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept
Definition scheme-inl.h:111
type
Enumeration of URL scheme types.
Definition scheme.h:43
@ NOT_SPECIAL
Definition scheme.h:45
constexpr uint16_t get_special_port(std::string_view scheme) noexcept
Definition scheme-inl.h:94