XWStrview
typedef struct{
const wchar_t *ptr;
size_t length;
}XWStrview;
typedef struct{
const wchar_t *ptr;
size_t length;
}XWStrview;
#define x_wslice(cstr) (x_wslice_init((cstr), wcslen(cstr)))
Lexicographically compares two wide string views.
X_STRING_API int32_t x_wslice_cmp(
XWStrview a,
XWStrview b
);
Function-specific integer result.
Checks whether the wide string view is empty.
X_STRING_API bool x_wslice_empty(XWStrview sv);
XWStrview svFunction-specific result.
Compares two wide string views for equality.
X_STRING_API bool x_wslice_eq(
XWStrview a,
XWStrview b
);
true if the condition holds; false otherwise.
#define x_wslice_init(cstr, len) ((XWStrview){.ptr=(cstr), .length=(len)})
Extracts the next token from a string view using the given delimiter.
X_STRING_API bool x_wslice_next_token(
XWStrview *input,
wchar_t delim,
XWStrview *token
);
Function-specific result.
Splits a wide string view at the first occurrence of a delimiter.
X_STRING_API bool x_wslice_split_at(
XWStrview sv,
uint32_t delim,
XWStrview *left,
XWStrview *right
);
Function-specific result.
Creates a sub-view by range from a wide string view.
X_STRING_API XWStrview x_wslice_substr(
XWStrview sv,
size_t start,
size_t len
);
XWStrview svsize_t startsize_t lenResulting view after the operation.
Removes leading and trailing whitespace from a wide string view.
X_STRING_API XWStrview x_wslice_trim(XWStrview sv);
XWStrview svFunction-specific result.
Removes leading whitespace from a wide string view.
X_STRING_API XWStrview x_wslice_trim_left(XWStrview sv);
XWStrview svFunction-specific result.
Removes trailing whitespace from a wide string view.
X_STRING_API XWStrview x_wslice_trim_right(XWStrview sv);
XWStrview svResulting view after the operation.