论坛首页 编程语言技术论坛

libxml2常用函数集锦之三

浏览 2733 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-11-26  
C++

libxml自定义了一个字符类型xmlChar,其本质是 unsigned char.

另外,libxml提供了一个宏来将char*转换成xmlChar*, 名字很有趣,叫 BAD_CAST 它的本质其实是 unsigned char*.

为了方便对xmlChar类型字符串的操作,libxml提供了自己的函数,它们的定义于标准c函数库中的字符串函数很像.

 

xmlChar* xmlStrcat (xmlChar *cur, const xmlChar * add)

 

const xmlChar *xmlStrchr(const xmlChar * str, xmlChar val)

 

int xmlStrcmp (const xmlChar * str1, const xmlChar * str2)

 

int xmlStrlen (const xmlChar * str)

 

xmlChar *xmlStrncat (xmlChar * cur, const xmlChar * add, int len)

 

int xmlStrncmp (const xmlChar * str1, const xmlChar * str2, int len)

const xmlChar *xmlStrstr (const xmlChar * str, const xmlChar * val)

 

相信这些函数大家都看得眼熟,这里就不一一解释了.

 

更多函数大家可以参考

http://xmlsoft.org/html/libxml-xmlstring.html

 

论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics