阅读:2585回复:7
宽字符处理函数函数与普通函数对照表宽字符处理函数函数与普通函数对照表 字符分类: 宽字符函数普通C函数描述 iswalnum() isalnum() 测试字符是否为数字或字母 iswalpha() isalpha() 测试字符是否是字母 iswcntrl() iscntrl() 测试字符是否是控制符 iswdigit() isdigit() 测试字符是否为数字 iswgraph() isgraph() 测试字符是否是可见字符 iswlower() islower() 测试字符是否是小写字符 iswprint() isprint() 测试字符是否是可打印字符 iswpunct() ispunct() 测试字符是否是标点符号 iswspace() isspace() 测试字符是否是空白符号 iswupper() isupper() 测试字符是否是大写字符 iswxdigit() isxdigit()测试字符是否是十六进制的数字 大小写转换: 宽字符函数普通C函数描述 towlower() tolower() 把字符转换为小写 towupper() toupper() 把字符转换为大写 字符比较: 宽字符函数普通C函数描述 wcscoll() strcoll() 比较字符串 日期和时间转换: 宽字符函数描述 strftime() 根据指定的字符串格式和locale设置格式化日期和时间 wcsftime() 根据指定的字符串格式和locale设置格式化日期和时间, 并返回宽字符串 strptime() 根据指定格式把字符串转换为时间值, 是strftime的反过程 打印和扫描字符串: 宽字符函数描述 fprintf()/fwprintf() 使用vararg参量的格式化输出 fscanf()/fwscanf() 格式化读入 printf() 使用vararg参量的格式化输出到标准输出 scanf() 从标准输入的格式化读入 sprintf()/swprintf() 根据vararg参量表格式化成字符串 sscanf() 以字符串作格式化读入 vfprintf()/vfwprintf() 使用stdarg参量表格式化输出到文件 vprintf() 使用stdarg参量表格式化输出到标准输出 vsprintf()/vswprintf() 格式化stdarg参量表并写到字符串 数字转换: 宽字符函数普通C函数描述 wcstod() strtod() 把宽字符的初始部分转换为双精度浮点数 wcstol() strtol() 把宽字符的初始部分转换为长整数 wcstoul() strtoul() 把宽字符的初始部分转换为无符号长整数 多字节字符和宽字符转换及操作: 宽字符函数描述 mblen() 根据locale的设置确定字符的字节数 mbstowcs() 把多字节字符串转换为宽字符串 mbtowc()/btowc()把多字节字符转换为宽字符 wcstombs() 把宽字符串转换为多字节字符串 wctomb()/wctob() 把宽字符转换为多字节字符 输入和输出: 宽字符函数普通C函数描述 fgetwc() fgetc() 从流中读入一个字符并转换为宽字符 fgetws() fgets() 从流中读入一个字符串并转换为宽字符串 fputwc() fputc() 把宽字符转换为多字节字符并且输出到标准输出 fputws() fputs() 把宽字符串转换为多字节字符并且输出到标准输出串 getwc() getc() 从标准输入中读取字符, 并且转换为宽字符 getwchar() getchar() 从标准输入中读取字符, 并且转换为宽字符 None gets() 使用fgetws() putwc() putc() 把宽字符转换成多字节字符并且写到标准输出 putwchar() putchar() 把宽字符转换成多字节字符并且写到标准输出 None puts() 使用fputws() ungetwc() ungetc() 把一个宽字符放回到输入流中 字符串操作: 宽字符函数普通C函数描述 wcscat() strcat() 把一个字符串接到另一个字符串的尾部 wcsncat() strncat() 类似于wcscat(), 而且指定粘接字符串的粘接长度. wcschr() strchr() 查找子字符串的第一个位置 wcsrchr() strrchr() 从尾部开始查找子字符串出现的第一个位置 wcspbrk() strpbrk() 从一字符字符串中查找另一字符串中任何一个字符第一次出现的位置 wcswcs()/wcsstr() strchr() 在一字符串中查找另一字符串第一次出现的位置 wcscspn() strcspn() 返回不包含第二个字符串的的初始数目 wcsspn() strspn() 返回包含第二个字符串的初始数目 wcscpy() strcpy() 拷贝字符串 wcsncpy() strncpy() 类似于wcscpy(), 同时指定拷贝的数目 wcscmp() strcmp() 比较两个宽字符串 wcsncmp() strncmp() 类似于wcscmp(), 还要指定比较字符字符串的数目 wcslen() strlen() 获得宽字符串的数目 wcstok() strtok() 根据标示符把宽字符串分解成一系列字符串 wcswidth() None 获得宽字符串的宽度 wcwidth() None 获得宽字符的宽度 另外还有对应于memory操作的 wmemcpy(), wmemchr(), wmemcmp(), wmemmove(), wmemset(). |
|
禁止发言
![]() |
沙发#
发布于:2007-09-07 00:31
用户被禁言,该主题自动屏蔽! |
板凳#
发布于:2007-09-05 17:47
ddk中有的
|
|
地板#
发布于:2007-09-05 17:38
很有用, 楼上的, 谢谢了!
应该是第三方的的库. 好像没有提供头文件与库文件下载. |
|
地下室#
发布于:2007-09-05 13:18
http://www.osronline.com/ddkx/kmarch/other_9bqf.htm
Summary of Kernel-Mode Safe String Functions The following table summarizes the safe string functions that are available to kernel-mode drivers, and it indicates the C/C++ language runtime library functions that they replace. If a function's name contains Cb, the function treats strings as byte-counted. If a function's name contains Cch, the function treats strings as character-counted. Functions Purpose Replaces RtlStringCbCat RtlStringCbCatEx RtlStringCchCat RtlStringCchCatEx Concatenate two strings. strcat wcscat RtlStringCbCatN RtlStringCbCatNEx RtlStringCchCatN RtlStringCchCatNEx Concatenate two byte-counted strings, while limiting the size of the appended string. strncat wcsncat RtlStringCbCopy RtlStringCbCopyEx RtlStringCchCopy RtlStringCchCopyEx Copy a string into a buffer. strcpy wcscpy RtlStringCbCopyN RtlStringCbCopyNEx RtlStringCchCopyN RtlStringCchCopyNEx Copy a byte-counted string into a buffer, while limiting the size of the copied string. strncpy wcsncpy RtlStringCbLength RtlStringCchLength Determine the length of a supplied string. strlen wcslen RtlStringCbPrintf RtlStringCbPrintfEx RtlStringCchPrintf RtlStringCchPrintfEx Create a formatted text string that is based on a format string and a set of additional function arguments. sprintf swprintf _snprintf _snwprintf RtlStringCbVPrintf RtlStringCbVPrintfEx RtlStringCchVPrintf RtlStringCchVPrintfEx Create a formatted text string that is based on a format string and one additional function argument. vsprintf |
|
5楼#
发布于:2007-09-04 20:46
#include <dontuse.h>
你会发现N多warning,ms推荐使用ntstrsafe中的替代品 |
|
|
6楼#
发布于:2007-09-04 17:16
ms 建议是使用ntstrsafe里的RTL系列函数操作字符串,C库函数在某些情况下会BSOD。
|
|
|
7楼#
发布于:2007-09-04 15:34
不错,我顶,顶你个肺:)
最好换成rtl版的 |
|
|