Crate nstd_str

Source

Structs§

NSTDString
Represents a dynamic-sized array of UTF-8 chars.

Functions§

nstd_str_compare
Compares two strings. Parameters: const char *const str1 - The first string to compare. const char *const str2 - The second string to compare. Returns: int e - Nonzero if the two strings are lexicographically equal.
nstd_str_concat
Concatenates two strings. Parameters: const char *const str1 - The first string. const char *const str2 - The second string. Returns: char *str - The new string, null on error.
nstd_str_contains
nstd_str_contains_char
nstd_str_ends_with
nstd_str_ends_with_char
nstd_str_find
nstd_str_find_char
nstd_str_find_last
nstd_str_find_last_char
nstd_str_free_concat
Frees memory allocated by nstd_str_concat. Parameters: const char **str - The string.
nstd_str_len
Calculates a string’s length. Parameters: const char *const str - The string. Returns: NSTDUSize len - The length of the string.
nstd_str_starts_with
nstd_str_starts_with_char
nstd_str_string_as_slice
Creates an NSTDSlice from an NSTDString. Parameters: const NSTDString *const string - The string. Returns: NSTDSlice slice - The new slice.
nstd_str_string_as_str
Creates a string view from an NSTDString. Parameters: const NSTDString *const string - The string. Returns: NSTDStr str - The new string view.
nstd_str_string_byte_len
Returns the number of bytes used by this string. Parameters: const NSTDString *const string - The string. Returns: NSTDUSize len - The number of bytes in the string.
nstd_str_string_extend
Extends an NSTDString by an NSTDSlice of NSTDUnichars. Parameters: NSTDString *const string - The string. const NSTDSlice chars - NSTDSlice of NSTDUnichars.
nstd_str_string_free
Frees an NSTDString instance. Parameters: NSTDString *const string - Pointer to a string. Returns: int errc - Nonzero on error.
nstd_str_string_from_cstring
Creates a new NSTDString from a raw C string. Parameters: const char *const cstr - The C string. Returns: NSTDString string - The new NSTD string.
nstd_str_string_from_double
nstd_str_string_from_float
nstd_str_string_from_int
nstd_str_string_from_isize
nstd_str_string_from_long
nstd_str_string_from_longlong
nstd_str_string_from_schar
nstd_str_string_from_short
nstd_str_string_from_uchar
nstd_str_string_from_uint
nstd_str_string_from_ulong
nstd_str_string_from_ulonglong
nstd_str_string_from_ushort
nstd_str_string_from_usize
nstd_str_string_len
Gets the length of a string. Parameters: const NSTDString *const string - The string. Returns: NSTDUSize len - The length of the UTF-8 encoded string, -1 on error.
nstd_str_string_new
Creates a new NSTDString instance. Returns: NSTDString string - The new string.
nstd_str_string_pop
Removes an NSTDUnichar from the end of an NSTDString. Parameters: NSTDString *const string - The string. Returns: NSTDUnichar chr - The unichar that was popped off the string, fill char on error.
nstd_str_string_push
Pushes an NSTDUnichar to an NSTDString. Parameters: NSTDString *const string - The string. const NSTDUnichar chr - The unicode character to push to the string. Returns: int errc - Nonzero on error.
nstd_str_to_double
nstd_str_to_float
nstd_str_to_int
nstd_str_to_long
nstd_str_to_longlong
nstd_str_to_schar
nstd_str_to_short
nstd_str_to_uchar
nstd_str_to_uint
nstd_str_to_ulong
nstd_str_to_ulonglong
nstd_str_to_ushort