aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-04-23 01:13:43 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-04-23 01:32:43 +0200
commitf8727410e6c83a8390eb9a4812bd8831d07d49e4 (patch)
treec9e1ed68de1346fc8285e9a956a792481d55d003 /include
parenta348937d08f3cc5bf94e07c3b888992f0033bca1 (diff)
Add u8title()
Diffstat (limited to 'include')
-rw-r--r--include/unicode/string.h14
1 files changed, 9 insertions, 5 deletions
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 */