diff options
Diffstat (limited to 'lib/util/domutil.h')
-rw-r--r-- | lib/util/domutil.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/lib/util/domutil.h b/lib/util/domutil.h index a301ef00..08d2571a 100644 --- a/lib/util/domutil.h +++ b/lib/util/domutil.h @@ -13,11 +13,11 @@ #ifndef _DOMUTIL_H_ #define _DOMUTIL_H_ -#include <qdom.h> -#include <qpair.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qmap.h> +#include <tqdom.h> +#include <tqpair.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqmap.h> /** @file domutil.h @@ -26,18 +26,18 @@ Utility functions to operate on %DOM. struct DomAttribute { - QString name; - QString value; + TQString name; + TQString value; }; struct DomPathElement { - QString tagName; - QValueList<DomAttribute> attribute; + TQString tagName; + TQValueList<DomAttribute> attribute; int matchNumber; // for use when more than one element matches the path }; -typedef QValueList<DomPathElement> DomPath; +typedef TQValueList<DomPathElement> DomPath; /** * Utility class for conveniently accessing data in a %DOM tree. @@ -45,52 +45,52 @@ typedef QValueList<DomPathElement> DomPath; class DomUtil { public: - typedef QPair<QString, QString> Pair; - typedef QValueList<Pair> PairList; + typedef QPair<TQString, TQString> Pair; + typedef TQValueList<Pair> PairList; /** * Remove all child elements from a given element. */ - static void makeEmpty( QDomElement& ); + static void makeEmpty( TQDomElement& ); /** * Reads a string entry. */ - static QString readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry = QString::null); + static TQString readEntry(const TQDomDocument &doc, const TQString &path, const TQString &defaultEntry = TQString::null); /** * Reads a number entry. */ - static int readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry = 0); + static int readIntEntry(const TQDomDocument &doc, const TQString &path, int defaultEntry = 0); /** * Reads a boolean entry. The strings "true" and "TRUE" are interpreted * as true, all other as false. */ - static bool readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry = false); + static bool readBoolEntry(const TQDomDocument &doc, const TQString &path, bool defaultEntry = false); /** * Reads a list entry. See writeListEntry(). */ - static QStringList readListEntry(const QDomDocument &doc, const QString &path, const QString &tag); + static TQStringList readListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag); /** * Reads a list of string pairs. See writePairListEntry(). */ - static PairList readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag, - const QString &firstAttr, const QString &secondAttr); + static PairList readPairListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag, + const TQString &firstAttr, const TQString &secondAttr); /** * Reads a string to string map. See writeMapEntry() */ - static QMap<QString, QString> readMapEntry(const QDomDocument &doc, const QString &path); + static TQMap<TQString, TQString> readMapEntry(const TQDomDocument &doc, const TQString &path); /** * Retrieves an element by path, return null if any item along * the path does not exist. */ - static QDomElement elementByPath( const QDomDocument& doc, const QString& path ); + static TQDomElement elementByPath( const TQDomDocument& doc, const TQString& path ); /** * Retrieves an element by path, creating the necessary nodes. */ - static QDomElement createElementByPath( QDomDocument& doc, const QString& path ); + static TQDomElement createElementByPath( TQDomDocument& doc, const TQString& path ); /** * Retrieves a child element, creating it if it does not exist. * The return value is guaranteed to be non isNull() */ - static QDomElement namedChildElement( QDomElement& el, const QString& name ); + static TQDomElement namedChildElement( TQDomElement& el, const TQString& name ); /** Writes a string entry. For example, \verbatim @@ -103,20 +103,20 @@ public: </code> \endverbatim */ - static void writeEntry(QDomDocument &doc, const QString &path, const QString &value); + static void writeEntry(TQDomDocument &doc, const TQString &path, const TQString &value); /** * Writes a number entry. */ - static void writeIntEntry(QDomDocument &doc, const QString &path, int value); + static void writeIntEntry(TQDomDocument &doc, const TQString &path, int value); /** * Writes a boolean entry. Booleans are stored as "true", "false" resp. */ - static void writeBoolEntry(QDomDocument &doc, const QString &path, bool value); + static void writeBoolEntry(TQDomDocument &doc, const TQString &path, bool value); /** Writes a string list element. The list elements are separated by tag. For example, \verbatim <code> - QStringList l; l << "one" << "two"; + TQStringList l; l << "one" << "two"; writeListEntry(doc, "/general/special", "el", l); </code> \endverbatim creates the %DOM fragment: \verbatim @@ -125,8 +125,8 @@ public: </code> \endverbatim */ - static void writeListEntry(QDomDocument &doc, const QString &path, const QString &tag, - const QStringList &value); + static void writeListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag, + const TQStringList &value); /** Writes a list of string pairs. The list elements are stored in the attributes firstAttr and secondAttr of elements named tag. For example, @@ -146,14 +146,14 @@ public: </code> \endverbatim */ - static void writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag, - const QString &firstAttr, const QString &secondAttr, + static void writePairListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag, + const TQString &firstAttr, const TQString &secondAttr, const PairList &value); /** * Writes a string to string map. This map is stored in a way, that it can be read with * readMapEntry() and readEntry() */ - static void writeMapEntry(QDomDocument &doc, const QString& path, const QMap<QString,QString> &map); + static void writeMapEntry(TQDomDocument &doc, const TQString& path, const TQMap<TQString,TQString> &map); /** * Resolves an extended path @@ -162,7 +162,7 @@ public: * where matchNumber is zero-based * path: pathpart[/pathpart/..] */ - static DomPath resolvPathStringExt(const QString pathstring); + static DomPath resolvPathStringExt(const TQString pathstring); /** Retrieve an element specified with extended path @@ -174,7 +174,7 @@ public: or "widget/property||2/string" . \verbatim - <widget class="QDialog"> + <widget class="TQDialog"> <property name="name"> <cstring>KdevFormName</cstring> </property> @@ -192,35 +192,35 @@ public: </widget> \endverbatim */ - static QDomElement elementByPathExt(QDomDocument &doc, const QString &pathstring); + static TQDomElement elementByPathExt(TQDomDocument &doc, const TQString &pathstring); /** * Open file - filename - and set setContents of doc */ - static bool openDOMFile(QDomDocument &doc, QString filename); + static bool openDOMFile(TQDomDocument &doc, TQString filename); /** * Store contents of doc in file - filename. Existing file will be truncated! */ - static bool saveDOMFile(QDomDocument &doc, QString filename); + static bool saveDOMFile(TQDomDocument &doc, TQString filename); /** * Remove all child text nodes of parent described in pathExt */ - static bool removeTextNodes(QDomDocument doc,QString pathExt); + static bool removeTextNodes(TQDomDocument doc,TQString pathExt); /** * Add child text node to parent described in pathExt */ - static bool appendText(QDomDocument doc, QString pathExt, QString text); + static bool appendText(TQDomDocument doc, TQString pathExt, TQString text); /** * Replace all chilt text nodes of parent described in pathExt with one new. */ - static bool replaceText(QDomDocument doc, QString pathExt, QString text); + static bool replaceText(TQDomDocument doc, TQString pathExt, TQString text); private: - static QString readEntryAux(const QDomDocument &doc, const QString &path); + static TQString readEntryAux(const TQDomDocument &doc, const TQString &path); }; #endif |