iis发布php网站,软件开发项目经验,火锅料网站方案怎么做,wordpress 效率TinyXML它是基于一个非常受欢迎的现在DOM型号XML解析器#xff0c;简单易用且小巧玲珑#xff0c;很适合存储简单数据。配置文件。当前最新版本号是2.6.2先看一下源代码文档的结构#xff1a;Docs是帮助文档。里边有许多的使用说明#xff0c;只截一张图看一下#xff1a;…TinyXML它是基于一个非常受欢迎的现在DOM型号XML解析器简单易用且小巧玲珑很适合存储简单数据。配置文件。当前最新版本号是2.6.2先看一下源代码文档的结构Docs是帮助文档。里边有许多的使用说明只截一张图看一下详细依据须要再看我们使用的是它的库。能够是静态的也能够是动态库。我就用静态库了将这里边的几个头文件和源文件一起创建一个project生成Lib库tinyxml.lib使用的时候将这两个头文件以及生成的静态库加进去一个简单的样例#include using namespace std;#ifdef TIXML_USE_STL#include #include using namespace std;#else#include #endif#if defined( WIN32 ) defined( TUNE )#include _CrtMemState startMemState;_CrtMemState endMemState;#endif#include tinyxml/tinyxml.hint main(){TiXmlDocument *pDoc new TiXmlDocument;if (NULLpDoc){return false;}TiXmlDeclaration *pDeclaration new TiXmlDeclaration(1.0,gb2312,);if (NULLpDeclaration){return false;}pDoc-LinkEndChild(pDeclaration);// 生成一个根节点TiXmlElement *pRootEle new TiXmlElement(索引数据包信息);pDoc-LinkEndChild(pRootEle);//头节点TiXmlElement *pHeader new TiXmlElement(头节点);pRootEle-LinkEndChild(pHeader);TiXmlElement *pCellNode new TiXmlElement(字段1);pHeader-LinkEndChild(pCellNode);pCellNode-SetAttribute(str1,1状态);pCellNode-SetAttribute(str2,0状态);pDoc-SaveFile(d:\\result.xml);return 0;}结果临时这里边的字符串不能是宽字符的。转换能够这样DWORD nWideCharToMultiByte(CP_OEMCP,NULL,szBuf,-1,NULL,0,NULL,FALSE);char *cnamenew char[n1];WideCharToMultiByte(CP_OEMCP,NULL,szBuf,-1,cname,n,NULL,FALSE);cname[n]0;当中szBuf是宽字符串。參考版权声明本文博主原创文章博客未经同意不得转载。