diff options
| author | Tyge Lovset <[email protected]> | 2023-08-17 04:37:22 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-08-17 04:37:22 +0200 |
| commit | 2ba238e66efec7b6d895425c4f1160b3b72d242b (patch) | |
| tree | d7c4a8946b92a9eea8aee296e0a58f71a292816b /docs/cstr_api.md | |
| parent | 3da201d122a47f7bf6381b23702815474d64c471 (diff) | |
| download | STC-modified-2ba238e66efec7b6d895425c4f1160b3b72d242b.tar.gz STC-modified-2ba238e66efec7b6d895425c4f1160b3b72d242b.zip | |
Small refactoring.
Diffstat (limited to 'docs/cstr_api.md')
| -rw-r--r-- | docs/cstr_api.md | 12 |
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  -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 |
