You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
856 B
C++

#pragma once
#include "GlobalDefine.h"
#include "tinyxml.h"
//tinyxml封装类
//自定义XML 对象
class CMyXmlItem
{
public:
void AddXmlItem(CMyXmlItem &XmlItem){m_XmlItemVec.push_back(XmlItem);};
public:
CString m_XmlItemName;
CString m_XmlItemAttributeName;//属性名称(可以没有属性)
CString m_XmlItemAttributeVal;//属性值
vector<CMyXmlItem> m_XmlItemVec;
};
class CMyXmlMgr
{
public:
CMyXmlMgr(void);
~CMyXmlMgr(void);
void SaveXmlItemToFile(CString FilePath,CMyXmlItem &XmlItem);
bool ReadXmlItemFromFile(CString FilePath,CMyXmlItem &XmlItem);
private:
void SaveXmlItem(TiXmlElement *RootElement,CMyXmlItem &XmlItem);
void ReadXmlItem(TiXmlElement *RootElement,CMyXmlItem &XmlItem);
private:
};