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.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
#include "iXmlItemBase.h"
|
|
|
|
|
|
|
|
|
|
#include "nmXml_global.h"
|
|
|
|
|
|
|
|
|
|
// xml节点对应的数据对象
|
|
|
|
|
class NM_XML_EXPORT nmXmlData : public iXmlItemBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
nmXmlData();
|
|
|
|
|
~nmXmlData();
|
|
|
|
|
|
|
|
|
|
// 示例:把xml某属性转为枚举
|
|
|
|
|
enum nmUseMode
|
|
|
|
|
{
|
|
|
|
|
NUM_Common = 0, //枚举1
|
|
|
|
|
NUM_Advanced, //枚举2
|
|
|
|
|
NUM_Others, //其他
|
|
|
|
|
NUM_Unknown
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 解析xml节点到List
|
|
|
|
|
virtual void parseInfo(const QDomElement& e);
|
|
|
|
|
|
|
|
|
|
// 把List分配到成员变量
|
|
|
|
|
// 输入开始的m_listValues中index,并且返回下一个index
|
|
|
|
|
virtual int allocateInfo(int nIndex);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 初始设置节点信息
|
|
|
|
|
virtual void initXmlTags();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
//QString m_sName; //名称,父类已经提供
|
|
|
|
|
//QString m_sAlias; //别名,父类已经提供
|
|
|
|
|
|
|
|
|
|
QString m_sTag; // 示例:把xml某属性转为QString
|
|
|
|
|
QStringList m_listParas;// 示例:把xml某属性转为QStringList
|
|
|
|
|
nmUseMode m_oNum; // 示例:把xml某属性转为枚举
|
|
|
|
|
};
|
|
|
|
|
typedef QVector<nmXmlData*> vecNmXmlDatas;
|