qdoc: More data member name changes

In preparation for refactoring the Node class hierarchy,
the names of a few enum types and the functions that set
and get them are changed so that they will not be confused
with other uses of the word Type.

Change-Id: I0496b46e5d7adffccadcb464aedb2806728e781d
Task-number: QTBUG-45450
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This commit is contained in:
Martin Smith 2015-04-10 12:54:57 +02:00
parent 02a13a86fa
commit 8a2645b8f0
29 changed files with 171 additions and 171 deletions

View File

@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
\also Text \also Text
*/ */
/*! \enum Atom::Type /*! \enum Atom::AtomType
\value AbstractLeft \value AbstractLeft
\value AbstractRight \value AbstractRight
@ -237,27 +237,27 @@ static const struct {
{ 0, 0 } { 0, 0 }
}; };
/*! \fn Atom::Atom(Type type, const QString& string) /*! \fn Atom::Atom(AtomType type, const QString& string)
Constructs an atom of the specified \a type with the single Constructs an atom of the specified \a type with the single
parameter \a string and does not put the new atom in a list. parameter \a string and does not put the new atom in a list.
*/ */
/*! \fn Atom::Atom(Type type, const QString& p1, const QString& p2) /*! \fn Atom::Atom(AtomType type, const QString& p1, const QString& p2)
Constructs an atom of the specified \a type with the two Constructs an atom of the specified \a type with the two
parameters \a p1 and \a p2 and does not put the new atom parameters \a p1 and \a p2 and does not put the new atom
in a list. in a list.
*/ */
/*! \fn Atom(Atom *previous, Type type, const QString& string) /*! \fn Atom(Atom *previous, AtomType type, const QString& string)
Constructs an atom of the specified \a type with the single Constructs an atom of the specified \a type with the single
parameter \a string and inserts the new atom into the list parameter \a string and inserts the new atom into the list
after the \a previous atom. after the \a previous atom.
*/ */
/*! \fn Atom::Atom(Atom* previous, Type type, const QString& p1, const QString& p2) /*! \fn Atom::Atom(Atom* previous, AtomType type, const QString& p1, const QString& p2)
Constructs an atom of the specified \a type with the two Constructs an atom of the specified \a type with the two
parameters \a p1 and \a p2 and inserts the new atom into parameters \a p1 and \a p2 and inserts the new atom into
@ -289,19 +289,19 @@ static const struct {
*/ */
/*! /*!
Return the next Atom in the list if it is of Type \a t. Return the next Atom in the list if it is of AtomType \a t.
Otherwise return 0. Otherwise return 0.
*/ */
const Atom* Atom::next(Type t) const const Atom* Atom::next(AtomType t) const
{ {
return (next_ && (next_->type() == t)) ? next_ : 0; return (next_ && (next_->type() == t)) ? next_ : 0;
} }
/*! /*!
Return the next Atom in the list if it is of Type \a t Return the next Atom in the list if it is of AtomType \a t
and its string part is \a s. Otherwise return 0. and its string part is \a s. Otherwise return 0.
*/ */
const Atom* Atom::next(Type t, const QString& s) const const Atom* Atom::next(AtomType t, const QString& s) const
{ {
return (next_ && (next_->type() == t) && (next_->string() == s)) ? next_ : 0; return (next_ && (next_->type() == t) && (next_->string() == s)) ? next_ : 0;
} }
@ -311,7 +311,7 @@ const Atom* Atom::next(Type t, const QString& s) const
\also type(), string() \also type(), string()
*/ */
/*! \fn Type Atom::type() const /*! \fn AtomType Atom::type() const
Return the type of this atom. Return the type of this atom.
\also string(), next() \also string(), next()
*/ */

View File

@ -46,7 +46,7 @@ class LinkAtom;
class Atom class Atom
{ {
public: public:
enum Type { enum AtomType {
AbstractLeft, AbstractLeft,
AbstractRight, AbstractRight,
AnnotatedList, AnnotatedList,
@ -143,13 +143,13 @@ public:
strs << string; strs << string;
} }
Atom(Type type, const QString& string = "") Atom(AtomType type, const QString& string = "")
: next_(0), type_(type) : next_(0), type_(type)
{ {
strs << string; strs << string;
} }
Atom(Type type, const QString& p1, const QString& p2) Atom(AtomType type, const QString& p1, const QString& p2)
: next_(0), type_(type) : next_(0), type_(type)
{ {
strs << p1; strs << p1;
@ -157,14 +157,14 @@ public:
strs << p2; strs << p2;
} }
Atom(Atom* previous, Type type, const QString& string = "") Atom(Atom* previous, AtomType type, const QString& string = "")
: next_(previous->next_), type_(type) : next_(previous->next_), type_(type)
{ {
strs << string; strs << string;
previous->next_ = this; previous->next_ = this;
} }
Atom(Atom* previous, Type type, const QString& p1, const QString& p2) Atom(Atom* previous, AtomType type, const QString& p1, const QString& p2)
: next_(previous->next_), type_(type) : next_(previous->next_), type_(type)
{ {
strs << p1; strs << p1;
@ -183,9 +183,9 @@ public:
void setNext(Atom* newNext) { next_ = newNext; } void setNext(Atom* newNext) { next_ = newNext; }
const Atom* next() const { return next_; } const Atom* next() const { return next_; }
const Atom* next(Type t) const; const Atom* next(AtomType t) const;
const Atom* next(Type t, const QString& s) const; const Atom* next(AtomType t, const QString& s) const;
Type type() const { return type_; } AtomType type() const { return type_; }
QString typeString() const; QString typeString() const;
const QString& string() const { return strs[0]; } const QString& string() const { return strs[0]; }
const QString& string(int i) const { return strs[i]; } const QString& string(int i) const { return strs[i]; }
@ -197,14 +197,14 @@ public:
virtual Node::Genus genus() { return Node::DontCare; } virtual Node::Genus genus() { return Node::DontCare; }
virtual bool specifiesDomain() { return false; } virtual bool specifiesDomain() { return false; }
virtual Tree* domain() { return 0; } virtual Tree* domain() { return 0; }
virtual Node::Type goal() { return Node::NoType; } virtual Node::NodeType goal() { return Node::NoType; }
virtual const QString& error() { return noError_; } virtual const QString& error() { return noError_; }
virtual void resolveSquareBracketParams() { } virtual void resolveSquareBracketParams() { }
protected: protected:
static QString noError_; static QString noError_;
Atom* next_; Atom* next_;
Type type_; AtomType type_;
QStringList strs; QStringList strs;
}; };
@ -220,14 +220,14 @@ class LinkAtom : public Atom
virtual Node::Genus genus() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return genus_; } virtual Node::Genus genus() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return genus_; }
virtual bool specifiesDomain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return (domain_ != 0); } virtual bool specifiesDomain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return (domain_ != 0); }
virtual Tree* domain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return domain_; } virtual Tree* domain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return domain_; }
virtual Node::Type goal() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return goal_; } virtual Node::NodeType goal() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return goal_; }
virtual const QString& error() Q_DECL_OVERRIDE { return error_; } virtual const QString& error() Q_DECL_OVERRIDE { return error_; }
virtual void resolveSquareBracketParams() Q_DECL_OVERRIDE; virtual void resolveSquareBracketParams() Q_DECL_OVERRIDE;
protected: protected:
bool resolved_; bool resolved_;
Node::Genus genus_; Node::Genus genus_;
Node::Type goal_; Node::NodeType goal_;
Tree* domain_; Tree* domain_;
QString error_; QString error_;
QString squareBracketParams_; QString squareBracketParams_;

View File

@ -127,7 +127,7 @@ public:
virtual bool recognizeCode(const QString& code) = 0; virtual bool recognizeCode(const QString& code) = 0;
virtual bool recognizeExtension(const QString& ext) = 0; virtual bool recognizeExtension(const QString& ext) = 0;
virtual bool recognizeLanguage(const QString& lang) = 0; virtual bool recognizeLanguage(const QString& lang) = 0;
virtual Atom::Type atomType() const = 0; virtual Atom::AtomType atomType() const = 0;
virtual QString markedUpCode(const QString& code, virtual QString markedUpCode(const QString& code,
const Node *relative, const Node *relative,
const Location &location) = 0; const Location &location) = 0;

