| |
1 # String |
| |
2 |
| |
3 <warning> |
| |
4 Outdated - Rewrite! |
| |
5 </warning> |
| |
6 |
| |
7 UCX strings come in two variants: immutable (`cxstring`) and mutable (`cxmutstr`). |
| |
8 The functions of UCX are designed to work with immutable strings by default but in situations where it is necessary, |
| |
9 the API also provides alternative functions that work directly with mutable strings. |
| |
10 Functions that change a string in-place are, of course, only accepting mutable strings. |
| |
11 |
| |
12 When you are using UCX functions, or defining your own functions, you are sometimes facing the "problem", |
| |
13 that the function only accepts arguments of type `cxstring` but you only have a `cxmutstr` at hand. |
| |
14 In this case you _should not_ introduce a wrapper function that accepts the `cxmutstr`, |
| |
15 but instead you should use the `cx_strcast()` function to cast the argument to the correct type. |
| |
16 |
| |
17 In general, UCX strings are **not** necessarily zero-terminated. If a function guarantees to return zero-terminated |
| |
18 string, it is explicitly mentioned in the documentation of the respective function. |
| |
19 As a rule of thumb, you _should not_ pass the strings of a UCX string structure to another API without explicitly |
| |
20 ensuring that the string is zero-terminated. |
| |
21 |
| |
22 ## Basics |
| |
23 |
| |
24 ### cx_mutstr |
| |
25 ### cx_mutstrn |
| |
26 ### cx_str |
| |
27 ### cx_strn |
| |
28 ### cx_strcast |
| |
29 ### cx_strfree |
| |
30 ### cx_strfree_a |
| |
31 ### cx_strdup |
| |
32 ### cx_strdup_a |
| |
33 ### cx_strlen |
| |
34 ### cx_strtrim |
| |
35 ### cx_strtrim_m |
| |
36 ### cx_strlower |
| |
37 ### cx_strupper |
| |
38 |
| |
39 ## Comparison |
| |
40 |
| |
41 ### cx_strcmp |
| |
42 ### cx_strcmp_p |
| |
43 ### cx_strcasecmp |
| |
44 ### cx_strcasecmp_p |
| |
45 ### cx_strprefix |
| |
46 ### cx_strsuffix |
| |
47 ### cx_strcaseprefix |
| |
48 ### cx_strcasesuffix |
| |
49 |
| |
50 ## Concatenation |
| |
51 |
| |
52 ### cx_strcat_ma |
| |
53 |
| |
54 ## Find Characters and Substrings |
| |
55 |
| |
56 ### cx_strchr |
| |
57 ### cx_strchr_m |
| |
58 ### cx_strrchr |
| |
59 ### cx_strrchr_m |
| |
60 ### cx_strstr |
| |
61 ### cx_strstr_m |
| |
62 ### cx_strsubs |
| |
63 ### cx_strsubsl |
| |
64 ### cx_strsubsl_m |
| |
65 ### cx_strsubs_m |
| |
66 |
| |
67 ## Replace Substrings |
| |
68 |
| |
69 ### cx_strreplacen_a |
| |
70 |
| |
71 ## Basic Splitting |
| |
72 |
| |
73 ### cx_strsplit |
| |
74 ### cx_strsplit_a |
| |
75 ### cx_strsplit_m |
| |
76 ### cx_strsplit_ma |
| |
77 |
| |
78 ## Complex Tokenization |
| |
79 |
| |
80 ### cx_strtok_ |
| |
81 ### cx_strtok_delim |
| |
82 ### cx_strtok_next |
| |
83 ### cx_strtok_next_m |
| |
84 |
| |
85 ## Conversion to Numbers |
| |
86 |
| |
87 ### cx_strtod_lc_ |
| |
88 ### cx_strtof_lc_ |
| |
89 ### cx_strtoi16_lc_ |
| |
90 ### cx_strtoi32_lc_ |
| |
91 ### cx_strtoi64_lc_ |
| |
92 ### cx_strtoi8_lc_ |
| |
93 ### cx_strtoi_lc_ |
| |
94 ### cx_strtol_lc |
| |
95 ### cx_strtoll_lc |
| |
96 ### cx_strtos_lc |
| |
97 ### cx_strtou16_lc |
| |
98 ### cx_strtou32_lc |
| |
99 ### cx_strtou64_lc |
| |
100 ### cx_strtou8_lc |
| |
101 ### cx_strtou_lc |
| |
102 ### cx_strtoul_lc |
| |
103 ### cx_strtoull_lc |
| |
104 ### cx_strtous_lc |
| |
105 ### cx_strtouz_lc |
| |
106 ### cx_strtoz_lc |