Fastman
2nd February 2008, 15:30
I need to realize a class for parsing configuration files with following features:
(1): GetNodeValue(QString cnode, QString &cvaluenode, int count) const
For example
XmlParser pXmlParser;
if(!pXmlParser.OpenXml(cCmd))
return false;
QString cTmp;
QString cValue;
QString cXml;
cXml = "node1/node2/node3"; // <- Thus I need to specify root
cTmp = cXml + "/brw"; // <- specify Node
pXmlParser.GetNodeValue(cTmp, cValue); // <- get value this node
m_psInfoUser.bOnBrowse = cValue == "1" ? true : false;
(2) GetNodeList(QString cnode, StrVector &nodes) const
(3) GetNodeNameList(QString cnode, StrVector &nodes) const
(4) GetAttrList(QString cnode, QString nameattr, StrVector &attr) const
(5) GetAttrValue(QString cnode, QString nameattr, QString& valattr, int count) const
What advise to esteem, and there are some ready examples which it can is possible to take for a basis?
(1): GetNodeValue(QString cnode, QString &cvaluenode, int count) const
For example
XmlParser pXmlParser;
if(!pXmlParser.OpenXml(cCmd))
return false;
QString cTmp;
QString cValue;
QString cXml;
cXml = "node1/node2/node3"; // <- Thus I need to specify root
cTmp = cXml + "/brw"; // <- specify Node
pXmlParser.GetNodeValue(cTmp, cValue); // <- get value this node
m_psInfoUser.bOnBrowse = cValue == "1" ? true : false;
(2) GetNodeList(QString cnode, StrVector &nodes) const
(3) GetNodeNameList(QString cnode, StrVector &nodes) const
(4) GetAttrList(QString cnode, QString nameattr, StrVector &attr) const
(5) GetAttrValue(QString cnode, QString nameattr, QString& valattr, int count) const
What advise to esteem, and there are some ready examples which it can is possible to take for a basis?