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.
57 lines
936 B
C++
57 lines
936 B
C++
#include "zxLogInstance.h"
|
|
#include "ZxBaseUtil.h"
|
|
#include "nmXmlUtils.h"
|
|
#include "nmXmlHelper.h"
|
|
|
|
nmXmlHelper* nmXmlHelper::_helper = NULL;
|
|
|
|
nmXmlHelper* nmXmlHelper::getInstance()
|
|
{
|
|
if (NULL == _helper)
|
|
{
|
|
_helper = new nmXmlHelper();
|
|
}
|
|
|
|
return _helper;
|
|
}
|
|
|
|
void nmXmlHelper::release()
|
|
{
|
|
if (_helper != NULL)
|
|
{
|
|
delete _helper;
|
|
_helper = NULL;
|
|
}
|
|
}
|
|
|
|
nmXmlHelper::nmXmlHelper()
|
|
{
|
|
m_vecNmXmlDatas.clear();
|
|
m_sError = "";
|
|
}
|
|
|
|
nmXmlHelper::~nmXmlHelper()
|
|
{
|
|
}
|
|
|
|
bool nmXmlHelper::loadXmlDefines(QString sFile /*= ""*/)
|
|
{
|
|
if (sFile.isEmpty())
|
|
{
|
|
QString sDir = ZxBaseUtil::getDirOf(s_Dir_Config, "Common");
|
|
sFile = sDir + "NmXmlDemo.xml";
|
|
}
|
|
|
|
return nmXmlUtils::loadNmXmlDatas(&m_vecNmXmlDatas, sFile);
|
|
}
|
|
|
|
vecNmXmlDatas* nmXmlHelper::getVecNmXmlDataPtrs()
|
|
{
|
|
return &m_vecNmXmlDatas;
|
|
}
|
|
|
|
QString nmXmlHelper::getLastError()
|
|
{
|
|
return m_sError;
|
|
}
|