Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

domutil.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Bernd Gehrmann                                  *
00003  *   bernd@kdevelop.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #ifndef _DOMUTIL_H_
00013 #define _DOMUTIL_H_
00014 
00015 #include <qdom.h>
00016 #include <qpair.h>
00017 #include <qstringlist.h>
00018 #include <qvaluelist.h>
00019 
00020 
00024 class DomUtil
00025 {
00026 public:
00027     typedef QPair<QString, QString> Pair;
00028     typedef QValueList<Pair> PairList;
00029     typedef QValueList<QStringList> TupleList;
00030     
00034     static void makeEmpty( QDomElement& );
00038     static QString readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry = QString::null);
00042     static int readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry = 0);
00047     static bool readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry = false);
00051     static QStringList readListEntry(const QDomDocument &doc, const QString &path, const QString &tag);
00055     static PairList readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
00056                                       const QString &firstAttr, const QString &secondAttr);
00057                                       
00058     static TupleList readTupleListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
00059                                           const QStringList &attrList);
00064     static QDomElement elementByPath( const QDomDocument& doc, const QString& path );
00068     static QDomElement createElementByPath( QDomDocument& doc, const QString& path );
00073     static QDomElement namedChildElement( QDomElement& el, const QString& name );
00084     static void writeEntry(QDomDocument &doc, const QString &path, const QString &value);
00088     static void writeIntEntry(QDomDocument &doc, const QString &path, int value);
00092     static void writeBoolEntry(QDomDocument &doc, const QString &path, bool value);
00104     static void writeListEntry(QDomDocument &doc, const QString &path, const QString &tag,
00105                                const QStringList &value);
00123     static void writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag,
00124                                    const QString &firstAttr, const QString &secondAttr,
00125                                    const PairList &value);
00126                                    
00127     static void writeTupleListEntry(QDomDocument &doc, const QString &path, const QString &tag,
00128                                     const QStringList &attrList, const TupleList &value);
00129 private:
00130     static QString readEntryAux(const QDomDocument &doc, const QString &path);
00131 };
00132 
00133 #endif

Generated on Sat May 10 15:09:26 2003 for qnet by doxygen1.3