src/ucx/string.h

branch
constsstr
changeset 300
d1f814633049
parent 288
6af5798342e8
child 306
90b6d69bb499
equal deleted inserted replaced
288:6af5798342e8 300:d1f814633049
182 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>- 182 * The sstr_t.ptr of the return value will <i>always</i> be <code>NULL</code>-
183 * terminated. 183 * terminated.
184 * 184 *
185 * @param count the total number of strings to concatenate 185 * @param count the total number of strings to concatenate
186 * @param s1 first string 186 * @param s1 first string
187 * @param s2 second string
188 * @param ... all remaining strings 187 * @param ... all remaining strings
189 * @return the concatenated string 188 * @return the concatenated string
190 */ 189 */
191 sstr_t ucx_strcat(size_t count, scstr_t s1, ...); 190 sstr_t ucx_strcat(size_t count, scstr_t s1, ...);
192 191
198 * See sstrcat() for details. 197 * See sstrcat() for details.
199 * 198 *
200 * @param a the allocator to use 199 * @param a the allocator to use
201 * @param count the total number of strings to concatenate 200 * @param count the total number of strings to concatenate
202 * @param s1 first string 201 * @param s1 first string
203 * @param s2 second string
204 * @param ... all remaining strings 202 * @param ... all remaining strings
205 * @return the concatenated string 203 * @return the concatenated string
206 */ 204 */
207 sstr_t ucx_strcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...); 205 sstr_t ucx_strcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...);
208 206
240 * @see sstrsubs() 238 * @see sstrsubs()
241 * @see sstrchr() 239 * @see sstrchr()
242 */ 240 */
243 sstr_t sstrsubsl(sstr_t string, size_t start, size_t length); 241 sstr_t sstrsubsl(sstr_t string, size_t start, size_t length);
244 242
243 scstr_t scstrsubs(scstr_t s, size_t start);
244 scstr_t scstrsubsl(scstr_t string, size_t start, size_t length);
245
246
247 int ucx_strchr(const char *string, size_t length, int chr, size_t *pos);
248 int ucx_strrchr(const char *string, size_t length, int chr, size_t *pos);
249
245 /** 250 /**
246 * Returns a substring starting at the location of the first occurrence of the 251 * Returns a substring starting at the location of the first occurrence of the
247 * specified character. 252 * specified character.
248 * 253 *
249 * If the string does not contain the character, an empty string is returned. 254 * If the string does not contain the character, an empty string is returned.
268 * 273 *
269 * @see sstrsubs() 274 * @see sstrsubs()
270 */ 275 */
271 sstr_t sstrrchr(sstr_t string, int chr); 276 sstr_t sstrrchr(sstr_t string, int chr);
272 277
278
279 scstr_t scstrchr(scstr_t string, int chr);
280 scstr_t scstrrchr(scstr_t string, int chr);
273 281
274 const char* ucx_strstr( 282 const char* ucx_strstr(
275 const char *str, 283 const char *str,
276 size_t length, 284 size_t length,
277 const char *match, 285 const char *match,

mercurial