Ada 2.9.2
Fast spec-compliant URL parser
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 <optional>
13
22namespace ada::unicode {
23
65bool to_ascii(std::optional<std::string>& out, std::string_view plain,
66 size_t first_percent);
67
75ada_really_inline bool has_tabs_or_newline(
76 std::string_view user_input) noexcept;
77
83ada_really_inline constexpr bool is_forbidden_host_code_point(char c) noexcept;
84
91 const char* input, size_t length) noexcept;
92
100ada_really_inline constexpr uint8_t
101contains_forbidden_domain_code_point_or_upper(const char* input,
102 size_t length) noexcept;
103
109ada_really_inline constexpr bool is_forbidden_domain_code_point(
110 char c) noexcept;
111
116ada_really_inline constexpr bool is_alnum_plus(char c) noexcept;
117
125ada_really_inline constexpr bool is_ascii_hex_digit(char c) noexcept;
126
135ada_really_inline constexpr bool is_c0_control_or_space(char c) noexcept;
136
143ada_really_inline constexpr bool is_ascii_tab_or_newline(char c) noexcept;
144
150ada_really_inline constexpr bool is_double_dot_path_segment(
151 std::string_view input) noexcept;
152
158ada_really_inline constexpr bool is_single_dot_path_segment(
159 std::string_view input) noexcept;
160
165ada_really_inline constexpr bool is_lowercase_hex(char c) noexcept;
166
172ada_really_inline unsigned constexpr convert_hex_to_binary(char c) noexcept;
173
183std::string percent_decode(std::string_view input, size_t first_percent);
184
190std::string percent_encode(std::string_view input,
191 const uint8_t character_set[]);
198std::string percent_encode(std::string_view input,
199 const uint8_t character_set[], size_t index);
208template <bool append>
209bool percent_encode(std::string_view input, const uint8_t character_set[],
210 std::string& out);
216ada_really_inline size_t percent_encode_index(std::string_view input,
217 const uint8_t character_set[]);
223constexpr bool to_lower_ascii(char* input, size_t length) noexcept;
224} // namespace ada::unicode
225
226#endif // ADA_UNICODE_H
Common definitions for cross-platform compiler support.
#define ada_really_inline
Definition common_defs.h:77
std::string to_ascii(std::string_view ut8_string)
bool contains_forbidden_domain_code_point(std::string_view ascii_string)
Includes the declarations for unicode operations.
ada_really_inline size_t percent_encode_index(const std::string_view input, const uint8_t character_set[])
Definition unicode-inl.h:19