diff options
Diffstat (limited to 'src/tools/qdoc/atom.cpp')
-rw-r--r-- | src/tools/qdoc/atom.cpp | 76 |
1 files changed, 55 insertions, 21 deletions
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp index 6f9da3790d..5c699b0546 100644 --- a/src/tools/qdoc/atom.cpp +++ b/src/tools/qdoc/atom.cpp @@ -42,31 +42,12 @@ #include <qregexp.h> #include "atom.h" #include "location.h" +#include "qdocdatabase.h" #include <stdio.h> +#include <qdebug.h> QT_BEGIN_NAMESPACE -QLatin1String Atom::BOLD_ ("bold"); -QLatin1String Atom::INDEX_ ("index"); -QLatin1String Atom::ITALIC_ ("italic"); -QLatin1String Atom::LINK_ ("link"); -QLatin1String Atom::PARAMETER_ ("parameter"); -QLatin1String Atom::SPAN_ ("span"); -QLatin1String Atom::SUBSCRIPT_ ("subscript"); -QLatin1String Atom::SUPERSCRIPT_ ("superscript"); -QLatin1String Atom::TELETYPE_ ("teletype"); -QLatin1String Atom::UICONTROL_ ("uicontrol"); -QLatin1String Atom::UNDERLINE_ ("underline"); - -QLatin1String Atom::BULLET_ ("bullet"); -QLatin1String Atom::TAG_ ("tag"); -QLatin1String Atom::VALUE_ ("value"); -QLatin1String Atom::LOWERALPHA_ ("loweralpha"); -QLatin1String Atom::LOWERROMAN_ ("lowerroman"); -QLatin1String Atom::NUMERIC_ ("numeric"); -QLatin1String Atom::UPPERALPHA_ ("upperalpha"); -QLatin1String Atom::UPPERROMAN_ ("upperroman"); - /*! \class Atom \brief The Atom class is the fundamental unit for representing documents internally. @@ -387,4 +368,57 @@ void Atom::dump() const str.toLatin1().data()); } +/*! + The only constructor for LinkAtom. It only create an Atom + of type Atom::Link with \a p1 being the link text. \a p2 + contains some search parameters. + */ +LinkAtom::LinkAtom(const QString& p1, const QString& p2) + : Atom(p1), genus_(DontCare), goal_(Node::NoType), domain_(0) +{ + QStringList params = p2.toLower().split(QLatin1Char(' ')); + foreach (const QString& p, params) { + if (!domain_) { + domain_ = QDocDatabase::qdocDB()->findTree(p); + if (domain_) + continue; + } + if (goal_ == Node::NoType) { + goal_ = Node::goal(p); + if (goal_ != Node::NoType) + continue; + } + if (p == "qml") + genus_ = QML; + else if (p == "cpp") + genus_ = CPP; + } +} + +/*! + Standard copy constructor of LinkAtom \a t. + */ +LinkAtom::LinkAtom(const LinkAtom& t) + : Atom(Link, t.string()), + genus_(t.genus_), + goal_(t.goal_), + domain_(t.domain_) +{ + // nothing +} + +/*! + Special copy constructor of LinkAtom \a t, where + where the new LinkAtom will not be the first one + in the list. + */ +LinkAtom::LinkAtom(Atom* previous, const LinkAtom& t) + : Atom(previous, Link, t.string()), + genus_(t.genus_), + goal_(t.goal_), + domain_(t.domain_) +{ + previous->next_ = this; +} + QT_END_NAMESPACE |