View File

@ -426,21 +426,21 @@ void CodeParser::checkModuleInclusion(Node* n)
#if 0 #if 0
case Node::Document: case Node::Document:
if (n->access() != Node::Private && !n->doc().isEmpty()) { if (n->access() != Node::Private && !n->doc().isEmpty()) {
if (n->subType() == Node::HeaderFile) { if (n->docSubtype() == Node::HeaderFile) {
#if 0 #if 0
n->doc().location().warning(tr("Header file with title \"%1\" has no \\inmodule command; " n->doc().location().warning(tr("Header file with title \"%1\" has no \\inmodule command; "
"using project name by default: %2") "using project name by default: %2")
.arg(n->title()).arg(Generator::defaultModuleName())); .arg(n->title()).arg(Generator::defaultModuleName()));
#endif #endif
} }
else if (n->subType() == Node::Page) { else if (n->docSubtype() == Node::Page) {
#if 0 #if 0
n->doc().location().warning(tr("Page with title \"%1\" has no \\inmodule command; " n->doc().location().warning(tr("Page with title \"%1\" has no \\inmodule command; "
"using project name by default: %2") "using project name by default: %2")
.arg(n->title()).arg(Generator::defaultModuleName())); .arg(n->title()).arg(Generator::defaultModuleName()));
#endif #endif
} }
else if (n->subType() == Node::Example) { else if (n->docSubtype() == Node::Example) {
#if 0 #if 0
n->doc().location().warning(tr("Example with title \"%1\" has no \\inmodule command; " n->doc().location().warning(tr("Example with title \"%1\" has no \\inmodule command; "
"using project name by default: %2") "using project name by default: %2")

View File

@ -103,7 +103,7 @@ bool CppCodeMarker::recognizeLanguage(const QString &lang)
/*! /*!
Returns the type of atom used to represent C++ code in the documentation. Returns the type of atom used to represent C++ code in the documentation.
*/ */
Atom::Type CppCodeMarker::atomType() const Atom::AtomType CppCodeMarker::atomType() const
{ {
return Atom::Code; return Atom::Code;
} }

View File

@ -53,7 +53,7 @@ public:
virtual bool recognizeCode(const QString& code) Q_DECL_OVERRIDE; virtual bool recognizeCode(const QString& code) Q_DECL_OVERRIDE;
virtual bool recognizeExtension(const QString& ext) Q_DECL_OVERRIDE; virtual bool recognizeExtension(const QString& ext) Q_DECL_OVERRIDE;
virtual bool recognizeLanguage(const QString& lang) Q_DECL_OVERRIDE; virtual bool recognizeLanguage(const QString& lang) Q_DECL_OVERRIDE;
virtual Atom::Type atomType() const Q_DECL_OVERRIDE; virtual Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString& code, virtual QString markedUpCode(const QString& code,
const Node *relative, const Node *relative,
const Location &location) Q_DECL_OVERRIDE; const Location &location) Q_DECL_OVERRIDE;

View File

@ -408,7 +408,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
this way to allow the writer to refer to the entity this way to allow the writer to refer to the entity
without including the namespace qualifier. without including the namespace qualifier.
*/ */
Node::Type type = nodeTypeMap[command]; Node::NodeType type = nodeTypeMap[command];
QStringList paths = arg.first.split(QLatin1Char(' ')); QStringList paths = arg.first.split(QLatin1Char(' '));
QStringList path = paths[0].split("::"); QStringList path = paths[0].split("::");
Node *node = 0; Node *node = 0;
@ -572,7 +572,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName); QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName);
if (qmlType) { if (qmlType) {
bool attached = false; bool attached = false;
Node::Type nodeType = Node::QmlMethod; Node::NodeType nodeType = Node::QmlMethod;
if ((command == COMMAND_QMLSIGNAL) || if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_JSSIGNAL)) (command == COMMAND_JSSIGNAL))
nodeType = Node::QmlSignal; nodeType = Node::QmlSignal;
@ -2342,7 +2342,7 @@ bool CppCodeParser::makeFunctionNode(const QString& signature,
FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc, FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc,
const QString& sig, const QString& sig,
InnerNode* parent, InnerNode* parent,
Node::Type type, Node::NodeType type,
bool attached, bool attached,
QString qdoctag) QString qdoctag)
{ {

View File

@ -53,11 +53,11 @@ class CppCodeParser : public CodeParser
struct ExtraFuncData { struct ExtraFuncData {
InnerNode* root; // Used as the parent. InnerNode* root; // Used as the parent.
Node::Type type; // The node type: Function, etc. Node::NodeType type; // The node type: Function, etc.
bool isAttached; // If true, the method is attached. bool isAttached; // If true, the method is attached.
bool isMacro; // If true, we are parsing a macro signature. bool isMacro; // If true, we are parsing a macro signature.
ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { } ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { }
ExtraFuncData(InnerNode* r, Node::Type t, bool a) ExtraFuncData(InnerNode* r, Node::NodeType t, bool a)
: root(r), type(t), isAttached(a), isMacro(false) { } : root(r), type(t), isAttached(a), isMacro(false) { }
}; };
@ -141,7 +141,7 @@ protected:
FunctionNode* makeFunctionNode(const Doc& doc, FunctionNode* makeFunctionNode(const Doc& doc,
const QString& sig, const QString& sig,
InnerNode* parent, InnerNode* parent,
Node::Type type, Node::NodeType type,
bool attached, bool attached,
QString qdoctag); QString qdoctag);
void parseQiteratorDotH(const Location &location, const QString &filePath); void parseQiteratorDotH(const Location &location, const QString &filePath);
@ -151,7 +151,7 @@ protected:
void createExampleFileNodes(DocumentNode *dn); void createExampleFileNodes(DocumentNode *dn);
protected: protected:
QMap<QString, Node::Type> nodeTypeMap; QMap<QString, Node::NodeType> nodeTypeMap;
Tokenizer *tokenizer; Tokenizer *tokenizer;
int tok; int tok;
Node::Access access; Node::Access access;

View File

@ -469,16 +469,16 @@ private:
void endSection(int unit, int endCmd); void endSection(int unit, int endCmd);
void parseAlso(); void parseAlso();
void append(const QString &string); void append(const QString &string);
void append(Atom::Type type, const QString& string = QString()); void append(Atom::AtomType type, const QString& string = QString());
void append(Atom::Type type, const QString& p1, const QString& p2); void append(Atom::AtomType type, const QString& p1, const QString& p2);
void append(const QString& p1, const QString& p2); void append(const QString& p1, const QString& p2);
void appendChar(QChar ch); void appendChar(QChar ch);
void appendWord(const QString &word); void appendWord(const QString &word);
void appendToCode(const QString &code); void appendToCode(const QString &code);
void appendToCode(const QString &code, Atom::Type defaultType); void appendToCode(const QString &code, Atom::AtomType defaultType);
void startNewPara(); void startNewPara();
void enterPara(Atom::Type leftType = Atom::ParaLeft, void enterPara(Atom::AtomType leftType = Atom::ParaLeft,
Atom::Type rightType = Atom::ParaRight, Atom::AtomType rightType = Atom::ParaRight,
const QString& string = QString()); const QString& string = QString());
void leavePara(); void leavePara();
void leaveValue(); void leaveValue();
@ -525,8 +525,8 @@ private:
bool inTableRow; bool inTableRow;
bool inTableItem; bool inTableItem;
bool indexStartedPara; // ### rename bool indexStartedPara; // ### rename
Atom::Type pendingParaLeftType; Atom::AtomType pendingParaLeftType;
Atom::Type pendingParaRightType; Atom::AtomType pendingParaRightType;
QString pendingParaString; QString pendingParaString;
int braceDepth; int braceDepth;
@ -1984,9 +1984,9 @@ void DocParser::parseAlso()
} }
} }
void DocParser::append(Atom::Type type, const QString &string) void DocParser::append(Atom::AtomType type, const QString &string)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n"))) if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString(); priv->text.lastAtom()->chopString();
priv->text << Atom(type, string); priv->text << Atom(type, string);
@ -1994,15 +1994,15 @@ void DocParser::append(Atom::Type type, const QString &string)
void DocParser::append(const QString &string) void DocParser::append(const QString &string)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n"))) if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString(); priv->text.lastAtom()->chopString();
priv->text << Atom(string); // The Atom type is Link. priv->text << Atom(string); // The Atom type is Link.
} }
void DocParser::append(Atom::Type type, const QString& p1, const QString& p2) void DocParser::append(Atom::AtomType type, const QString& p1, const QString& p2)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n"))) if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString(); priv->text.lastAtom()->chopString();
priv->text << Atom(type, p1, p2); priv->text << Atom(type, p1, p2);
@ -2010,7 +2010,7 @@ void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
void DocParser::append(const QString& p1, const QString& p2) void DocParser::append(const QString& p1, const QString& p2)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n"))) if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString(); priv->text.lastAtom()->chopString();
if (p2.isEmpty()) if (p2.isEmpty())
@ -2043,15 +2043,15 @@ void DocParser::appendWord(const QString &word)
void DocParser::appendToCode(const QString& markedCode) void DocParser::appendToCode(const QString& markedCode)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript) if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
append(Atom::Qml); append(Atom::Qml);
priv->text.lastAtom()->appendString(markedCode); priv->text.lastAtom()->appendString(markedCode);
} }
void DocParser::appendToCode(const QString &markedCode, Atom::Type defaultType) void DocParser::appendToCode(const QString &markedCode, Atom::AtomType defaultType)
{ {
Atom::Type lastType = priv->text.lastAtom()->type(); Atom::AtomType lastType = priv->text.lastAtom()->type();
if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript) if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
append(defaultType, markedCode); append(defaultType, markedCode);
else else
@ -2064,8 +2064,8 @@ void DocParser::startNewPara()
enterPara(); enterPara();
} }
void DocParser::enterPara(Atom::Type leftType, void DocParser::enterPara(Atom::AtomType leftType,
Atom::Type rightType, Atom::AtomType rightType,
const QString& string) const QString& string)
{ {
if (paraState == OutsideParagraph) { if (paraState == OutsideParagraph) {

View File

@ -697,7 +697,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (node->type() == Node::Document) { if (node->type() == Node::Document) {
const DocumentNode *dn = static_cast<const DocumentNode *>(node); const DocumentNode *dn = static_cast<const DocumentNode *>(node);
if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) { if ((dn->docSubtype() == Node::File) || (dn->docSubtype() == Node::Image)) {
quiet = true; quiet = true;
} }
} }
@ -826,7 +826,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (dn->isExample()) { if (dn->isExample()) {
generateExampleFiles(dn, marker); generateExampleFiles(dn, marker);
} }
else if (dn->subType() == Node::File) { else if (dn->docSubtype() == Node::File) {
Text text; Text text;
Quoter quoter; Quoter quoter;
Doc::quoteFromFile(dn->doc().location(), quoter, dn->name()); Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
@ -867,7 +867,7 @@ void Generator::generateCollectionNode(CollectionNode* , CodeMarker* )
*/ */
void Generator::generateFileList(const DocumentNode* dn, void Generator::generateFileList(const DocumentNode* dn,
CodeMarker* marker, CodeMarker* marker,
Node::SubType subtype, Node::DocSubtype subtype,
const QString& tag) const QString& tag)
{ {
int count = 0; int count = 0;
@ -878,7 +878,7 @@ void Generator::generateFileList(const DocumentNode* dn,
<< Atom(Atom::ListLeft, openedList.styleString()); << Atom(Atom::ListLeft, openedList.styleString());
foreach (const Node* child, dn->childNodes()) { foreach (const Node* child, dn->childNodes()) {
if (child->subType() == subtype) { if (child->docSubtype() == subtype) {
++count; ++count;
QString file = child->name(); QString file = child->name();
if (subtype == Node::Image) { if (subtype == Node::Image) {
@ -982,11 +982,11 @@ void Generator::generateInnerNode(InnerNode* node)
if (node->isDocumentNode()) { if (node->isDocumentNode()) {
DocumentNode* docNode = static_cast<DocumentNode*>(node); DocumentNode* docNode = static_cast<DocumentNode*>(node);
if (docNode->subType() == Node::ExternalPage) if (docNode->docSubtype() == Node::ExternalPage)
return; return;
if (docNode->subType() == Node::Image) if (docNode->docSubtype() == Node::Image)
return; return;
if (docNode->subType() == Node::Page) { if (docNode->docSubtype() == Node::Page) {
if (node->count() > 0) if (node->count() > 0)
qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title())); qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
} }
@ -1705,7 +1705,7 @@ void Generator::initializeGenerator(const Config& config)
singleExec_ = config.getBool(CONFIG_SINGLEEXEC); singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
} }
bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType) bool Generator::matchAhead(const Atom *atom, Atom::AtomType expectedAtomType)
{ {
return atom->next() != 0 && atom->next()->type() == expectedAtomType; return atom->next() != 0 && atom->next()->type() == expectedAtomType;
} }
@ -1852,7 +1852,7 @@ void Generator::singularPlural(Text& text, const NodeList& nodes)
text << " are"; text << " are";
} }
int Generator::skipAtoms(const Atom *atom, Atom::Type type) const int Generator::skipAtoms(const Atom *atom, Atom::AtomType type) const
{ {
int skipAhead = 0; int skipAhead = 0;
atom = atom->next(); atom = atom->next();

View File

@ -130,10 +130,10 @@ protected:
const QString& qmlName); const QString& qmlName);
virtual bool generateText(const Text& text, const Node *relative, CodeMarker *marker); virtual bool generateText(const Text& text, const Node *relative, CodeMarker *marker);
virtual QString imageFileName(const Node *relative, const QString& fileBase); virtual QString imageFileName(const Node *relative, const QString& fileBase);
virtual int skipAtoms(const Atom *atom, Atom::Type type) const; virtual int skipAtoms(const Atom *atom, Atom::AtomType type) const;
virtual QString typeString(const Node *node); virtual QString typeString(const Node *node);
static bool matchAhead(const Atom *atom, Atom::Type expectedAtomType); static bool matchAhead(const Atom *atom, Atom::AtomType expectedAtomType);
static QString outputPrefix(const QString &nodeType); static QString outputPrefix(const QString &nodeType);
static void singularPlural(Text& text, const NodeList& nodes); static void singularPlural(Text& text, const NodeList& nodes);
static void supplementAlsoList(const Node *node, QList<Text> &alsoList); static void supplementAlsoList(const Node *node, QList<Text> &alsoList);
@ -152,7 +152,7 @@ protected:
void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker); void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker);
void generateFileList(const DocumentNode* dn, void generateFileList(const DocumentNode* dn,
CodeMarker* marker, CodeMarker* marker,
Node::SubType subtype, Node::DocSubtype subtype,
const QString& tag); const QString& tag);
void generateSince(const Node *node, CodeMarker *marker); void generateSince(const Node *node, CodeMarker *marker);
void generateStatus(const Node *node, CodeMarker *marker); void generateStatus(const Node *node, CodeMarker *marker);

View File

@ -122,7 +122,7 @@ void HelpProjectWriter::reset(const Config &config,
void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList &selectors) void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList &selectors)
{ {
QHash<QString, Node::Type> typeHash; QHash<QString, Node::NodeType> typeHash;
typeHash["namespace"] = Node::Namespace; typeHash["namespace"] = Node::Namespace;
typeHash["class"] = Node::Class; typeHash["class"] = Node::Class;
typeHash["fake"] = Node::Document; typeHash["fake"] = Node::Document;
@ -142,14 +142,14 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
typeHash["qmlclass"] = Node::QmlType; typeHash["qmlclass"] = Node::QmlType;
typeHash["qmlbasictype"] = Node::QmlBasicType; typeHash["qmlbasictype"] = Node::QmlBasicType;
QHash<QString, Node::SubType> subTypeHash; QHash<QString, Node::DocSubtype> docSubtypeHash;
subTypeHash["example"] = Node::Example; docSubtypeHash["example"] = Node::Example;
subTypeHash["headerfile"] = Node::HeaderFile; docSubtypeHash["headerfile"] = Node::HeaderFile;
subTypeHash["file"] = Node::File; docSubtypeHash["file"] = Node::File;
subTypeHash["page"] = Node::Page; docSubtypeHash["page"] = Node::Page;
subTypeHash["externalpage"] = Node::ExternalPage; docSubtypeHash["externalpage"] = Node::ExternalPage;
QSet<Node::SubType> allSubTypes = QSet<Node::SubType>::fromList(subTypeHash.values()); QSet<Node::DocSubtype> allSubTypes = QSet<Node::DocSubtype>::fromList(docSubtypeHash.values());
foreach (const QString &selector, selectors) { foreach (const QString &selector, selectors) {
QStringList pieces = selector.split(QLatin1Char(':')); QStringList pieces = selector.split(QLatin1Char(':'));
@ -161,13 +161,13 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList
QString lower = pieces[0].toLower(); QString lower = pieces[0].toLower();
pieces = pieces[1].split(QLatin1Char(',')); pieces = pieces[1].split(QLatin1Char(','));
if (typeHash.contains(lower)) { if (typeHash.contains(lower)) {
QSet<Node::SubType> subTypes; QSet<Node::DocSubtype> docSubtypes;
for (int i = 0; i < pieces.size(); ++i) { for (int i = 0; i < pieces.size(); ++i) {
QString lower = pieces[i].toLower(); QString lower = pieces[i].toLower();
if (subTypeHash.contains(lower)) if (docSubtypeHash.contains(lower))
subTypes.insert(subTypeHash[lower]); docSubtypes.insert(docSubtypeHash[lower]);
} }
subproject.selectors[typeHash[lower]] = subTypes; subproject.selectors[typeHash[lower]] = docSubtypes;
} }
} }
} }
@ -274,8 +274,8 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// Accept only fake nodes with subtypes contained in the selector's // Accept only fake nodes with subtypes contained in the selector's
// mask. // mask.
const DocumentNode *docNode = static_cast<const DocumentNode *>(node); const DocumentNode *docNode = static_cast<const DocumentNode *>(node);
if (subproject.selectors[node->type()].contains(docNode->subType()) && if (subproject.selectors[node->type()].contains(docNode->docSubtype()) &&
docNode->subType() != Node::ExternalPage && docNode->docSubtype() != Node::ExternalPage &&
!docNode->fullTitle().isEmpty()) { !docNode->fullTitle().isEmpty()) {
project.subprojects[i].nodes[objName] = node; project.subprojects[i].nodes[objName] = node;
@ -417,11 +417,11 @@ bool HelpProjectWriter::generateSection(HelpProject &project,
// attributes. // attributes.
case Node::Document: { case Node::Document: {
const DocumentNode *docNode = static_cast<const DocumentNode*>(node); const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
if (docNode->subType() != Node::ExternalPage && if (docNode->docSubtype() != Node::ExternalPage &&
docNode->subType() != Node::Image && docNode->docSubtype() != Node::Image &&
!docNode->fullTitle().isEmpty()) { !docNode->fullTitle().isEmpty()) {
if (docNode->subType() != Node::File) { if (docNode->docSubtype() != Node::File) {
if (docNode->doc().hasKeywords()) { if (docNode->doc().hasKeywords()) {
foreach (const Atom *keyword, docNode->doc().keywords()) { foreach (const Atom *keyword, docNode->doc().keywords()) {
if (!keyword->string().isEmpty()) { if (!keyword->string().isEmpty()) {
@ -467,7 +467,7 @@ void HelpProjectWriter::generateSections(HelpProject &project,
/* /*
Don't include index nodes in the help file. Or DITA map nodes. Don't include index nodes in the help file. Or DITA map nodes.
*/ */
if (node->isIndexNode() || node->subType() == Node::DitaMap) if (node->isIndexNode() || node->docSubtype() == Node::DitaMap)
return; return;
if (!generateSection(project, writer, node)) if (!generateSection(project, writer, node))
return; return;
@ -626,7 +626,7 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer
writer.writeAttribute("ref", href); writer.writeAttribute("ref", href);
writer.writeAttribute("title", docNode->fullTitle()); writer.writeAttribute("title", docNode->fullTitle());
if (docNode->subType() == Node::HeaderFile) if (docNode->docSubtype() == Node::HeaderFile)
addMembers(project, writer, node); addMembers(project, writer, node);
writer.writeEndElement(); // section writer.writeEndElement(); // section

View File

@ -50,7 +50,7 @@ struct SubProject
{ {
QString title; QString title;
QString indexTitle; QString indexTitle;
QHash<Node::Type, QSet<DocumentNode::SubType> > selectors; QHash<Node::NodeType, QSet<DocumentNode::DocSubtype> > selectors;
bool sortPages; bool sortPages;
QString type; QString type;
QHash<QString, const Node *> nodes; QHash<QString, const Node *> nodes;

View File

@ -1644,7 +1644,7 @@ void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
is DITA map page, write the node's contents as a dita is DITA map page, write the node's contents as a dita
map and return without doing anything else. map and return without doing anything else.
*/ */
if (dn->subType() == Node::Page && dn->pageType() == Node::DitaMapPage) { if (dn->docSubtype() == Node::Page && dn->pageType() == Node::DitaMapPage) {
const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn); const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
writeDitaMap(dmn); writeDitaMap(dmn);
return; return;
@ -1670,7 +1670,7 @@ void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
dn, dn,
marker); marker);
if (dn->subType() == Node::HeaderFile) { if (dn->docSubtype() == Node::HeaderFile) {
// Generate brief text and status for modules. // Generate brief text and status for modules.
generateBrief(dn, marker); generateBrief(dn, marker);
generateStatus(dn, marker); generateStatus(dn, marker);
@ -3744,9 +3744,9 @@ QString HtmlGenerator::fileBase(const Node *node) const
QString HtmlGenerator::fileName(const Node *node) QString HtmlGenerator::fileName(const Node *node)
{ {
if (node->type() == Node::Document) { if (node->type() == Node::Document) {
if (static_cast<const DocumentNode *>(node)->subType() == Node::ExternalPage) if (static_cast<const DocumentNode *>(node)->docSubtype() == Node::ExternalPage)
return node->name(); return node->name();
if (static_cast<const DocumentNode *>(node)->subType() == Node::Image) if (static_cast<const DocumentNode *>(node)->docSubtype() == Node::Image)
return node->name(); return node->name();
} }
return Generator::fileName(node); return Generator::fileName(node);
@ -3871,7 +3871,7 @@ QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const
QString link = (*node)->url(); QString link = (*node)->url();
if (link.isEmpty()) { if (link.isEmpty()) {
link = linkForNode(*node, relative); link = linkForNode(*node, relative);
if ((*node)->subType() == Node::Image) if ((*node)->docSubtype() == Node::Image)
link = "images/used-in-examples/" + link; link = "images/used-in-examples/" + link;
if (!ref.isEmpty()) if (!ref.isEmpty())
link += QLatin1Char('#') + ref; link += QLatin1Char('#') + ref;
@ -4511,7 +4511,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
writer.writeAttribute("docUrl", docUrl); writer.writeAttribute("docUrl", docUrl);
QStringList proFiles; QStringList proFiles;
foreach (const Node* child, en->childNodes()) { foreach (const Node* child, en->childNodes()) {
if (child->subType() == Node::File) { if (child->docSubtype() == Node::File) {
QString file = child->name(); QString file = child->name();
if (file.endsWith(".pro") || file.endsWith(".qmlproject")) { if (file.endsWith(".pro") || file.endsWith(".qmlproject")) {
proFiles << file; proFiles << file;
@ -4617,7 +4617,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
QString ename = en->name().mid(en->name().lastIndexOf('/')+1); QString ename = en->name().mid(en->name().lastIndexOf('/')+1);
QMap<int, const Node*> filesToOpen; QMap<int, const Node*> filesToOpen;
foreach (const Node* child, en->childNodes()) { foreach (const Node* child, en->childNodes()) {
if (child->subType() == Node::File) { if (child->docSubtype() == Node::File) {
QFileInfo fileInfo(child->name()); QFileInfo fileInfo(child->name());
QString fileName = fileInfo.fileName().toLower(); QString fileName = fileInfo.fileName().toLower();
// open .qml, .cpp and .h files with a // open .qml, .cpp and .h files with a
@ -4738,7 +4738,7 @@ void HtmlGenerator::reportOrphans(const InnerNode* parent)
case Node::QmlModule: case Node::QmlModule:
break; break;
case Node::Document: case Node::Document:
switch (child->subType()) { switch (child->docSubtype()) {
case Node::Example: case Node::Example:
break; break;
case Node::HeaderFile: case Node::HeaderFile:

View File

@ -95,7 +95,7 @@ bool JsCodeMarker::recognizeLanguage(const QString &language)
/*! /*!
Returns the type of atom used to represent JavaScript code in the documentation. Returns the type of atom used to represent JavaScript code in the documentation.
*/ */
Atom::Type JsCodeMarker::atomType() const Atom::AtomType JsCodeMarker::atomType() const
{ {
return Atom::JavaScript; return Atom::JavaScript;
} }

View File

@ -53,7 +53,7 @@ public:
virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE; virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE; virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE; virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
virtual Atom::Type atomType() const Q_DECL_OVERRIDE; virtual Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code, virtual QString markedUpCode(const QString &code,
const Node *relative, const Node *relative,

View File

@ -44,16 +44,16 @@ QT_BEGIN_NAMESPACE
int Node::propertyGroupCount_ = 0; int Node::propertyGroupCount_ = 0;
QStringMap Node::operators_; QStringMap Node::operators_;
QMap<QString,Node::Type> Node::goals_; QMap<QString,Node::NodeType> Node::goals_;
/*! /*!
Initialize the map of search goals. This is called once Initialize the map of search goals. This is called once
by QDocDatabase::initializeDB(). The map key is a string by QDocDatabase::initializeDB(). The map key is a string
representing a value in the enum Node::Type. The map value representing a value in the enum Node::NodeType. The map value
is the enum value. is the enum value.
There should be an entry in the map for each value in the There should be an entry in the map for each value in the
Type enum. NodeType enum.
*/ */
void Node::initialize() void Node::initialize()
{ {
@ -160,8 +160,8 @@ QString Node::fullName(const Node* relative) const
match is found, return false. match is found, return false.
\a types is a list of type/subtype pairs, where the first \a types is a list of type/subtype pairs, where the first
value in the pair is a Node::Type, and the second value is value in the pair is a Node::NodeType, and the second value is
a Node::SubType. The second value is used in the match if a Node::DocSubtype. The second value is used in the match if
this node's type is Node::Document. this node's type is Node::Document.
*/ */
bool Node::match(const NodeTypeList& types) const bool Node::match(const NodeTypeList& types) const
@ -169,7 +169,7 @@ bool Node::match(const NodeTypeList& types) const
for (int i=0; i<types.size(); ++i) { for (int i=0; i<types.size(); ++i) {
if (type() == types.at(i).first) { if (type() == types.at(i).first) {
if (type() == Node::Document) { if (type() == Node::Document) {
if (subType() == types.at(i).second) if (docSubtype() == types.at(i).second)
return true; return true;
} }
else else
@ -200,7 +200,7 @@ void Node::setDoc(const Doc& doc, bool replace)
given \a parent and \a name. The new node is added to the given \a parent and \a name. The new node is added to the
parent's child list. parent's child list.
*/ */
Node::Node(Type type, InnerNode *parent, const QString& name) Node::Node(NodeType type, InnerNode *parent, const QString& name)
: nodeType_((unsigned char) type), : nodeType_((unsigned char) type),
access_((unsigned char) Public), access_((unsigned char) Public),
safeness_((unsigned char) UnspecifiedSafeness), safeness_((unsigned char) UnspecifiedSafeness),
@ -320,7 +320,7 @@ QString Node::nodeTypeString() const
*/ */
QString Node::nodeTypeString(unsigned char t) QString Node::nodeTypeString(unsigned char t)
{ {
switch ((Type)t) { switch ((NodeType)t) {
case Namespace: case Namespace:
return "namespace"; return "namespace";
case Class: case Class:
@ -370,7 +370,7 @@ QString Node::nodeTypeString(unsigned char t)
*/ */
QString Node::nodeSubtypeString() const QString Node::nodeSubtypeString() const
{ {
return nodeSubtypeString(subType()); return nodeSubtypeString(docSubtype());
} }
/*! /*!
@ -380,7 +380,7 @@ QString Node::nodeSubtypeString() const
*/ */
QString Node::nodeSubtypeString(unsigned char t) QString Node::nodeSubtypeString(unsigned char t)
{ {
switch ((SubType)t) { switch ((DocSubtype)t) {
case Example: case Example:
return "example"; return "example";
case HeaderFile: case HeaderFile:
@ -395,7 +395,7 @@ QString Node::nodeSubtypeString(unsigned char t)
return "external page"; return "external page";
case DitaMap: case DitaMap:
return "ditamap"; return "ditamap";
case NoSubType: case NoSubtype:
default: default:
break; break;
} }
@ -773,7 +773,7 @@ void InnerNode::findChildren(const QString& name, NodeList& nodes) const
with the specified \a name is found but it is not of the with the specified \a name is found but it is not of the
specified \a type, 0 is returned. specified \a type, 0 is returned.
*/ */
Node* InnerNode::findChildNode(const QString& name, Type type) Node* InnerNode::findChildNode(const QString& name, NodeType type)
{ {
if (type == Function) if (type == Function)
return primaryFunctionMap.value(name); return primaryFunctionMap.value(name);
@ -1040,7 +1040,7 @@ NodeList InnerNode::overloads(const QString &funcName) const
Construct an inner node (i.e., not a leaf node) of the Construct an inner node (i.e., not a leaf node) of the
given \a type and having the given \a parent and \a name. given \a type and having the given \a parent and \a name.
*/ */
InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) InnerNode::InnerNode(NodeType type, InnerNode *parent, const QString& name)
: Node(type, parent, name) : Node(type, parent, name)
{ {
switch (type) { switch (type) {
@ -1317,7 +1317,7 @@ QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) cons
Constructs a leaf node named \a name of the specified Constructs a leaf node named \a name of the specified
\a type. The new leaf node becomes a child of \a parent. \a type. The new leaf node becomes a child of \a parent.
*/ */
LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name) LeafNode::LeafNode(NodeType type, InnerNode *parent, const QString& name)
: Node(type, parent, name) : Node(type, parent, name)
{ {
switch (type) { switch (type) {
@ -1344,7 +1344,7 @@ LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
documentation case where a \e{qmlproperty} command is used documentation case where a \e{qmlproperty} command is used
to override the QML definition of a QML property. to override the QML definition of a QML property.
*/ */
LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name) LeafNode::LeafNode(InnerNode* parent, NodeType type, const QString& name)
: Node(type, 0, name) : Node(type, 0, name)
{ {
setParent(parent); setParent(parent);
@ -1582,7 +1582,7 @@ QmlTypeNode* ClassNode::findQmlBaseNode()
which specifies the type of DocumentNode. The page type for which specifies the type of DocumentNode. The page type for
the page index is set here. the page index is set here.
*/ */
DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype) DocumentNode::DocumentNode(InnerNode* parent, const QString& name, DocSubtype subtype, Node::PageType ptype)
: InnerNode(Document, parent, name), nodeSubtype_(subtype) : InnerNode(Document, parent, name), nodeSubtype_(subtype)
{ {
setGenus(Node::DOC); setGenus(Node::DOC);
@ -1616,7 +1616,7 @@ void DocumentNode::setTitle(const QString &title)
/*! /*!
Returns the document node's full title, which is usually Returns the document node's full title, which is usually
just title(), but for some SubType values is different just title(), but for some DocSubtype values is different
from title() from title()
*/ */
QString DocumentNode::fullTitle() const QString DocumentNode::fullTitle() const
@ -1813,7 +1813,7 @@ FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
by \a type. It's parent is \a parent, and it's name is \a name. by \a type. It's parent is \a parent, and it's name is \a name.
If \a attached is true, it is an attached method or signal. If \a attached is true, it is an attached method or signal.
*/ */
FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached) FunctionNode::FunctionNode(NodeType type, InnerNode *parent, const QString& name, bool attached)
: LeafNode(type, parent, name), : LeafNode(type, parent, name),
metaness_(Plain), metaness_(Plain),
virtualness_(NonVirtual), virtualness_(NonVirtual),
@ -2569,7 +2569,7 @@ QString Node::idForNode() const
str = "js-method-" + parent_->name().toLower() + "-" + func->name(); str = "js-method-" + parent_->name().toLower() + "-" + func->name();
else if (parent_->type() == Document) { else if (parent_->type() == Document) {
qDebug() << "qdoc internal error: Node subtype not handled:" qDebug() << "qdoc internal error: Node subtype not handled:"
<< parent_->subType() << func->name(); << parent_->docSubtype() << func->name();
} }
else else
qDebug() << "qdoc internal error: Node type not handled:" qDebug() << "qdoc internal error: Node type not handled:"
@ -2594,7 +2594,7 @@ QString Node::idForNode() const
break; break;
case Node::Document: case Node::Document:
{ {
switch (subType()) { switch (docSubtype()) {
case Node::Page: case Node::Page:
case Node::HeaderFile: case Node::HeaderFile:
str = title(); str = title();
@ -2615,7 +2615,7 @@ QString Node::idForNode() const
break; break;
default: default:
qDebug() << "ERROR: A case was not handled in Node::idForNode():" qDebug() << "ERROR: A case was not handled in Node::idForNode():"
<< "subType():" << subType() << "type():" << type(); << "docSubtype():" << docSubtype() << "type():" << type();
break; break;
} }
} }
@ -2685,12 +2685,12 @@ QString Node::idForNode() const
break; break;
default: default:
qDebug() << "ERROR: A case was not handled in Node::idForNode():" qDebug() << "ERROR: A case was not handled in Node::idForNode():"
<< "type():" << type() << "subType():" << subType(); << "type():" << type() << "docSubtype():" << docSubtype();
break; break;
} }
if (str.isEmpty()) { if (str.isEmpty()) {
qDebug() << "ERROR: A link text was empty in Node::idForNode():" qDebug() << "ERROR: A link text was empty in Node::idForNode():"
<< "type():" << type() << "subType():" << subType() << "type():" << type() << "docSubtype():" << docSubtype()
<< "name():" << name() << "name():" << name()
<< "title():" << title(); << "title():" << title();
} }

View File

@ -71,7 +71,7 @@ class Node
Q_DECLARE_TR_FUNCTIONS(QDoc::Node) Q_DECLARE_TR_FUNCTIONS(QDoc::Node)
public: public:
enum Type { enum NodeType {
NoType, NoType,
Namespace, Namespace,
Class, Class,
@ -94,8 +94,8 @@ public:
LastType LastType
}; };
enum SubType { enum DocSubtype {
NoSubType, NoSubtype,
Example, Example,
HeaderFile, HeaderFile,
File, File,
@ -247,15 +247,15 @@ public:
virtual bool isInternal() const; virtual bool isInternal() const;
virtual void setDataType(const QString& ) { } virtual void setDataType(const QString& ) { }
virtual void setReadOnly(bool ) { } virtual void setReadOnly(bool ) { }
virtual Node* disambiguate(Type , SubType ) { return this; } virtual Node* disambiguate(NodeType , DocSubtype ) { return this; }
virtual bool wasSeen() const { return false; } virtual bool wasSeen() const { return false; }
virtual void appendGroupName(const QString& ) { } virtual void appendGroupName(const QString& ) { }
virtual QString element() const { return QString(); } virtual QString element() const { return QString(); }
virtual Tree* tree() const; virtual Tree* tree() const;
virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); } virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); }
bool isIndexNode() const { return indexNodeFlag_; } bool isIndexNode() const { return indexNodeFlag_; }
Type type() const { return (Type) nodeType_; } NodeType type() const { return (NodeType) nodeType_; }
virtual SubType subType() const { return NoSubType; } virtual DocSubtype docSubtype() const { return NoSubtype; }
bool match(const NodeTypeList& types) const; bool match(const NodeTypeList& types) const;
InnerNode* parent() const { return parent_; } InnerNode* parent() const { return parent_; }
const Node* root() const; const Node* root() const;
@ -327,10 +327,10 @@ public:
static int incPropertyGroupCount(); static int incPropertyGroupCount();
static void clearPropertyGroupCount(); static void clearPropertyGroupCount();
static void initialize(); static void initialize();
static Type goal(const QString& t) { return goals_.value(t); } static NodeType goal(const QString& t) { return goals_.value(t); }
protected: protected:
Node(Type type, InnerNode* parent, const QString& name); Node(NodeType type, InnerNode* parent, const QString& name);
private: private:
@ -358,7 +358,7 @@ private:
QString outSubDir_; QString outSubDir_;
static QStringMap operators_; static QStringMap operators_;
static int propertyGroupCount_; static int propertyGroupCount_;
static QMap<QString,Node::Type> goals_; static QMap<QString,Node::NodeType> goals_;
}; };
class InnerNode : public Node class InnerNode : public Node
@ -367,7 +367,7 @@ public:
virtual ~InnerNode(); virtual ~InnerNode();
Node* findChildNode(const QString& name, Node::Genus genus) const; Node* findChildNode(const QString& name, Node::Genus genus) const;
Node* findChildNode(const QString& name, Type type); Node* findChildNode(const QString& name, NodeType type);
virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE; virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE;
FunctionNode* findFunctionNode(const QString& name) const; FunctionNode* findFunctionNode(const QString& name) const;
FunctionNode* findFunctionNode(const FunctionNode* clone) const; FunctionNode* findFunctionNode(const FunctionNode* clone) const;
@ -407,7 +407,7 @@ public:
virtual void setOutputSubdirectory(const QString& t); virtual void setOutputSubdirectory(const QString& t);
protected: protected:
InnerNode(Type type, InnerNode* parent, const QString& name); InnerNode(NodeType type, InnerNode* parent, const QString& name);
private: private:
friend class Node; friend class Node;
@ -437,8 +437,8 @@ public:
virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; } virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; }
protected: protected:
LeafNode(Type type, InnerNode* parent, const QString& name); LeafNode(NodeType type, InnerNode* parent, const QString& name);
LeafNode(InnerNode* parent, Type type, const QString& name); LeafNode(InnerNode* parent, NodeType type, const QString& name);
}; };
class NamespaceNode : public InnerNode class NamespaceNode : public InnerNode
@ -544,7 +544,7 @@ public:
DocumentNode(InnerNode* parent, DocumentNode(InnerNode* parent,
const QString& name, const QString& name,
SubType subType, DocSubtype docSubtype,
PageType ptype); PageType ptype);
virtual ~DocumentNode() { } virtual ~DocumentNode() { }
@ -552,7 +552,7 @@ public:
virtual void setTitle(const QString &title) Q_DECL_OVERRIDE; virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; } virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
SubType subType() const Q_DECL_OVERRIDE { return nodeSubtype_; } DocSubtype docSubtype() const Q_DECL_OVERRIDE { return nodeSubtype_; }
virtual QString title() const Q_DECL_OVERRIDE { return title_; } virtual QString title() const Q_DECL_OVERRIDE { return title_; }
virtual QString fullTitle() const Q_DECL_OVERRIDE; virtual QString fullTitle() const Q_DECL_OVERRIDE;
virtual QString subTitle() const Q_DECL_OVERRIDE; virtual QString subTitle() const Q_DECL_OVERRIDE;
@ -560,13 +560,13 @@ public:
virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); } virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); }
virtual void setImageFileName(const QString& ) { } virtual void setImageFileName(const QString& ) { }
virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (subType() == Node::HeaderFile); } virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (docSubtype() == Node::HeaderFile); }
virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); } virtual bool isExample() const Q_DECL_OVERRIDE { return (docSubtype() == Node::Example); }
virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); } virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); }
virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; } virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; }
protected: protected:
SubType nodeSubtype_; DocSubtype nodeSubtype_;
QString title_; QString title_;
QString subtitle_; QString subtitle_;
}; };
@ -852,7 +852,7 @@ public:
enum Virtualness { NonVirtual, NormalVirtual, PureVirtual }; enum Virtualness { NonVirtual, NormalVirtual, PureVirtual };
FunctionNode(InnerNode* parent, const QString &name); FunctionNode(InnerNode* parent, const QString &name);
FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached); FunctionNode(NodeType type, InnerNode* parent, const QString &name, bool attached);
virtual ~FunctionNode() { } virtual ~FunctionNode() { }
void setReturnType(const QString& t) { returnType_ = t; } void setReturnType(const QString& t) { returnType_ = t; }
@ -1077,7 +1077,7 @@ public:
class CollectionNode : public InnerNode class CollectionNode : public InnerNode
{ {
public: public:
CollectionNode(Type type, CollectionNode(NodeType type,
InnerNode* parent, InnerNode* parent,
const QString& name, const QString& name,
Genus genus) : InnerNode(type, parent, name), seen_(false) Genus genus) : InnerNode(type, parent, name), seen_(false)

View File

@ -58,7 +58,7 @@ bool PlainCodeMarker::recognizeLanguage( const QString& /* lang */ )
return false; return false;
} }
Atom::Type PlainCodeMarker::atomType() const Atom::AtomType PlainCodeMarker::atomType() const
{ {
return Atom::Code; return Atom::Code;
} }

View File

@ -51,7 +51,7 @@ public:
bool recognizeCode( const QString& code ) Q_DECL_OVERRIDE; bool recognizeCode( const QString& code ) Q_DECL_OVERRIDE;
bool recognizeExtension( const QString& ext ) Q_DECL_OVERRIDE; bool recognizeExtension( const QString& ext ) Q_DECL_OVERRIDE;
bool recognizeLanguage( const QString& lang ) Q_DECL_OVERRIDE; bool recognizeLanguage( const QString& lang ) Q_DECL_OVERRIDE;
Atom::Type atomType() const Q_DECL_OVERRIDE; Atom::AtomType atomType() const Q_DECL_OVERRIDE;
QString markedUpCode( const QString& code, const Node *relative, const Location &location ) Q_DECL_OVERRIDE; QString markedUpCode( const QString& code, const Node *relative, const Location &location ) Q_DECL_OVERRIDE;
QString markedUpSynopsis( const Node *node, const Node *relative, QString markedUpSynopsis( const Node *node, const Node *relative,
SynopsisStyle style ) Q_DECL_OVERRIDE; SynopsisStyle style ) Q_DECL_OVERRIDE;

View File

@ -1515,7 +1515,7 @@ FunctionNode* QDocDatabase::findNodeInOpenNamespace(const QStringList& parentPat
This function only searches in the current primary tree. This function only searches in the current primary tree.
*/ */
Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::Type type) Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::NodeType type)
{ {
if (path.isEmpty()) if (path.isEmpty())
return 0; return 0;
@ -1626,7 +1626,7 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, Q
Tree* domain = 0; Tree* domain = 0;
Node::Genus genus = Node::DontCare; Node::Genus genus = Node::DontCare;
// Reserved for future use // Reserved for future use
//Node::Type goal = Node::NoType; //Node::NodeType goal = Node::NoType;
if (atom->isLinkAtom()) { if (atom->isLinkAtom()) {
domain = atom->domain(); domain = atom->domain();

View File

@ -103,7 +103,7 @@ class QDocForest
return 0; return 0;
} }
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) { Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) {
foreach (Tree* t, searchOrder()) { foreach (Tree* t, searchOrder()) {
Node* n = t->findNodeByNameAndType(path, type); Node* n = t->findNodeByNameAndType(path, type);
if (n) if (n)
@ -297,7 +297,7 @@ class QDocDatabase
void insertTarget(const QString& name, void insertTarget(const QString& name,
const QString& title, const QString& title,
TargetRec::Type type, TargetRec::TargetType type,
Node* node, Node* node,
int priority) { int priority) {
primaryTree()->insertTarget(name, title, type, node, priority); primaryTree()->insertTarget(name, title, type, node, priority);
@ -310,7 +310,7 @@ class QDocDatabase
return primaryTree()->findFunctionNode(parentPath, clone); return primaryTree()->findFunctionNode(parentPath, clone);
} }
FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone); FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone);
Node* findNodeInOpenNamespace(QStringList& path, Node::Type type); Node* findNodeInOpenNamespace(QStringList& path, Node::NodeType type);
const Node* checkForCollision(const QString& name) { const Node* checkForCollision(const QString& name) {
return primaryTree()->checkForCollision(name); return primaryTree()->checkForCollision(name);
} }
@ -336,7 +336,7 @@ class QDocDatabase
const DocumentNode* findDocumentNodeByTitle(const QString& title) { const DocumentNode* findDocumentNodeByTitle(const QString& title) {
return forest_.findDocumentNodeByTitle(title); return forest_.findDocumentNodeByTitle(title);
} }
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) { Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) {
return forest_.findNodeByNameAndType(path, type); return forest_.findNodeByNameAndType(path, type);
} }

View File

@ -342,7 +342,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else if ((element.nodeName() == "qmlmethod") || else if ((element.nodeName() == "qmlmethod") ||
(element.nodeName() == "qmlsignal") || (element.nodeName() == "qmlsignal") ||
(element.nodeName() == "qmlsignalhandler")) { (element.nodeName() == "qmlsignalhandler")) {
Node::Type t = Node::QmlMethod; Node::NodeType t = Node::QmlMethod;
if (element.nodeName() == "qmlsignal") if (element.nodeName() == "qmlsignal")
t = Node::QmlSignal; t = Node::QmlSignal;
else if (element.nodeName() == "qmlsignalhandler") else if (element.nodeName() == "qmlsignalhandler")
@ -354,7 +354,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else if ((element.nodeName() == "jsmethod") || else if ((element.nodeName() == "jsmethod") ||
(element.nodeName() == "jssignal") || (element.nodeName() == "jssignal") ||
(element.nodeName() == "jssignalhandler")) { (element.nodeName() == "jssignalhandler")) {
Node::Type t = Node::QmlMethod; Node::NodeType t = Node::QmlMethod;
if (element.nodeName() == "jssignal") if (element.nodeName() == "jssignal")
t = Node::QmlSignal; t = Node::QmlSignal;
else if (element.nodeName() == "jssignalhandler") else if (element.nodeName() == "jssignalhandler")
@ -405,7 +405,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
node = cn; node = cn;
} }
else if (element.nodeName() == "page") { else if (element.nodeName() == "page") {
Node::SubType subtype; Node::DocSubtype subtype;
Node::PageType ptype = Node::NoPageType; Node::PageType ptype = Node::NoPageType;
QString attr = element.attribute("subtype"); QString attr = element.attribute("subtype");
if (attr == "example") { if (attr == "example") {
@ -726,7 +726,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
/* /*
Don't include index nodes in a new index file. Or DITA map nodes. Don't include index nodes in a new index file. Or DITA map nodes.
*/ */
if (node->isIndexNode() || node->subType() == Node::DitaMap) if (node->isIndexNode() || node->docSubtype() == Node::DitaMap)
return false; return false;
QString nodeName; QString nodeName;
@ -1019,7 +1019,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
*/ */
bool writeModuleName = false; bool writeModuleName = false;
const DocumentNode* docNode = static_cast<const DocumentNode*>(node); const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
switch (docNode->subType()) { switch (docNode->docSubtype()) {
case Node::Example: case Node::Example:
writer.writeAttribute("subtype", "example"); writer.writeAttribute("subtype", "example");
writeModuleName = true; writeModuleName = true;
@ -1316,7 +1316,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
bool external = false; bool external = false;
if (node->type() == Node::Document) { if (node->type() == Node::Document) {
const DocumentNode* docNode = static_cast<const DocumentNode*>(node); const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
if (docNode->subType() == Node::ExternalPage) if (docNode->docSubtype() == Node::ExternalPage)
external = true; external = true;
} }
foreach (const Atom* target, node->doc().targets()) { foreach (const Atom* target, node->doc().targets()) {

View File

@ -96,7 +96,7 @@ bool QmlCodeMarker::recognizeLanguage(const QString &language)
/*! /*!
Returns the type of atom used to represent QML code in the documentation. Returns the type of atom used to represent QML code in the documentation.
*/ */
Atom::Type QmlCodeMarker::atomType() const Atom::AtomType QmlCodeMarker::atomType() const
{ {
return Atom::Qml; return Atom::Qml;
} }

View File

@ -54,7 +54,7 @@ public:
virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE; virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE; virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE; virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
virtual Atom::Type atomType() const Q_DECL_OVERRIDE; virtual Atom::AtomType atomType() const Q_DECL_OVERRIDE;
virtual QString markedUpCode(const QString &code, virtual QString markedUpCode(const QString &code,
const Node *relative, const Node *relative,
const Location &location) Q_DECL_OVERRIDE; const Location &location) Q_DECL_OVERRIDE;

View File

@ -72,7 +72,7 @@ Text& Text::operator=(const Text& text)
return *this; return *this;
} }
Text& Text::operator<<(Atom::Type atomType) Text& Text::operator<<(Atom::AtomType atomType)
{ {
return operator<<(Atom(atomType)); return operator<<(Atom(atomType));
} }
@ -177,7 +177,7 @@ QString Text::toString() const
return str; return str;
} }
Text Text::subText(Atom::Type left, Atom::Type right, const Atom* from, bool inclusive) const Text Text::subText(Atom::AtomType left, Atom::AtomType right, const Atom* from, bool inclusive) const
{ {
const Atom* begin = from ? from : firstAtom(); const Atom* begin = from ? from : firstAtom();
const Atom* end; const Atom* end;

View File

@ -54,7 +54,7 @@ public:
Atom *firstAtom() { return first; } Atom *firstAtom() { return first; }
Atom *lastAtom() { return last; } Atom *lastAtom() { return last; }
Text& operator<<(Atom::Type atomType); Text& operator<<(Atom::AtomType atomType);
Text& operator<<(const QString& string); Text& operator<<(const QString& string);
Text& operator<<(const Atom& atom); Text& operator<<(const Atom& atom);
Text& operator<<(const LinkAtom& atom); Text& operator<<(const LinkAtom& atom);
@ -66,7 +66,7 @@ public:
QString toString() const; QString toString() const;
const Atom *firstAtom() const { return first; } const Atom *firstAtom() const { return first; }
const Atom *lastAtom() const { return last; } const Atom *lastAtom() const { return last; }
Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0, bool inclusive = false) const; Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from = 0, bool inclusive = false) const;
void dump() const; void dump() const;
void clear(); void clear();

View File

@ -301,8 +301,8 @@ static const NodeTypeList& relatesTypes()
{ {
if (t.isEmpty()) { if (t.isEmpty()) {
t.reserve(3); t.reserve(3);
t.append(NodeTypePair(Node::Class, Node::NoSubType)); t.append(NodeTypePair(Node::Class, Node::NoSubtype));
t.append(NodeTypePair(Node::Namespace, Node::NoSubType)); t.append(NodeTypePair(Node::Namespace, Node::NoSubtype));
t.append(NodeTypePair(Node::Document, Node::HeaderFile)); t.append(NodeTypePair(Node::Document, Node::HeaderFile));
} }
return t; return t;
@ -586,7 +586,7 @@ NodeList Tree::allBaseClasses(const ClassNode* classNode) const
search at the tree root. \a subtype is not used unless search at the tree root. \a subtype is not used unless
\a type is \c{Document}. \a type is \c{Document}.
*/ */
Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) const Node* Tree::findNodeByNameAndType(const QStringList& path, Node::NodeType type) const
{ {
return findNodeRecursive(path, 0, root(), type); return findNodeRecursive(path, 0, root(), type);
} }
@ -610,7 +610,7 @@ Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) cons
Node* Tree::findNodeRecursive(const QStringList& path, Node* Tree::findNodeRecursive(const QStringList& path,
int pathIndex, int pathIndex,
const Node* start, const Node* start,
Node::Type type) const Node::NodeType type) const
{ {
if (!start || path.isEmpty()) if (!start || path.isEmpty())
return 0; // no place to start, or nothing to search for. return 0; // no place to start, or nothing to search for.
@ -979,7 +979,7 @@ QString Tree::getRef(const QString& target, const Node* node) const
*/ */
void Tree::insertTarget(const QString& name, void Tree::insertTarget(const QString& name,
const QString& title, const QString& title,
TargetRec::Type type, TargetRec::TargetType type,
Node* node, Node* node,
int priority) int priority)
{ {
@ -1004,7 +1004,7 @@ void Tree::resolveTargets(InnerNode* root)
bool alreadyThere = false; bool alreadyThere = false;
if (!nodes.empty()) { if (!nodes.empty()) {
for (int i=0; i< nodes.size(); ++i) { for (int i=0; i< nodes.size(); ++i) {
if (nodes[i]->subType() == Node::ExternalPage) { if (nodes[i]->docSubtype() == Node::ExternalPage) {
if (node->name() == nodes[i]->name()) { if (node->name() == nodes[i]->name()) {
alreadyThere = true; alreadyThere = true;
break; break;
@ -1251,7 +1251,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus)
CNMap::const_iterator i = m->find(name); CNMap::const_iterator i = m->find(name);
if (i != m->end()) if (i != m->end())
return i.value(); return i.value();
Node::Type t = Node::NoType; Node::NodeType t = Node::NoType;
switch (genus) { switch (genus) {
case Node::DOC: case Node::DOC:
t = Node::Group; t = Node::Group;

View File

@ -49,11 +49,11 @@ class QDocDatabase;
struct TargetRec struct TargetRec
{ {
public: public:
enum Type { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle }; enum TargetType { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle };
TargetRec(const QString& name, TargetRec(const QString& name,
const QString& title, const QString& title,
TargetRec::Type type, TargetRec::TargetType type,
Node* node, Node* node,
int priority) int priority)
: node_(node), ref_(name), title_(title), priority_(priority), type_(type) { } : node_(node), ref_(name), title_(title), priority_(priority), type_(type) { }
@ -64,7 +64,7 @@ struct TargetRec
QString ref_; QString ref_;
QString title_; QString title_;
int priority_; int priority_;
Type type_; TargetType type_;
}; };
struct TargetLoc struct TargetLoc
@ -107,7 +107,7 @@ class Tree
Node* findNodeRecursive(const QStringList& path, Node* findNodeRecursive(const QStringList& path,
int pathIndex, int pathIndex,
const Node* start, const Node* start,
Node::Type type) const; Node::NodeType type) const;
Node* findNodeRecursive(const QStringList& path, Node* findNodeRecursive(const QStringList& path,
int pathIndex, int pathIndex,
Node* start, Node* start,
@ -134,12 +134,12 @@ class Tree
QmlTypeNode* findQmlTypeNode(const QStringList& path); QmlTypeNode* findQmlTypeNode(const QStringList& path);
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) const; Node* findNodeByNameAndType(const QStringList& path, Node::NodeType type) const;
InnerNode* findRelatesNode(const QStringList& path); InnerNode* findRelatesNode(const QStringList& path);
QString getRef(const QString& target, const Node* node) const; QString getRef(const QString& target, const Node* node) const;
void insertTarget(const QString& name, void insertTarget(const QString& name,
const QString& title, const QString& title,
TargetRec::Type type, TargetRec::TargetType type,
Node* node, Node* node,
int priority); int priority);
void resolveTargets(InnerNode* root); void resolveTargets(InnerNode* root);