summaryrefslogtreecommitdiffhomepage
path: root/docs/cstr_api.md
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-08-17 04:37:22 +0200
committerTyge Lovset <[email protected]>2023-08-17 04:37:22 +0200
commit2ba238e66efec7b6d895425c4f1160b3b72d242b (patch)
treed7c4a8946b92a9eea8aee296e0a58f71a292816b /docs/cstr_api.md
parent3da201d122a47f7bf6381b23702815474d64c471 (diff)
downloadSTC-modified-2ba238e66efec7b6d895425c4f1160b3b72d242b.tar.gz
STC-modified-2ba238e66efec7b6d895425c4f1160b3b72d242b.zip
Small refactoring.
Diffstat (limited to 'docs/cstr_api.md')
-rw-r--r--docs/cstr_api.md12
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 39bd4e94..bcb0d172 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -1,11 +1,17 @@
# STC [cstr](../include/stc/cstr.h): String
![String](pics/string.jpg)
-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.
+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.
+**cstr** has basic support for *UTF8* encoded strings, and has a set of compact and
+efficient functions for handling case-conversion, iteration and indexing into UTF8
+codepoints.
-**cstr** uses short strings optimization (sso), which eliminates heap memory allocation for string capacity less than 24 bytes. `sizeof(cstr)` is also 24. In comparison, c++ `sizeof(std::string)` is typically 32, but sso capacity is only 15 bytes.
+**cstr** uses short strings optimization (sso), which eliminates heap memory allocation
+for string capacity up to 22 bytes. `sizeof(cstr)` is 24. In comparison, C++
+`sizeof(std::string)` is typically 32, but sso capacity is only 15 bytes.
## Header file