From 89850ab10e2a247ccde994c1525c7a083d8d07e5 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:54:26 +0200 Subject: Update cstr_api.md --- docs/cstr_api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 24f51d32..71be7e67 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -3,6 +3,8 @@ A **cstr** object represent sequences of characters. It supports an interface similar to that of a standard container of bytes, but adding features specifically designed to operate with strings of single-byte characters, terminated by the null character. +**cstr** has basic support for *UTF8* encoded strings, and has a set of compact and efficient functions for handling case-foldings and comparisons of UTF strings. The **cstr** type uses short strings optimization (sso), which eliminates heap memory allocation for strings shorter than 24 bytes (sizeof(cstr) is also 24). + See the c++ class [std::basic_string](https://en.cppreference.com/w/cpp/string/basic_string) for a functional description. ## Header file @@ -50,7 +52,7 @@ cstr cstr_tolower(const cstr* self); // returns cstr cstr_toupper(const cstr* self); // returns new uppercase utf8 cstr void cstr_lowercase(cstr* self); // transform cstr to lowercase utf8 void cstr_uppercase(cstr* self); // transform cstr to uppercase utf8 -bool cstr_iequals(cstr s, const char* str); // case-insensitive comparison +bool cstr_iequals(cstr s, const char* str); // utf8 case-insensitive comparison bool cstr_istarts_with(cstr s, const char* str); // " bool cstr_iends_with(cstr s, const char* str); // " int cstr_icmp(const cstr* s1, const cstr* s2); // " -- cgit v1.2.3