misc.cpp
changeset 617 7ee5bf3647d3
parent 413 c3f7beb4e9f4
child 789 d85834ad8c54
     1.1 --- a/misc.cpp	Thu Nov 08 15:28:03 2007 +0000
     1.2 +++ b/misc.cpp	Thu Nov 08 15:28:03 2007 +0000
     1.3 @@ -83,22 +83,6 @@
     1.4  }
     1.5  
     1.6  
     1.7 -// returns masked "<" ">" "&"
     1.8 -QString quotemeta(const QString &s)
     1.9 -{
    1.10 -	QString r=s;
    1.11 -    QRegExp  rx("&(?!amp;)");
    1.12 -    r.replace ( rx,"&amp;");
    1.13 -    rx.setPattern( ">");
    1.14 -    r.replace ( rx,"&gt;");
    1.15 -    rx.setPattern( "<");
    1.16 -    r.replace ( rx,"&lt;");
    1.17 -    rx.setPattern( "\"");
    1.18 -    r.replace ( rx,"&quot;");
    1.19 -    return r;
    1.20 -}
    1.21 -
    1.22 -
    1.23  qreal max(qreal a, qreal b)
    1.24  {
    1.25  	if (a>b)
    1.26 @@ -106,75 +90,3 @@
    1.27  	return b;
    1.28  }
    1.29  
    1.30 -int xmlObj::actindent=0;		// make instance of actindent
    1.31 -
    1.32 -xmlObj::xmlObj()
    1.33 -{
    1.34 -    indentwidth=4;
    1.35 -}
    1.36 -
    1.37 -
    1.38 -// returns <s at />
    1.39 -QString xmlObj::singleElement(QString s, QString at)
    1.40 -{
    1.41 -    return indent() + "<" + s +" " + at +" " + "/>\n";
    1.42 -}
    1.43 -
    1.44 -// returns <s>
    1.45 -QString xmlObj::beginElement(QString s)
    1.46 -{
    1.47 -    return indent() + "<" + s + ">\n";
    1.48 -}
    1.49 -
    1.50 -// returns <s at>
    1.51 -QString xmlObj::beginElement(QString s, QString at)
    1.52 -{
    1.53 -    return indent() + "<" + s + " " + at + ">\n";
    1.54 -}
    1.55 -
    1.56 -// returns </s>
    1.57 -QString xmlObj::endElement(QString s)
    1.58 -{
    1.59 -    return indent() + "</" + s + ">\n";
    1.60 -}
    1.61 -
    1.62 -// returns  at="val"
    1.63 -QString xmlObj::attribut(QString at, QString val)
    1.64 -{
    1.65 -    return " " + at + "=\"" + quotemeta (val) + "\""; 
    1.66 -}
    1.67 -
    1.68 -// returns <s> val </s>
    1.69 -QString xmlObj::valueElement(QString el, QString val)
    1.70 -{
    1.71 -    return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
    1.72 -}
    1.73 -
    1.74 -// returns <s at> val </s>
    1.75 -QString xmlObj::valueElement(QString el, QString val, QString at)
    1.76 -{
    1.77 -    return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
    1.78 -}
    1.79 -
    1.80 -void xmlObj::incIndent()
    1.81 -{
    1.82 -    actindent++;
    1.83 -}	
    1.84 -
    1.85 -void xmlObj::decIndent()
    1.86 -{
    1.87 -    actindent--;
    1.88 -    if (actindent<0) actindent=0;
    1.89 -}	
    1.90 -
    1.91 -QString xmlObj::indent()
    1.92 -{
    1.93 -    QString s;
    1.94 -    int i;
    1.95 -    for (i=0; i<actindent*indentwidth; i++)
    1.96 -    {
    1.97 -		s= s + " ";
    1.98 -    }
    1.99 -    return s;
   1.100 -}	
   1.101 -