author | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
commit | 6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff) | |
tree | 6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/xmlreader.h | |
parent | d10cddb3c9ce75bc90b14add14bc133737fe35aa (diff) | |
download | opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2 |
Qtopia1-6 merge
still to test
bic changes to be resolved
more changes to be made?
-rw-r--r-- | library/xmlreader.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/xmlreader.h b/library/xmlreader.h index 2a51176..a4a6697 100644 --- a/library/xmlreader.h +++ b/library/xmlreader.h | |||
@@ -1,83 +1,83 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef XMLREADER_H | 20 | #ifndef XMLREADER_H |
21 | #define XMLREADER_H | 21 | #define XMLREADER_H |
22 | 22 | ||
23 | #include <qstring.h> | 23 | #include <qstring.h> |
24 | #include <qxml.h> | 24 | #include <qxml.h> |
25 | #include <qmap.h> | 25 | #include <qmap.h> |
26 | 26 | ||
27 | class Node | 27 | class Node |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | Node(); | 30 | Node(); |
31 | ~Node(); | 31 | ~Node(); |
32 | 32 | ||
33 | void addChild( Node *child ); | 33 | void addChild( Node *child ); |
34 | 34 | ||
35 | void setAttributes( const QXmlAttributes &a ); | 35 | void setAttributes( const QXmlAttributes &a ); |
36 | QMap<QString, QString> attributeMap(); | 36 | QMap<QString, QString> attributeMap(); |
37 | QString attribute( const QString& name ); | 37 | QString attribute( const QString& name ); |
38 | 38 | ||
39 | Node *nextNode() const { return next; } | 39 | Node *nextNode() const { return next; } |
40 | Node *prevNode() const { return prev; } | 40 | Node *prevNode() const { return prev; } |
41 | Node *parentNode() const { return parent; } | 41 | Node *parentNode() const { return parent; } |
42 | Node *lastChild() const { return last; } | 42 | Node *lastChild() const { return last; } |
43 | Node *firstChild() const { return first; } | 43 | Node *firstChild() const { return first; } |
44 | 44 | ||
45 | void setTagName( const QString &s ) { tagN = s; } | 45 | void setTagName( const QString &s ) { tagN = s; } |
46 | QString tagName() const { return tagN; } | 46 | QString tagName() const { return tagN; } |
47 | void setData( const QString &s ) { dt = s; } | 47 | void setData( const QString &s ) { dt = s; } |
48 | QString data() const { return dt; } | 48 | QString data() const { return dt; } |
49 | QString subData(const QString& tag) const; | 49 | QString subData(const QString& tag) const; |
50 | void appendData( const QString s ) { dt += s; } | 50 | void appendData( const QString s ) { dt += s; } |
51 | 51 | ||
52 | 52 | ||
53 | private: | 53 | private: |
54 | QMap<QString, QString> attributes; | 54 | QMap<QString, QString> attributes; |
55 | QString dt, tagN; | 55 | QString dt, tagN; |
56 | 56 | ||
57 | Node *parent, *prev, *next, *first, *last; | 57 | Node *parent, *prev, *next, *first, *last; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | class XmlHandlerPrivate; | 60 | class XmlHandlerPrivate; |
61 | class XmlHandler : public QXmlDefaultHandler | 61 | class XmlHandler : public QXmlDefaultHandler |
62 | { | 62 | { |
63 | public: | 63 | public: |
64 | XmlHandler(); | 64 | XmlHandler(); |
65 | ~XmlHandler(); | 65 | ~XmlHandler(); |
66 | 66 | ||
67 | bool startDocument(); | 67 | bool startDocument(); |
68 | bool endDocument(); | 68 | bool endDocument(); |
69 | bool startElement( const QString &ns, const QString &ln, const QString &qName, | 69 | bool startElement( const QString &ns, const QString &ln, const QString &qName, |
70 | const QXmlAttributes &attr ); | 70 | const QXmlAttributes &attr ); |
71 | bool endElement( const QString &ns, const QString &ln, const QString &qName ); | 71 | bool endElement( const QString &ns, const QString &ln, const QString &qName ); |
72 | bool characters( const QString &ch ); | 72 | bool characters( const QString &ch ); |
73 | 73 | ||
74 | Node *firstNode() const { return tree; } | 74 | Node *firstNode() const { return tree; } |
75 | 75 | ||
76 | private: | 76 | private: |
77 | Node *node, *tree; | 77 | Node *node, *tree; |
78 | XmlHandlerPrivate *d; | 78 | XmlHandlerPrivate *d; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | #endif | 83 | #endif |