docs/Writerside/topics/string.h.md

Sat, 25 Jan 2025 13:44:24 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 25 Jan 2025 13:44:24 +0100
branch
docs/3.1
changeset 1146
151c057faf7c
parent 1143
0559812df10c
permissions
-rw-r--r--

add marker to every incomplete page

relates to #451

1143
0559812df10c assign proper names to the documentation topics
Mike Becker <universe@uap-core.de>
parents: 1142
diff changeset
1 # String
1141
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
1146
151c057faf7c add marker to every incomplete page
Mike Becker <universe@uap-core.de>
parents: 1143
diff changeset
3 <warning>
151c057faf7c add marker to every incomplete page
Mike Becker <universe@uap-core.de>
parents: 1143
diff changeset
4 Outdated - Rewrite!
151c057faf7c add marker to every incomplete page
Mike Becker <universe@uap-core.de>
parents: 1143
diff changeset
5 </warning>
151c057faf7c add marker to every incomplete page
Mike Becker <universe@uap-core.de>
parents: 1143
diff changeset
6
1141
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 UCX strings come in two variants: immutable (`cxstring`) and mutable (`cxmutstr`).
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 The functions of UCX are designed to work with immutable strings by default but in situations where it is necessary,
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 the API also provides alternative functions that work directly with mutable strings.
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 Functions that change a string in-place are, of course, only accepting mutable strings.
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 When you are using UCX functions, or defining your own functions, you are sometimes facing the "problem",
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 that the function only accepts arguments of type `cxstring` but you only have a `cxmutstr` at hand.
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 In this case you _should not_ introduce a wrapper function that accepts the `cxmutstr`,
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 but instead you should use the `cx_strcast()` function to cast the argument to the correct type.
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 In general, UCX strings are **not** necessarily zero-terminated. If a function guarantees to return zero-terminated
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 string, it is explicitly mentioned in the documentation of the respective function.
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 As a rule of thumb, you _should not_ pass the strings of a UCX string structure to another API without explicitly
a06a2d27c043 create new page structure
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 ensuring that the string is zero-terminated.
1142
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
21
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
22 ## Undocumented Symbols (TODO)
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
23 ### cx_mutstr
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
24 ### cx_mutstrn
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
25 ### cx_str
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
26 ### cx_strcasecmp
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
27 ### cx_strcasecmp_p
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
28 ### cx_strcaseprefix
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
29 ### cx_strcasesuffix
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
30 ### cx_strcat_ma
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
31 ### cx_strchr
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
32 ### cx_strchr_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
33 ### cx_strcmp
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
34 ### cx_strcmp_p
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
35 ### cx_strdup_a_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
36 ### cx_strfree
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
37 ### cx_strfree_a
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
38 ### cx_strlen
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
39 ### cx_strlower
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
40 ### cx_strn
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
41 ### cx_strprefix
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
42 ### cx_strrchr
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
43 ### cx_strrchr_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
44 ### cx_strreplacen_a
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
45 ### cx_strsplit
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
46 ### cx_strsplit_a
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
47 ### cx_strsplit_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
48 ### cx_strsplit_ma
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
49 ### cx_strstr
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
50 ### cx_strstr_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
51 ### cx_strstr_sbo_size
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
52 ### cx_strsubs
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
53 ### cx_strsubsl
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
54 ### cx_strsubsl_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
55 ### cx_strsubs_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
56 ### cx_strsuffix
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
57 ### cx_strtod_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
58 ### cx_strtof_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
59 ### cx_strtoi16_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
60 ### cx_strtoi32_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
61 ### cx_strtoi64_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
62 ### cx_strtoi8_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
63 ### cx_strtoi_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
64 ### cx_strtok_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
65 ### cx_strtok_delim
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
66 ### cx_strtok_next
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
67 ### cx_strtok_next_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
68 ### cx_strtol_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
69 ### cx_strtoll_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
70 ### cx_strtos_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
71 ### cx_strtou16_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
72 ### cx_strtou32_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
73 ### cx_strtou64_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
74 ### cx_strtou8_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
75 ### cx_strtou_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
76 ### cx_strtoul_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
77 ### cx_strtoull_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
78 ### cx_strtous_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
79 ### cx_strtouz_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
80 ### cx_strtoz_lc_
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
81 ### cx_strtrim
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
82 ### cx_strtrim_m
9437530176bc add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents: 1141
diff changeset
83 ### cx_strupper

mercurial