35 #include <QStringList>
47 QStringList pathList = path.split(
"/");
48 QDomElement current = mNode.toElement();
53 for (
int i = 0; i < pathList.size(); ++i)
55 QDomElement next = current.namedItem(pathList[i]).toElement();
59 next = mNode.ownerDocument().createElement(pathList[i]);
60 current.appendChild(next);
77 element.appendChild(this->document().createTextNode(text));
83 QDomElement element = this->document().createElement(name);
84 mNode.appendChild(element);
88 QDomDocument XMLNodeAdder::document()
90 return mNode.ownerDocument();
103 QStringList pathList = path.split(
"/");
104 QDomElement current = mNode.toElement();
106 if (current.isNull())
109 for (
int i = 0; i < pathList.size(); ++i)
111 QDomElement next = current.namedItem(pathList[i]).toElement();
124 return mNode.namedItem(name).toElement().text();
129 QString text = mNode.namedItem(name).toElement().text();
131 double val = text.toDouble(&ok);
140 for (QDomElement elem = mNode.firstChildElement(name);
142 elem = elem.nextSiblingElement(name))
144 retval << elem.text();
151 std::vector<QDomElement> retval;
152 for (QDomElement elem = mNode.firstChildElement(name);
154 elem = elem.nextSiblingElement(name))
156 retval.push_back(elem);
164 return mNode.namedItem(name).toElement();
double parseDoubleFromElementWithDefault(QString name, double defaultValue)
QStringList parseTextFromDuplicateElements(QString name)
XMLNodeAdder descend(QString path)
QDomElement addElement(QString name)
XMLNodeAdder(QDomNode node)
std::vector< QDomElement > getDuplicateElements(QString name)
QDomElement addTextToElement(QString name, QString text)
XMLNodeParser descend(QString path)
QString parseTextFromElement(QString name)
XMLNodeParser(QDomNode node)
QDomElement parseElement(QString name)