Struct in stdx_string.h

XWStrview

typedef struct{
  const wchar_t *ptr;
  size_t length;
}XWStrview;
Function in stdx_string.h

x_wslice_cmp

Lexicographically compares two wide string views.

X_STRING_API int32_t x_wslice_cmp(
 XWStrview a,
 XWStrview b
);

Parameters

XWStrview a
First input view or string.
XWStrview b
Second input view or string.

Returns

Function-specific integer result.

Function in stdx_string.h

x_wslice_empty

Checks whether the wide string view is empty.

X_STRING_API bool x_wslice_empty(XWStrview sv);

Parameters

XWStrview sv
String view input.

Returns

Function-specific result.

Function in stdx_string.h

x_wslice_eq

Compares two wide string views for equality.

X_STRING_API bool x_wslice_eq(
 XWStrview a,
 XWStrview b
);

Parameters

XWStrview a
First input view or string.
XWStrview b
Second input view or string.

Returns

true if the condition holds; false otherwise.

Macro in stdx_string.h

x_wslice_init

#define x_wslice_init(cstr, len) ((XWStrview){.ptr=(cstr), .length=(len)})
Function in stdx_string.h

x_wslice_next_token

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
);

Parameters

XWStrview *input
Parameter.
wchar_t delim
Parameter.
XWStrview *token
Output: extracted token.

Returns

Function-specific result.

Function in stdx_string.h

x_wslice_split_at

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
);

Parameters

XWStrview sv
String view input.
uint32_t delim
Delimiter character or codepoint.
XWStrview *left
Output: left side view.
XWStrview *right
Output: right side view.

Returns

Function-specific result.

Function in stdx_string.h

x_wslice_substr

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
);

Parameters

XWStrview sv
String view input.
size_t start
Starting offset (0-based).
size_t len
Number of units to copy or inspect.

Returns

Resulting view after the operation.

Function in stdx_string.h

x_wslice_trim

Removes leading and trailing whitespace from a wide string view.

X_STRING_API XWStrview x_wslice_trim(XWStrview sv);

Parameters

XWStrview sv
String view input.

Returns

Function-specific result.

Function in stdx_string.h

x_wslice_trim_left

Removes leading whitespace from a wide string view.

X_STRING_API XWStrview x_wslice_trim_left(XWStrview sv);

Parameters

XWStrview sv
String view input.

Returns

Function-specific result.

Function in stdx_string.h

x_wslice_trim_right

Removes trailing whitespace from a wide string view.

X_STRING_API XWStrview x_wslice_trim_right(XWStrview sv);

Parameters

XWStrview sv
String view input.

Returns

Resulting view after the operation.