2013年8月7日

Boost xml解析之菜鸟版

摘要: 1.准备工作:环境: visual studio 2010 /boost:boost_1_54_0新建Application什么的不做赘述,但是注意 如果需要引用Boost库中的lib 需要在属性properties的VC++ Directories中的Include Directories 中加入Boost的路径待解析xml文件:text.xml 张三 18 男 李娟 22 女 王强 21 男 李四 25 男 ... 阅读全文

posted @ 2013-08-07 14:08 liygcheng 阅读(4856) 评论(0) 推荐(0) 编辑

Boost xml 解析(转)

摘要: xml_parser[ 经试验证明,boost 库中xml 解析库对中文支持不好,解析出来是乱码 ]头文件:#include#include命名空间:using namespaceboost::property_tree;读入xml 文件:xml文件内容被读入ptree 对象中,然后进行解析ptree pt;read_xml(“xml_file_name”, pt);tips:voidread_xml(const string&, ptree&pt);voidread_xml(const string&, ptree&pt);获取xml 文件内容pt.get(t 阅读全文

posted @ 2013-08-07 11:33 liygcheng 阅读(822) 评论(0) 推荐(0) 编辑

导航