# HG changeset patch
# User insilmaril
# Date 1194535683 0
# Node ID 7ee5bf3647d318c856348b8a88ca84edae2288c2
# Parent 16d63fc9ae425e47697041af6ffb160d3a433aff
1.11.2 split up of xml helper functions. started to work on attributes
diff -r 16d63fc9ae42 -r 7ee5bf3647d3 misc.cpp
--- a/misc.cpp Thu Nov 08 15:28:03 2007 +0000
+++ b/misc.cpp Thu Nov 08 15:28:03 2007 +0000
@@ -83,22 +83,6 @@
}
-// returns masked "<" ">" "&"
-QString quotemeta(const QString &s)
-{
- QString r=s;
- QRegExp rx("&(?!amp;)");
- r.replace ( rx,"&");
- rx.setPattern( ">");
- r.replace ( rx,">");
- rx.setPattern( "<");
- r.replace ( rx,"<");
- rx.setPattern( "\"");
- r.replace ( rx,""");
- return r;
-}
-
-
qreal max(qreal a, qreal b)
{
if (a>b)
@@ -106,75 +90,3 @@
return b;
}
-int xmlObj::actindent=0; // make instance of actindent
-
-xmlObj::xmlObj()
-{
- indentwidth=4;
-}
-
-
-// returns
-QString xmlObj::singleElement(QString s, QString at)
-{
- return indent() + "<" + s +" " + at +" " + "/>\n";
-}
-
-// returns
-QString xmlObj::beginElement(QString s)
-{
- return indent() + "<" + s + ">\n";
-}
-
-// returns
-QString xmlObj::beginElement(QString s, QString at)
-{
- return indent() + "<" + s + " " + at + ">\n";
-}
-
-// returns
-QString xmlObj::endElement(QString s)
-{
- return indent() + "" + s + ">\n";
-}
-
-// returns at="val"
-QString xmlObj::attribut(QString at, QString val)
-{
- return " " + at + "=\"" + quotemeta (val) + "\"";
-}
-
-// returns val
-QString xmlObj::valueElement(QString el, QString val)
-{
- return indent() + "<" + el + ">" + quotemeta(val) + "" +el + ">\n";
-}
-
-// returns val
-QString xmlObj::valueElement(QString el, QString val, QString at)
-{
- return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "" +el + ">\n";
-}
-
-void xmlObj::incIndent()
-{
- actindent++;
-}
-
-void xmlObj::decIndent()
-{
- actindent--;
- if (actindent<0) actindent=0;
-}
-
-QString xmlObj::indent()
-{
- QString s;
- int i;
- for (i=0; i