summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/atom.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3/atom.h')
-rw-r--r--tools/qdoc3/atom.h87
1 files changed, 58 insertions, 29 deletions
diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h
index e3b993e..dbb1a8b 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
@@ -72,9 +72,9 @@ class Atom
CodeOld,
CodeQuoteArgument,
CodeQuoteCommand,
- Div,
+ DivLeft, // 16
+ DivRight, // 17
#ifdef QDOC_QML
- EndDiv,
EndQmlText,
#endif
FootnoteLeft,
@@ -101,10 +101,10 @@ class Atom
ListLeft,
ListItemNumber,
ListTagLeft, // 40
- ListTagRight, // 41
- ListItemLeft, // 42
- ListItemRight, // 43
- ListRight, // 44
+ ListTagRight,
+ ListItemLeft,
+ ListItemRight,
+ ListRight,
Nop,
ParaLeft,
ParaRight,
@@ -115,7 +115,7 @@ class Atom
QuotationLeft, // 50
QuotationRight,
RawString,
- SectionLeft, // 53
+ SectionLeft,
SectionRight,
SectionHeadingLeft,
SectionHeadingRight,
@@ -125,8 +125,8 @@ class Atom
SnippetCommand, // 60
SnippetIdentifier,
SnippetLocation,
- String, // 63
- TableLeft, // 64
+ String,
+ TableLeft,
TableRight,
TableHeaderLeft,
TableHeaderRight,
@@ -135,30 +135,57 @@ class Atom
TableItemLeft, // 70
TableItemRight,
TableOfContents,
- Target, // 73
+ Target,
UnhandledFormat,
UnknownCommand,
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_;
@@ -166,6 +193,7 @@ class Atom
static QString ITALIC_;
static QString LINK_;
static QString PARAMETER_;
+ static QString SPAN_;
static QString SUBSCRIPT_;
static QString SUPERSCRIPT_;
static QString TELETYPE_;
@@ -181,9 +209,9 @@ class Atom
static QString UPPERROMAN_;
private:
- Atom *nxt;
+ Atom* nxt;
Type typ;
- QString str;
+ QStringList strs;
};
#define ATOM_FORMATTING_BOLD "bold"
@@ -191,6 +219,7 @@ class Atom
#define ATOM_FORMATTING_ITALIC "italic"
#define ATOM_FORMATTING_LINK "link"
#define ATOM_FORMATTING_PARAMETER "parameter"
+#define ATOM_FORMATTING_SPAN "span "
#define ATOM_FORMATTING_SUBSCRIPT "subscript"
#define ATOM_FORMATTING_SUPERSCRIPT "superscript"
#define ATOM_FORMATTING_TELETYPE "teletype"