Ada
3.4.3
Fast spec-compliant URL parser
Toggle main menu visibility
Loading...
Searching...
No Matches
unicode.h
Go to the documentation of this file.
1
5
#ifndef ADA_UNICODE_H
6
#define ADA_UNICODE_H
7
8
#include "
ada/common_defs.h
"
9
#include "
ada/ada_idna.h
"
10
11
#include <string>
12
#include <string_view>
13
#include <optional>
14
23
namespace
ada::unicode
{
24
66
bool
to_ascii(std::optional<std::string>& out, std::string_view plain,
67
size_t
first_percent);
68
76
ada_really_inline
bool
has_tabs_or_newline(
77
std::string_view user_input)
noexcept
;
78
84
ada_really_inline
constexpr
bool
is_forbidden_host_code_point(
char
c)
noexcept
;
85
91
ada_really_inline
constexpr
bool
contains_forbidden_domain_code_point(
92
const
char
* input,
size_t
length)
noexcept
;
93
101
ada_really_inline
constexpr
uint8_t
102
contains_forbidden_domain_code_point_or_upper(
const
char
* input,
103
size_t
length)
noexcept
;
104
110
ada_really_inline
constexpr
bool
is_forbidden_domain_code_point(
111
char
c)
noexcept
;
112
117
ada_really_inline
constexpr
bool
is_alnum_plus(
char
c)
noexcept
;
118
126
ada_really_inline
constexpr
bool
is_ascii_hex_digit(
char
c)
noexcept
;
127
133
ada_really_inline
constexpr
bool
is_ascii_digit(
char
c)
noexcept
;
134
140
ada_really_inline
constexpr
bool
is_ascii(
char32_t
c)
noexcept
;
141
150
ada_really_inline
constexpr
bool
is_c0_control_or_space(
char
c)
noexcept
;
151
158
ada_really_inline
constexpr
bool
is_ascii_tab_or_newline(
char
c)
noexcept
;
159
165
ada_really_inline
constexpr
bool
is_double_dot_path_segment(
166
std::string_view input)
noexcept
;
167
173
ada_really_inline
constexpr
bool
is_single_dot_path_segment(
174
std::string_view input)
noexcept
;
175
180
ada_really_inline
constexpr
bool
is_lowercase_hex(
char
c)
noexcept
;
181
187
ada_really_inline
unsigned
constexpr
convert_hex_to_binary(
char
c)
noexcept
;
188
198
std::string percent_decode(std::string_view input,
size_t
first_percent);
199
205
std::string percent_encode(std::string_view input,
206
const
uint8_t character_set[]);
213
std::string percent_encode(std::string_view input,
214
const
uint8_t character_set[],
size_t
index);
223
template
<
bool
append>
224
bool
percent_encode(std::string_view input,
const
uint8_t character_set[],
225
std::string& out);
231
ada_really_inline
size_t
percent_encode_index
(std::string_view input,
232
const
uint8_t character_set[]);
238
constexpr
bool
to_lower_ascii(
char
* input,
size_t
length)
noexcept
;
239
}
// namespace ada::unicode
240
241
#endif
// ADA_UNICODE_H
ada_idna.h
common_defs.h
Cross-platform compiler macros and common definitions.
ada_really_inline
#define ada_really_inline
Definition
common_defs.h:85
ada::unicode
Includes the declarations for unicode operations.
ada::unicode::percent_encode_index
ada_really_inline size_t percent_encode_index(const std::string_view input, const uint8_t character_set[])
Definition
unicode-inl.h:19