summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/qdocdatabase.h
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2014-01-06 12:57:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 21:04:43 +0200
commite9954e31624c77d986077ec5431c7ec4a9b058e0 (patch)
treece07acd32f8a03c07fa0f16cfc9ab186459c13fa /src/tools/qdoc/qdocdatabase.h
parent4f50be8d1885e685ec8df3796e4156eb015affa7 (diff)
qdoc: Teach qdoc to use multiple trees
qdoc now builds a separate Node Tree for each index file it parsed. The main Node Tree now contains only the Nodes of things being documented in the current module. This should make qdoc run a little faster. qdoc now uses these separate trees to make intra-module and inter-module linking more robust by searching the trees in an order that depends on the type of link it is searching for. The tree for the current module is always searched first. Then qdoc searches the trees for either the C++ modules or the QML modules, depending on whether it is looking for a C++ link or a QML link. In preparation for this update, qdoc was also simplified a lot. Many functions became obsolete and were removed. Others were combined. Task-number: QTBUG-35377 Change-Id: Iea4e49869ff6a6ff0f4d53090728770d40d892f3 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.h')
-rw-r--r--src/tools/qdoc/qdocdatabase.h53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 4decba5f79..4e50396817 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -134,10 +134,6 @@ class QDocDatabase
const NodeMap& getQmlTypeMap(const QString& key) const;
const NodeMultiMap& getSinceMap(const QString& key) const;
- const Node* resolveTarget(const QString& target, const Node* relative, const Node* self=0);
- const Node* findNodeForTarget(const QString& target, const Node* relative);
- void insertTarget(const QString& name, TargetRec::Type type, Node* node, int priority);
-
/* convenience functions
Many of these will be either eliminated or replaced.
*/
@@ -150,35 +146,44 @@ class QDocDatabase
void fixInheritance() { tree_->fixInheritance(); }
void resolveProperties() { tree_->resolveProperties(); }
- const Node* findNode(const QStringList& path) { return tree_->findNode(path); }
- ClassNode* findClassNode(const QStringList& path) { return tree_->findClassNode(path); }
- NamespaceNode* findNamespaceNode(const QStringList& path) { return tree_->findNamespaceNode(path); }
-
- NameCollisionNode* findCollisionNode(const QString& name) const {
- return tree_->findCollisionNode(name);
- }
-
- const DocNode* findDocNodeByTitle(const QString& title, const Node* relative = 0) const;
- const Node *findUnambiguousTarget(const QString &target, QString& ref, const Node* relative);
+ /*******************************************************************
+ The functions declared below don't search in the tree(s).
+ ********************************************************************/
QString findTarget(const QString &target, const Node *node) const;
void resolveTargets(InnerNode* root);
+ void insertTarget(const QString& name, TargetRec::Type type, Node* node, int priority);
+ /*******************************************************************/
+ /*******************************************************************
+ The functions declared below are called for the current tree only.
+ ********************************************************************/
FunctionNode* findFunctionNode(const QStringList& parentPath, const FunctionNode* clone) {
return tree_->findFunctionNode(parentPath, clone);
}
+ FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone);
+ Node* findNodeInOpenNamespace(QStringList& path, Node::Type type, Node::SubType subtype);
+ NameCollisionNode* findCollisionNode(const QString& name) const {
+ return tree_->findCollisionNode(name);
+ }
+ /*******************************************************************/
+
+ /*******************************************************************
+ The functions declared below are called for all trees.
+ ********************************************************************/
+ ClassNode* findClassNode(const QStringList& path) { return tree_->findClassNode(path); }
+ InnerNode* findRelatesNode(const QStringList& path) { return tree_->findRelatesNode(path); }
+ const Node* resolveTarget(const QString& target, const Node* relative);
+ const Node* findNodeForTarget(const QString& target, const Node* relative);
+ const DocNode* findDocNodeByTitle(const QString& title, const Node* relative = 0) const;
+ const Node* findUnambiguousTarget(const QString& target, QString& ref, const Node* relative);
Node* findNodeByNameAndType(const QStringList& path, Node::Type type, Node::SubType subtype){
return tree_->findNodeByNameAndType(path, type, subtype, 0);
}
NameCollisionNode* checkForCollision(const QString& name) const {
return tree_->checkForCollision(name);
}
- void addBaseClass(ClassNode* subclass,
- Node::Access access,
- const QStringList& basePath,
- const QString& dataTypeWithTemplateArgs,
- InnerNode* parent) {
- tree_->addBaseClass(subclass, access, basePath, dataTypeWithTemplateArgs, parent);
- }
+ /*******************************************************************/
+
void addPropertyFunction(PropertyNode* property,
const QString& funcName,
PropertyNode::FunctionRole funcRole) {
@@ -198,8 +203,6 @@ class QDocDatabase
void clearOpenNamespaces() { openNamespaces_.clear(); }
void insertOpenNamespace(const QString& path) { openNamespaces_.insert(path); }
- FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone);
- Node* findNodeInOpenNamespace(QStringList& path, Node::Type type, Node::SubType subtype);
void setShowInternal(bool value) { showInternal_ = value; }
/* debugging functions */
@@ -210,10 +213,6 @@ class QDocDatabase
friend class QDocIndexFiles;
friend class QDocTagFiles;
- const Node* findNode(const QStringList& path, const Node* relative, int findFlags) {
- return tree_->findNode(path, relative, findFlags);
- }
-
private:
QDocDatabase();
QDocDatabase(QDocDatabase const& ) { }; // copy constructor is private