Standard library header <wchar.h> (C95)
From cppreference.net
此头文件属于 null-terminated wide strings 库的一部分。
目录 |
函数
转换为数值格式 |
|
|
(C95)
(C99)
|
将宽字符串转换为整数值
(函数) |
|
(C95)
(C99)
|
将宽字符串转换为无符号整数值
(函数) |
|
(C99)
(C95)
(C99)
|
将宽字符串转换为浮点数值
(函数) |
字符串操作 |
|
|
(C95)
(C11)
|
将一个宽字符串复制到另一个
(函数) |
|
(C95)
(C11)
|
将指定数量的宽字符从一个字符串复制到另一个字符串
(函数) |
|
(C95)
(C11)
|
将一个宽字符串的副本追加到另一个宽字符串
(函数) |
|
(C95)
(C11)
|
将一个宽字符串的指定数量宽字符追加到另一个宽字符串
(函数) |
|
(C95)
|
转换宽字符串,使得
wcscmp
与
wcscoll
产生相同结果
(函数) |
字符串检查 |
|
|
(C95)
(C11)
|
返回宽字符串的长度
(函数) |
|
(C95)
|
比较两个宽字符串
(函数) |
|
(C95)
|
比较两个宽字符串中的指定数量字符
(函数) |
|
(C95)
|
根据当前区域设置比较两个宽字符串
(函数) |
|
(C95)
|
在宽字符串中查找宽字符的首次出现
(函数) |
|
(C95)
|
在宽字符串中查找宽字符的最后一次出现
(函数) |
|
(C95)
|
返回仅由另一宽字符串中找到的宽字符
组成的最大起始段的长度 (函数) |
|
(C95)
|
返回仅包含不在另一个宽字符串中的宽字符的
最大起始段的长度 (函数) |
|
(C95)
|
在另一个宽字符串中查找第一个出现在指定宽字符串中的宽字符位置
(函数) |
|
(C95)
|
在另一个宽字符串中查找第一个匹配的宽字符串
(函数) |
|
(C95)
(C11)
|
在宽字符串中查找下一个令牌
(函数) |
宽字符数组操作 |
|
|
(C95)
(C11)
|
在两个非重叠数组之间复制指定数量的宽字符
(函数) |
|
(C95)
(C11)
|
在两个可能重叠的数组之间复制指定数量的宽字符
(函数) |
|
(C95)
|
比较两个数组中的指定数量的宽字符
(函数) |
|
(C95)
|
在宽字符数组中查找宽字符的首次出现
(函数) |
|
(C95)
|
将给定的宽字符复制到宽字符数组的每个位置
(函数) |
类型
|
wchar_t
|
能够容纳任何有效宽字符的整数类型
(类型定义) |
|
wint_t
(C95)
|
能够容纳任何有效宽字符及至少一个额外值的整数类型
(类型定义) |
宏
|
WEOF
(C95)
|
类型为
wint_t
的非字符值,用于指示错误
(宏常量) |
|
WCHAR_MIN
(C95)
|
wchar_t
的最小有效值
(宏常量) |
|
WCHAR_MAX
(C95)
|
wchar_t
的最大有效值
(宏常量) |
概要
#define __STDC_VERSION_WCHAR_H__ 202311L typedef /* 查看描述 */ wchar_t; typedef /* 查看描述 */ size_t; typedef /* 参见描述 */ mbstate_t; typedef /* 查看描述 */ wint_t; struct tm { /* 参见描述 */ }; #define MB_UTF16 /* 参见描述 */ #define MB_UTF32 /* 参见描述 */ #define MB_UTF8 /* 参见描述 */ #define NULL /* 查看描述 */ #define WCHAR_MAX /* 查看描述 */ #define WCHAR_MIN /* see description */ #define WCHAR_UTF16 /* 查看描述 */ #define WCHAR_UTF32 /* 查看描述 */ #define WCHAR_UTF8 /* 查看描述 */ #define WCHAR_WIDTH /* 见描述 */ #define WEOF /* 参见描述 */ int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); int vwprintf(const wchar_t* restrict format, va_list arg); int vwscanf(const wchar_t* restrict format, va_list arg); int wprintf(const wchar_t* restrict format, ...); int wscanf(const wchar_t* restrict format, ...); wint_t fgetwc(FILE* stream); wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); wint_t fputwc(wchar_t c, FILE* stream); int fputws(const wchar_t* restrict s, FILE* restrict stream); int fwide(FILE* stream, int mode); wint_t getwc(FILE* stream); wint_t getwchar(void); wint_t putwc(wchar_t c, FILE* stream); wint_t putwchar(wchar_t c); wint_t ungetwc(wint_t c, FILE* stream); double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); long int wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); long long int wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); unsigned long int wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); unsigned long long int wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); int wcscmp(const wchar_t* s1, const wchar_t* s2); int wcscoll(const wchar_t* s1, const wchar_t* s2); int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n); /*QWchar_t*/* wcschr(/*QWchar_t*/* s, wchar_t c); size_t wcscspn(const wchar_t* s1, const wchar_t* s2); /*QWchar_t*/* wcspbrk(/*QWchar_t*/* s1, const wchar_t* s2); /*QWchar_t*/* wcsrchr(/*QWchar_t*/* s, wchar_t c); size_t wcsspn(const wchar_t* s1, const wchar_t* s2); /*QWchar_t*/* wcsstr(/*QWchar_t*/* s1, const wchar_t* s2); wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); /*QWchar_t*/* wmemchr(/*QWchar_t*/* s, wchar_t c, size_t n); size_t wcslen(const wchar_t* s); size_t wcsnlen(const wchar_t* s, size_t n); wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, const struct tm* restrict timeptr); wint_t btowc(int c); int wctob(wint_t c); int mbsinit(const mbstate_t* ps); size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, mbstate_t* restrict ps); size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, mbstate_t* restrict ps);
仅当实现定义了 __STDC_IEC_60559_DFP__ 时:
_Decimal32 wcstod32(const wchar_t* restrict nptr, wchar_t** restrict endptr); _Decimal64 wcstod64(const wchar_t* restrict nptr, wchar_t** restrict endptr); _Decimal128 wcstod128(const wchar_t* restrict nptr, wchar_t** restrict endptr);
仅当实现定义了 __STDC_IEC_60559_TYPES__ 且用户代码在包含 <wchar.h> 之前定义了 __STDC_WANT_IEC_60559_TYPES_EXT__ 时:
#ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ /*_FloatN*/ /*wcstofN*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_FloatNx*/ /*wcstofNx*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_DecimalN*/ /*wcstodN*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_DecimalNx*/ /*wcstodNx*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencfN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencdecdN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencbindN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); #endif
仅当实现定义了 __STDC_LIB_EXT1__ 且用户代码在包含 <wchar.h> 之前额外定义了 __STDC_WANT_LIB_EXT1__ 时:
#ifdef __STDC_WANT_LIB_EXT1__ typedef /* 详见描述 */ errno_t; typedef /* 详见描述 */ rsize_t; int fwprintf_s(FILE* restrict stream, const wchar_t* restrict format, ...); int fwscanf_s(FILE* restrict stream, const wchar_t* restrict format, ...); int snwprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, ...); int swprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, ...); int swscanf_s(const wchar_t* restrict s, const wchar_t* restrict format, ...); int vfwprintf_s(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vfwscanf_s(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vsnwprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, va_list arg); int vswprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, va_list arg); int vswscanf_s(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); int vwprintf_s(const wchar_t* restrict format, va_list arg); int vwscanf_s(const wchar_t* restrict format, va_list arg); int wprintf_s(const wchar_t* restrict format, ...); int wscanf_s(const wchar_t* restrict format, ...); errno_t wcscpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2); errno_t wcsncpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); errno_t wmemcpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); errno_t wmemmove_s(wchar_t* s1, rsize_t s1max, const wchar_t* s2, rsize_t n); errno_t wcscat_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2); errno_t wcsncat_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); wchar_t* wcstok_s(wchar_t* restrict s1, rsize_t* restrict s1max, const wchar_t* restrict s2, wchar_t** restrict ptr); size_t wcsnlen_s(const wchar_t* s, size_t maxsize); errno_t wcrtomb_s(size_t* restrict retval, char* restrict s, rsize_t smax, wchar_t wc, mbstate_t* restrict ps); errno_t mbsrtowcs_s(size_t* restrict retval, wchar_t* restrict dst, rsize_t dstmax, const char** restrict src, rsize_t len, mbstate_t* restrict ps); errno_t wcsrtombs_s(size_t* restrict retval, char* restrict dst, rsize_t dstmax, const wchar_t** restrict src, rsize_t len, mbstate_t* restrict ps); #endif