CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
strencoding.h
1#pragma once
2
3#include <cx/string/strbase.h>
4
13
14CX_C_BEGIN
15
31_When_(s == NULL, _Post_equal_to_(false)) bool strValidUTF8(_In_opt_ strref s);
32
48_When_(s == NULL, _Post_equal_to_(false)) bool strValidASCII(_In_opt_ strref s);
49
66uint32 strU8Len(_In_opt_ strref s);
67
88int32 strU8Offset(_In_opt_ strref s, int32 charIdx);
89
114bool strSanitizeUTF8(_Inout_ strhandle o, _In_opt_ strref s);
115
138bool strSubStrU8(_Inout_ strhandle o, _In_opt_ strref s, int32 b, int32 e);
139
162size_t strToUTF16(_In_opt_ strref s, _Out_writes_opt_(wsz) uint16* _Nullable buf, size_t wsz);
163
181_Ret_opt_valid_ uint16* _Nullable strToUTF16A(_In_opt_ strref s);
182
202_Ret_opt_valid_ uint16* _Nullable strToUTF16S(_In_opt_ strref s);
203
225bool strFromUTF16(_Inout_ strhandle o, _In_reads_(wsz) const uint16* _Nonnull buf, size_t wsz);
226
247bool strB64Encode(_Inout_ strhandle out, _In_reads_bytes_(sz) const uint8* _Nonnull buf, uint32 sz,
248 bool urlsafe);
249
271uint32 strB64Decode(_In_opt_ strref s, _Out_writes_bytes_opt_(sz) uint8* _Nullable buf, uint32 sz);
272
293bool strHexEncode(_Inout_ strhandle out, _In_reads_bytes_(sz) const uint8* _Nonnull buf, uint32 sz,
294 bool upper);
295
318uint32 strHexDecode(_In_opt_ strref s, _Out_writes_bytes_opt_(sz) uint8* _Nullable buf, uint32 sz);
319
321
322CX_C_END
string * strhandle
Pointer to a string variable.
Definition strbase.h:64
uint32 strU8Len(strref s)
bool strValidUTF8(strref s)
bool strValidASCII(strref s)
uint16 * strToUTF16A(strref s)
uint16 * strToUTF16S(strref s)
uint32 strHexDecode(strref s, _Out_writes_bytes_opt_(sz) uint8 *buf, uint32 sz)
uint32 strB64Decode(strref s, _Out_writes_bytes_opt_(sz) uint8 *buf, uint32 sz)
bool strHexEncode(strhandle out, const uint8 *buf, uint32 sz, bool upper)
size_t strToUTF16(strref s, _Out_writes_opt_(wsz) uint16 *buf, size_t wsz)
bool strB64Encode(strhandle out, const uint8 *buf, uint32 sz, bool urlsafe)
bool strSanitizeUTF8(strhandle o, strref s)
bool strSubStrU8(strhandle o, strref s, int32 b, int32 e)
int32 strU8Offset(strref s, int32 charIdx)
bool strFromUTF16(strhandle o, _In_reads_(wsz) const uint16 *buf, size_t wsz)
Core string types and fundamental operations.