summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-06-01 09:54:26 +0200
committerGitHub <[email protected]>2022-06-01 09:54:26 +0200
commit89850ab10e2a247ccde994c1525c7a083d8d07e5 (patch)
treeeffb4b6ed990f6440890ff52c9fb587005a8ce67 /docs
parentc25b6d39f4ebbc1785108fd248b67fe9e8c95e92 (diff)
downloadSTC-modified-89850ab10e2a247ccde994c1525c7a083d8d07e5.tar.gz
STC-modified-89850ab10e2a247ccde994c1525c7a083d8d07e5.zip
Update cstr_api.md
Diffstat (limited to 'docs')
-rw-r--r--docs/cstr_api.md4
1 files changed, 3 insertions, 1 deletions
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); // "