From f8727410e6c83a8390eb9a4812bd8831d07d49e4 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 23 Apr 2024 01:13:43 +0200 Subject: Add u8title() --- include/unicode/string.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/unicode/string.h b/include/unicode/string.h index 887a216..cb19821 100644 --- a/include/unicode/string.h +++ b/include/unicode/string.h @@ -6,6 +6,8 @@ #include "_charN_t.h" #include "_u8view.h" +#define mlib_warn_trunc nodiscard("don’t forget to check for truncation") + /* clang-format off */ enum [[clang::flag_enum]] caseflags { @@ -25,18 +27,20 @@ size_t u8gnext(struct u8view *, const char8_t **, size_t *); size_t u8wnext(struct u8view *, const char8_t **, size_t *); size_t u8wnext_human(struct u8view *, const char8_t **, size_t *); -#define mlib_warn_trunc nodiscard("don’t forget to check for truncation") [[mlib_warn_trunc]] size_t u8casefold(char8_t *restrict, size_t, const char8_t *, size_t, enum caseflags); [[mlib_warn_trunc]] size_t u8lower(char8_t *restrict, size_t, const char8_t *, size_t, enum caseflags); +[[mlib_warn_trunc]] size_t u8title(char8_t *restrict, size_t, const char8_t *, + size_t, enum caseflags); [[mlib_warn_trunc]] size_t u8upper(char8_t *restrict, size_t, const char8_t *, size_t, enum caseflags); -#undef mlib_warn_trunc -constexpr double U8LOWER_SCALE = 1.5; +constexpr double U8LOWER_SCALE = 1.5; constexpr double U8LOWER_SCALE_LT = 3; -constexpr double U8TITLE_SCALE = 3; -constexpr double U8UPPER_SCALE = 3; +constexpr double U8TITLE_SCALE = 3; +constexpr double U8UPPER_SCALE = 3; + +#undef mlib_warn_trunc #endif /* !MLIB_UNICODE_STRING_H */ -- cgit v1.2.3