bool SaveXMLConfig(const char* szFileName)
{
TiXmlDocument doc;
TiXmlDeclaration *pDeclaration = new TiXmlDeclaration("1.0", "utf-8", "");
doc.LinkEndChild(pDeclaration);
TiXmlElement *pRootElm = new TiXmlElement("Ui");
doc.LinkEndChild(pRootElm);
TiXmlElement *pPanelElm = new TiXmlElement("Panel");
pPanelElm->SetAttribute("type", "Panel");
pXmlElement->SetAttribute("name", "TestPanel");
pRootElm->LinkEndChild(pPanelElm);
doc.SaveFile(szFileName);
return true;
}
将数据写入一个XML文件
最新推荐文章于 2021-05-23 08:47:41 发布