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
72size_t strToUTF16(_In_opt_ strref s, _Out_writes_opt_(wsz) uint16* _Nullable buf, size_t wsz);
73
91_Ret_opt_valid_ uint16* _Nullable strToUTF16A(_In_opt_ strref s);
92
112_Ret_opt_valid_ uint16* _Nullable strToUTF16S(_In_opt_ strref s);
113
135bool strFromUTF16(_Inout_ strhandle o, _In_reads_(wsz) const uint16* _Nonnull buf, size_t wsz);
136
157bool strB64Encode(_Inout_ strhandle out, _In_reads_bytes_(sz) const uint8* _Nonnull buf, uint32 sz,
158 bool urlsafe);
159
181uint32 strB64Decode(_In_opt_ strref s, _Out_writes_bytes_opt_(sz) uint8* _Nullable buf, uint32 sz);
182
184
185CX_C_END
string * strhandle
Pointer to a string variable.
Definition strbase.h:45
bool strValidUTF8(strref s)
bool strValidASCII(strref s)
uint16 * strToUTF16A(strref s)
uint16 * strToUTF16S(strref s)
uint32 strB64Decode(strref s, _Out_writes_bytes_opt_(sz) uint8 *buf, uint32 sz)
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 strFromUTF16(strhandle o, _In_reads_(wsz) const uint16 *buf, size_t wsz)
Core string types and fundamental operations.