diff options
author | Martin Smith <martin.smith@nokia.com> | 2011-01-14 13:02:57 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2011-01-14 13:02:57 (GMT) |
commit | 74f63cebc430ef6634917577783dafeed9a233d5 (patch) | |
tree | 663d030b0ca0f6dba36260aa542d11c62792a7d8 /tools/qdoc3/atom.h | |
parent | 02d904d5983ff0597f52d8d6ec76439f81da6504 (diff) | |
download | Qt-74f63cebc430ef6634917577783dafeed9a233d5.zip Qt-74f63cebc430ef6634917577783dafeed9a233d5.tar.gz Qt-74f63cebc430ef6634917577783dafeed9a233d5.tar.bz2 |
qdoc: Added colorizing of individual table cells.
Diffstat (limited to 'tools/qdoc3/atom.h')
-rw-r--r-- | tools/qdoc3/atom.h | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h index 739d8e3..c2b7cd6 100644 --- a/tools/qdoc3/atom.h +++ b/tools/qdoc3/atom.h @@ -46,7 +46,7 @@ #ifndef ATOM_H #define ATOM_H -#include <qstring.h> +#include <qstringlist.h> #define QDOC_QML @@ -137,24 +137,51 @@ class Atom Last = UnknownCommand }; - Atom(Type type, const QString &string = "") - : nxt(0), typ(type), str(string) { } - Atom(Atom *prev, Type type, const QString &string = "") - : nxt(prev->nxt), typ(type), str(string) { prev->nxt = this; } - - void appendChar(QChar ch) { str += ch; } - void appendString(const QString& string) { str += string; } - void chopString() { str.chop(1); } - void setString(const QString &string) { str = string; } - Atom *next() { return nxt; } - void setNext(Atom *newNext) { nxt = newNext; } - - const Atom *next() const { return nxt; } - const Atom *next(Type t) const; - const Atom *next(Type t, const QString& s) const; + Atom(Type type, const QString& string = "") + : nxt(0), typ(type) + { + strs << string; + } + + Atom(Type type, const QString& p1, const QString& p2) + : nxt(0), typ(type) + { + strs << p1; + if (!p2.isEmpty()) + strs << p2; + } + + Atom(Atom* prev, Type type, const QString& string = "") + : nxt(prev->nxt), typ(type) + { + strs << string; + prev->nxt = this; + } + + Atom(Atom* prev, Type type, const QString& p1, const QString& p2) + : nxt(prev->nxt), typ(type) + { + strs << p1; + if (!p2.isEmpty()) + strs << p2; + prev->nxt = this; + } + + void appendChar(QChar ch) { strs[0] += ch; } + void appendString(const QString& string) { strs[0] += string; } + void chopString() { strs[0].chop(1); } + void setString(const QString& string) { strs[0] = string; } + Atom* next() { return nxt; } + void setNext(Atom* newNext) { nxt = newNext; } + + const Atom* next() const { return nxt; } + const Atom* next(Type t) const; + const Atom* next(Type t, const QString& s) const; Type type() const { return typ; } QString typeString() const; - const QString& string() const { return str; } + const QString& string() const { return strs[0]; } + const QString& string(int i) const { return strs[i]; } + int count() const { return strs.size(); } void dump() const; static QString BOLD_; @@ -177,9 +204,9 @@ class Atom static QString UPPERROMAN_; private: - Atom *nxt; + Atom* nxt; Type typ; - QString str; + QStringList strs; }; #define ATOM_FORMATTING_BOLD "bold" |