6 // returns masked "<" ">" "&"
7 QString quotemeta(const QString &s)
10 QRegExp rx("&(?!amp;)");
11 r.replace ( rx,"&");
13 r.replace ( rx,">");
15 r.replace ( rx,"<");
17 r.replace ( rx,""");
23 int XMLObj::actindent=0; // make instance of actindent
32 QString XMLObj::singleElement(QString s, QString at)
34 return indent() + "<" + s +" " + at +" " + "/>\n";
38 QString XMLObj::beginElement(QString s)
40 return indent() + "<" + s + ">\n";
44 QString XMLObj::beginElement(QString s, QString at)
46 return indent() + "<" + s + " " + at + ">\n";
50 QString XMLObj::endElement(QString s)
52 return indent() + "</" + s + ">\n";
56 QString XMLObj::attribut(QString at, QString val)
58 return " " + at + "=\"" + quotemeta (val) + "\"";
61 // returns <s> val </s>
62 QString XMLObj::valueElement(QString el, QString val)
64 return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
67 // returns <s at> val </s>
68 QString XMLObj::valueElement(QString el, QString val, QString at)
70 return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
73 void XMLObj::incIndent()
78 void XMLObj::decIndent()
81 if (actindent<0) actindent=0;
84 QString XMLObj::indent()
88 for (i=0; i<actindent*indentwidth; i++)