-rw-r--r-- | libopie2/opiecore/xmltree.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie2/opiecore/xmltree.h b/libopie2/opiecore/xmltree.h index ed93c23..4a6b6d9 100644 --- a/libopie2/opiecore/xmltree.h +++ b/libopie2/opiecore/xmltree.h | |||
@@ -4,48 +4,51 @@ | |||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | 20 | ||
21 | #ifndef __bookmarks_h__ | 21 | #ifndef __bookmarks_h__ |
22 | #define __bookmarks_h__ | 22 | #define __bookmarks_h__ |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qmap.h> | 25 | #include <qmap.h> |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | 27 | ||
28 | namespace Opie | ||
29 | { | ||
30 | |||
28 | /** | 31 | /** |
29 | * A small xml lib written by Simon Hausmann. | 32 | * A small xml lib written by Simon Hausmann. |
30 | */ | 33 | */ |
31 | class XMLElement | 34 | class XMLElement |
32 | { | 35 | { |
33 | public: | 36 | public: |
34 | typedef QMap<QString, QString> AttributeMap; | 37 | typedef QMap<QString, QString> AttributeMap; |
35 | 38 | ||
36 | /** | 39 | /** |
37 | * The constructor of XMLElement | 40 | * The constructor of XMLElement |
38 | */ | 41 | */ |
39 | XMLElement(); | 42 | XMLElement(); |
40 | ~XMLElement(); | 43 | ~XMLElement(); |
41 | 44 | ||
42 | /** appendChild appends a child to the XMLElement behind the last element. | 45 | /** appendChild appends a child to the XMLElement behind the last element. |
43 | * The ownership of the child get's transfered to the | 46 | * The ownership of the child get's transfered to the |
44 | * this XMLElement. | 47 | * this XMLElement. |
45 | * If child is already the child of another parent | 48 | * If child is already the child of another parent |
46 | * it's get removed from the other parent first. | 49 | * it's get removed from the other parent first. |
47 | */ | 50 | */ |
48 | void appendChild( XMLElement *child ); | 51 | void appendChild( XMLElement *child ); |
49 | 52 | ||
50 | /** inserts newChild after refChild. If newChild is the child | 53 | /** inserts newChild after refChild. If newChild is the child |
51 | * of another parent the child will get removed. | 54 | * of another parent the child will get removed. |
@@ -88,25 +91,27 @@ public: | |||
88 | void setAttribute( const QString &attr, const QString &value ); | 91 | void setAttribute( const QString &attr, const QString &value ); |
89 | void save( QTextStream &stream, uint indent = 0 ); | 92 | void save( QTextStream &stream, uint indent = 0 ); |
90 | 93 | ||
91 | XMLElement *namedItem( const QString &name ); | 94 | XMLElement *namedItem( const QString &name ); |
92 | 95 | ||
93 | XMLElement *clone() const; | 96 | XMLElement *clone() const; |
94 | 97 | ||
95 | static XMLElement *load( const QString &fileName ); | 98 | static XMLElement *load( const QString &fileName ); |
96 | 99 | ||
97 | private: | 100 | private: |
98 | QString m_tag; | 101 | QString m_tag; |
99 | QString m_value; | 102 | QString m_value; |
100 | AttributeMap m_attributes; | 103 | AttributeMap m_attributes; |
101 | 104 | ||
102 | XMLElement *m_parent; | 105 | XMLElement *m_parent; |
103 | XMLElement *m_next; | 106 | XMLElement *m_next; |
104 | XMLElement *m_prev; | 107 | XMLElement *m_prev; |
105 | XMLElement *m_first; | 108 | XMLElement *m_first; |
106 | XMLElement *m_last; | 109 | XMLElement *m_last; |
107 | 110 | ||
108 | XMLElement( const XMLElement &rhs ); | 111 | XMLElement( const XMLElement &rhs ); |
109 | XMLElement &operator=( const XMLElement &rhs ); | 112 | XMLElement &operator=( const XMLElement &rhs ); |
110 | }; | 113 | }; |
111 | 114 | ||
115 | } // namespace Opie | ||
116 | |||
112 | #endif | 117 | #endif |