XWSmallstr
typedef struct{
wchar_t buf[X_SMALLSTR_MAX_LENGTH+1];
size_t length;
}XWSmallstr;
typedef struct{
wchar_t buf[X_SMALLSTR_MAX_LENGTH+1];
size_t length;
}XWSmallstr;
Appends a wide C-string if space allows.
X_STRING_API int32_t x_wsmallstr_append(
XWSmallstr *s,
const wchar_t *tail
);
XWSmallstr *sconst wchar_t *tailFunction-specific integer result.
Clears the wide small string to empty.
X_STRING_API void x_wsmallstr_clear(XWSmallstr *s);
XWSmallstr *sNo return value.
Compares two wide small strings.
X_STRING_API int32_t x_wsmallstr_cmp(
const XWSmallstr *a,
const XWSmallstr *b
);
const XWSmallstr *aconst XWSmallstr *bNegative, zero, or positive according to lexicographic order.
Compares two wide small strings case-insensitively.
X_STRING_API int32_t x_wsmallstr_cmp_ci(
const XWSmallstr *a,
const XWSmallstr *b
);
const XWSmallstr *aconst XWSmallstr *bNegative, zero, or positive according to lexicographic order.
Compares a wide small string with a wide C-string.
X_STRING_API int32_t x_wsmallstr_cmp_cstr(
const XWSmallstr *a,
const wchar_t *b
);
const XWSmallstr *aconst wchar_t *bFunction-specific integer result.
Finds a wide character within a wide small string.
X_STRING_API int32_t x_wsmallstr_find(
const XWSmallstr *s,
wchar_t c
);
const XWSmallstr *swchar_t cIndex on success, or -1 if not found.
Initializes a wide-character small string from a wide C-string.
X_STRING_API int32_t x_wsmallstr_init(
XWSmallstr *s,
const wchar_t *src
);
XWSmallstr *sconst wchar_t *srcFunction-specific integer result.
Returns the current length (in wide characters).
X_STRING_API size_t x_wsmallstr_length(const XWSmallstr *s);
const XWSmallstr *sNumber of elements in the string (excluding the final terminator).
Copies a wide-character substring into a destination small string.
X_STRING_API int32_t x_wsmallstr_substring(
const XWSmallstr *s,
size_t start,
size_t len,
XWSmallstr *out
);
const XWSmallstr *ssize_t startsize_t lenXWSmallstr *outFunction-specific integer result.
Trims leading and trailing whitespace in a wide small string.
X_STRING_API void x_wsmallstr_trim(XWSmallstr *s);
XWSmallstr *sNo return value.