author | alwin <alwin> | 2004-02-22 23:56:05 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-22 23:56:05 (UTC) |
commit | eba25a5ebeca30b7124e7fae80685dbd1c9a985d (patch) (unidiff) | |
tree | d62dd266e9b57f3eae34612f5d0fc4cf0b625c20 /noncore/net/mailit/textparser.h | |
parent | 666a49773d06ac94c19996d763854725c2f7a578 (diff) | |
download | opie-eba25a5ebeca30b7124e7fae80685dbd1c9a985d.zip opie-eba25a5ebeca30b7124e7fae80685dbd1c9a985d.tar.gz opie-eba25a5ebeca30b7124e7fae80685dbd1c9a985d.tar.bz2 |
moved mailit into unsupported area 'cause replaced by opiemail3
Diffstat (limited to 'noncore/net/mailit/textparser.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/textparser.h | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/noncore/net/mailit/textparser.h b/noncore/net/mailit/textparser.h deleted file mode 100644 index 03bb6d5..0000000 --- a/noncore/net/mailit/textparser.h +++ b/dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qt Palmtop Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #include <qobject.h> | ||
21 | #include <qstring.h> | ||
22 | |||
23 | #ifndef TEXTPARSER_H | ||
24 | #define TEXTPARSER_H | ||
25 | |||
26 | enum t_strType { Word, Number}; | ||
27 | enum t_lineType {NewLine, LastLine}; | ||
28 | |||
29 | const uint MAX_ELEMENTS = 200; //Should be dynamic | ||
30 | const uint MAX_LINES = 500; //Should be dynamic | ||
31 | |||
32 | struct t_splitElm | ||
33 | { | ||
34 | QChar separator; | ||
35 | int strType; | ||
36 | QString str; | ||
37 | }; | ||
38 | |||
39 | struct t_splitLine | ||
40 | { | ||
41 | t_lineType lineType; | ||
42 | QString str; //a bit redundant... | ||
43 | t_splitElm elm[MAX_ELEMENTS]; | ||
44 | int elmCount; | ||
45 | }; | ||
46 | |||
47 | class TextParser: public QObject | ||
48 | { | ||
49 | Q_OBJECT | ||
50 | |||
51 | public: | ||
52 | TextParser(const QString &in, const QString &lineBreak); | ||
53 | TextParser(const QString &in, const QString &lineBreak, const QString &sep); | ||
54 | int find(const QString &target, QChar sep, int pos, bool upperCase); | ||
55 | int elmCount(); | ||
56 | QChar separatorAt(int pos); | ||
57 | QChar nextSeparator(); | ||
58 | bool hasNextSeparator(); | ||
59 | QString wordAt(int pos); | ||
60 | QString nextWord(); | ||
61 | bool hasNextWord(); | ||
62 | QString getString(int *pos, QChar stop, bool lineEnd); | ||
63 | QString getNextLine(); | ||
64 | bool hasNextLine(); | ||
65 | int endLinePos(int pos); | ||
66 | |||
67 | private: | ||
68 | void init(); | ||
69 | void createSeparators(); | ||
70 | t_splitLine nextLine(); | ||
71 | void split(); | ||
72 | t_splitLine splitLine(t_splitLine line); | ||
73 | bool isSeparator(QChar chr); | ||
74 | t_splitLine splitDone[MAX_LINES]; | ||
75 | int getLineReference(int pos, int *line, int *inLinePos); | ||
76 | |||
77 | int lineCount, linePos, totalElmCount; | ||
78 | int separatorPos, wordPos; | ||
79 | QString data, separators, lineSep; | ||
80 | int sepAtLine, sepAtPosElm; | ||
81 | int wordAtLine, wordAtPosElm; | ||
82 | int atLine, atPosElm; | ||
83 | }; | ||
84 | |||
85 | #endif | ||