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.
58 lines
1.2 KiB
C++
58 lines
1.2 KiB
C++
#include "nmXmlData.h"
|
|
|
|
nmXmlData::nmXmlData() : iXmlItemBase()
|
|
{
|
|
m_sTag = "";
|
|
m_listParas.clear();
|
|
m_oNum = NUM_Unknown;
|
|
|
|
initXmlTags();
|
|
}
|
|
|
|
nmXmlData::~nmXmlData()
|
|
{
|
|
}
|
|
|
|
void nmXmlData::initXmlTags()
|
|
{
|
|
m_listTags << "Tag";
|
|
m_listTags << "Paras";
|
|
m_listTags << "Num";
|
|
}
|
|
|
|
void nmXmlData::parseInfo(const QDomElement& e)
|
|
{
|
|
iXmlItemBase::parseInfo(e);
|
|
|
|
// 如果本身需要提供层级,可以在此处进行继续编写
|
|
// QDomNodeList list = e.childNodes();
|
|
// for (int i = 0; i < list.count(); i++)
|
|
// {
|
|
// QDomNode node = list.at(i);
|
|
// iXmlItemChild* p = new iXmlItemChild();
|
|
// Q_ASSERT (NULL != p);
|
|
// p->parseInfo(node.toElement());
|
|
// appenChild(p);
|
|
// }
|
|
}
|
|
|
|
int nmXmlData::allocateInfo(int nIndex)
|
|
{
|
|
nIndex = iXmlItemBase::allocateInfo(nIndex);
|
|
|
|
m_sTag = m_listValues.at(nIndex++).trimmed();
|
|
m_listParas = m_listValues.at(nIndex++).trimmed().split(";");
|
|
|
|
QString s = m_listValues.at(nIndex++).trimmed();
|
|
if (!s.isEmpty())
|
|
{
|
|
int n = s.toInt();
|
|
if (n >= 0 && n < (int)NUM_Unknown)
|
|
{
|
|
m_oNum = (nmUseMode)n;
|
|
}
|
|
}
|
|
|
|
return nIndex;
|
|
}
|