Whole-string operations built on the UTF-8 rune primitives in sys/rune.h. More...


Go to the source code of this file.
Functions | |
| size_t | sys_string_bytes (const char *str) |
| Return the length of a null-terminated string, in bytes. More... | |
| size_t | sys_string_runes (const char *str) |
| Count the runes in a null-terminated UTF-8 string. More... | |
| ptrdiff_t | sys_string_compare (const char *a, const char *b) |
| Compare two null-terminated strings byte by byte. More... | |
| char * | sys_string_to_upper (char *str) |
| Convert a string to uppercase in place. More... | |
| char * | sys_string_to_lower (char *str) |
| Convert a string to lowercase in place. More... | |
| char * | sys_string_trimspace (char *str) |
| Trim leading and trailing whitespace from a string in place. More... | |
| char * | sys_string_trimprefix (char *s, const char *prefix) |
| Remove prefix from the start of s, if present. More... | |
| char * | sys_string_trimsuffix (char *s, const char *suffix) |
| Remove suffix from the end of s, if present. More... | |
| bool | sys_string_hasprefix (const char *s, const char *prefix) |
| Reports whether s begins with prefix. More... | |
| bool | sys_string_hassuffix (const char *s, const char *suffix) |
| Reports whether s ends with suffix. More... | |
| ptrdiff_t | sys_string_contains (const char *s, const char *substr) |
| Find the first byte offset where substr occurs within s. More... | |
| sys_iostream_t * | sys_string_read (const char *str) |
| Wrap a string in a read-only stream. More... | |
| bool | sys_string_parse_escape (const char *str, size_t len, rune_t *rune) |
| Decode a JSON-style backslash escape sequence into the rune it denotes. More... | |
| bool | sys_string_parse_bool (const char *str, bool *out) |
| Parse "true" or "false" into a bool. More... | |
| ptrdiff_t | sys_string_parse_quoted (const char *str, size_t len, char *out, size_t cap) |
| Decode a quoted string into its unescaped content. More... | |
| bool | sys_string_parse_int32 (const char *str, size_t len, int32_t *value) |
| Parse a signed 32-bit integer. More... | |
| bool | sys_string_parse_int64 (const char *str, size_t len, int64_t *value) |
| Parse a signed 64-bit integer. More... | |
| bool | sys_string_parse_uint32 (const char *str, size_t len, uint32_t *value) |
| Parse an unsigned 32-bit integer. More... | |
| bool | sys_string_parse_uint64 (const char *str, size_t len, uint64_t *value) |
| Parse an unsigned 64-bit integer. More... | |
| bool | sys_string_parse_float32 (const char *str, size_t len, float *value) |
| Parse a 32-bit floating-point number. More... | |
| bool | sys_string_parse_float64 (const char *str, size_t len, double *value) |
| Parse a 64-bit floating-point number. More... | |
Whole-string operations built on the UTF-8 rune primitives in sys/rune.h.
Definition in file string.h.