• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

  • lib
  • util
domutil.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2001 by Bernd Gehrmann *
3  * bernd@kdevelop.org *
4  * jakob@simon-gaarde.dk *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  ***************************************************************************/
12 
13 #ifndef _DOMUTIL_H_
14 #define _DOMUTIL_H_
15 
16 #include <tqdom.h>
17 #include <tqpair.h>
18 #include <tqstringlist.h>
19 #include <tqvaluelist.h>
20 #include <tqmap.h>
21 
27 struct DomAttribute
28 {
29  TQString name;
30  TQString value;
31 };
32 
33 struct DomPathElement
34 {
35  TQString tagName;
36  TQValueList<DomAttribute> attribute;
37  int matchNumber; // for use when more than one element matches the path
38 };
39 
40 typedef TQValueList<DomPathElement> DomPath;
41 
45 class DomUtil
46 {
47 public:
48  typedef TQPair<TQString, TQString> Pair;
49  typedef TQValueList<Pair> PairList;
53  static void makeEmpty( TQDomElement& );
57  static TQString readEntry(const TQDomDocument &doc, const TQString &path, const TQString &defaultEntry = TQString());
61  static int readIntEntry(const TQDomDocument &doc, const TQString &path, int defaultEntry = 0);
66  static bool readBoolEntry(const TQDomDocument &doc, const TQString &path, bool defaultEntry = false);
70  static TQStringList readListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag);
74  static PairList readPairListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag,
75  const TQString &firstAttr, const TQString &secondAttr);
79  static TQMap<TQString, TQString> readMapEntry(const TQDomDocument &doc, const TQString &path);
84  static TQDomElement elementByPath( const TQDomDocument& doc, const TQString& path );
88  static TQDomElement createElementByPath( TQDomDocument& doc, const TQString& path );
93  static TQDomElement namedChildElement( TQDomElement& el, const TQString& name );
106  static void writeEntry(TQDomDocument &doc, const TQString &path, const TQString &value);
110  static void writeIntEntry(TQDomDocument &doc, const TQString &path, int value);
114  static void writeBoolEntry(TQDomDocument &doc, const TQString &path, bool value);
128  static void writeListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
129  const TQStringList &value);
149  static void writePairListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
150  const TQString &firstAttr, const TQString &secondAttr,
151  const PairList &value);
156  static void writeMapEntry(TQDomDocument &doc, const TQString& path, const TQMap<TQString,TQString> &map);
157 
165  static DomPath resolvPathStringExt(const TQString pathstring);
166 
195  static TQDomElement elementByPathExt(TQDomDocument &doc, const TQString &pathstring);
196 
200  static bool openDOMFile(TQDomDocument &doc, TQString filename);
201 
205  static bool saveDOMFile(TQDomDocument &doc, TQString filename);
206 
210  static bool removeTextNodes(TQDomDocument doc,TQString pathExt);
211 
215  static bool appendText(TQDomDocument doc, TQString pathExt, TQString text);
216 
220  static bool replaceText(TQDomDocument doc, TQString pathExt, TQString text);
221 
222 private:
223  static TQString readEntryAux(const TQDomDocument &doc, const TQString &path);
224 };
225 
226 #endif
URLUtil::filename
TQString filename(const TQString &pathName)
Definition: urlutil.cpp:39
DomUtil
Utility class for conveniently accessing data in a DOM tree.
Definition: domutil.h:45

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.