summaryrefslogtreecommitdiffstats
path: root/src/namespacedef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-08-24 20:42:56 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-08-24 20:42:56 (GMT)
commit5b0de0b4249965d3ae2ca3e67f40ef810e0a9598 (patch)
treebfd280ef12015bf793b71236c30364c6618cbaf8 /src/namespacedef.cpp
parent8626ab32d671ffcdc75dffce04dd05a671cfb42c (diff)
downloadDoxygen-5b0de0b4249965d3ae2ca3e67f40ef810e0a9598.zip
Doxygen-5b0de0b4249965d3ae2ca3e67f40ef810e0a9598.tar.gz
Doxygen-5b0de0b4249965d3ae2ca3e67f40ef810e0a9598.tar.bz2
Release-1.3.3-20030824
Diffstat (limited to 'src/namespacedef.cpp')
-rw-r--r--src/namespacedef.cpp54
1 files changed, 50 insertions, 4 deletions
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index edd0add..1146924 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -363,18 +363,24 @@ void NamespaceDef::addUsingDirective(NamespaceDef *nd)
{
if (usingDirList==0)
{
- usingDirList = new NamespaceList;
+ usingDirList = new NamespaceSDict;
+ }
+ if (usingDirList->find(nd->qualifiedName())==0)
+ {
+ usingDirList->append(nd->qualifiedName(),nd);
}
- usingDirList->append(nd);
}
void NamespaceDef::addUsingDeclaration(ClassDef *cd)
{
if (usingDeclList==0)
{
- usingDeclList = new ClassList;
+ usingDeclList = new ClassSDict;
+ }
+ if (usingDeclList->find(cd->qualifiedName())==0)
+ {
+ usingDeclList->append(cd->qualifiedName(),cd);
}
- usingDeclList->append(cd);
}
QCString NamespaceDef::getOutputFileBase() const
@@ -418,3 +424,43 @@ QCString NamespaceDef::displayName() const
return result;
}
+void NamespaceDef::combineUsingRelations()
+{
+ if (visited) return; // already done
+ visited=TRUE;
+ if (usingDirList)
+ {
+ NamespaceSDict::Iterator nli(*usingDirList);
+ NamespaceDef *nd;
+ for (nli.toFirst();(nd=nli.current());++nli)
+ {
+ nd->combineUsingRelations();
+ }
+ for (nli.toFirst();(nd=nli.current());++nli)
+ {
+ // add used namespaces of namespace nd to this namespace
+ if (nd->getUsedNamespaces())
+ {
+ NamespaceSDict::Iterator unli(*nd->getUsedNamespaces());
+ NamespaceDef *und;
+ for (unli.toFirst();(und=unli.current());++unli)
+ {
+ //printf("Adding namespace %s to the using list of %s\n",und->qualifiedName().data(),qualifiedName().data());
+ addUsingDirective(und);
+ }
+ }
+ // add used classes of namespace nd to this namespace
+ if (nd->getUsedClasses())
+ {
+ ClassSDict::Iterator cli(*nd->getUsedClasses());
+ ClassDef *ucd;
+ for (cli.toFirst();(ucd=cli.current());++cli)
+ {
+ //printf("Adding class %s to the using list of %s\n",cd->qualifiedName().data(),qualifiedName().data());
+ addUsingDeclaration(ucd);
+ }
+ }
+ }
+ }
+}
+