summaryrefslogtreecommitdiffstats
path: root/src/namespacedef.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-08-24 20:42:56 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-08-24 20:42:56 (GMT)
commit77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d (patch)
treebfd280ef12015bf793b71236c30364c6618cbaf8 /src/namespacedef.cpp
parentd09056a74447fe1c841ffd469986afdffd99765b (diff)
downloadDoxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.zip
Doxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.tar.gz
Doxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.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);
+ }
+ }
+ }
+ }
+}
+