Structs

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

Functions

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.

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.

Frees memory allocated by nstd_str_concat. Parameters: const char **str - The string.

Calculates a string’s length. Parameters: const char *const str - The string. Returns: NSTDUSize len - The length of the string.

Creates an NSTDSlice from an NSTDString. Parameters: const NSTDString *const string - The string. Returns: NSTDSlice slice - The new slice.

Creates a string view from an NSTDString. Parameters: const NSTDString *const string - The string. Returns: NSTDStr str - The new string view.

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.

Extends an NSTDString by an NSTDSlice of NSTDUnichars. Parameters: NSTDString *const string - The string. const NSTDSlice chars - NSTDSlice of NSTDUnichars.

Frees an NSTDString instance. Parameters: NSTDString *const string - Pointer to a string. Returns: int errc - Nonzero on error.

Creates a new NSTDString from a raw C string. Parameters: const char *const cstr - The C string. Returns: NSTDString string - The new NSTD string.

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.

Creates a new NSTDString instance. Returns: NSTDString string - The new string.

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.

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.