19 #ifndef IRCCD_JS_UNICODE_HPP
20 #define IRCCD_JS_UNICODE_HPP
31 #include <string_view>
44 void encode(char32_t point,
char res[5]) noexcept;
52 void decode(char32_t& c,
const char* res) noexcept;
81 auto length(std::string_view str) -> unsigned;
93 template <
typename Func>
94 void for_each(std::string_view str, Func
function)
96 for (
size_t i = 0; i < str.size(); ) {
101 throw std::invalid_argument(
"invalid sequence");
103 decode(point, str.data() + i);
117 auto to_utf8(std::u32string_view array) -> std::string;
126 auto to_utf32(std::string_view str) -> std::u32string;
182 auto toupper(char32_t c) noexcept -> char32_t;
190 auto tolower(char32_t c) noexcept -> char32_t;
198 auto totitle(char32_t c) noexcept -> char32_t;
206 auto toupper(std::u32string_view str) -> std::u32string;
215 auto toupper(std::string_view str) -> std::string;
223 auto tolower(std::u32string_view str) -> std::u32string;
232 auto tolower(std::string_view str) -> std::string;
Unicode namespace.
Definition: unicode.hpp:36
auto toupper(char32_t c) noexcept -> char32_t
auto isspace(char32_t c) noexcept -> bool
auto isupper(char32_t c) noexcept -> bool
auto to_utf32(std::string_view str) -> std::u32string
auto islower(char32_t c) noexcept -> bool
auto to_utf8(std::u32string_view array) -> std::string
auto istitle(char32_t c) noexcept -> bool
auto nbytes_utf8(char c) noexcept -> int
auto nbytes_point(char32_t point) noexcept -> int
void for_each(std::string_view str, Func function)
Definition: unicode.hpp:94
auto length(std::string_view str) -> unsigned
void decode(char32_t &c, const char *res) noexcept
void encode(char32_t point, char res[5]) noexcept
auto totitle(char32_t c) noexcept -> char32_t
auto isdigit(char32_t c) noexcept -> bool
auto tolower(char32_t c) noexcept -> char32_t
auto isalpha(char32_t c) noexcept -> bool