summaryrefslogtreecommitdiffstats
path: root/src/filedef.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/filedef.cpp
parentd09056a74447fe1c841ffd469986afdffd99765b (diff)
downloadDoxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.zip
Doxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.tar.gz
Doxygen-77a2ce8e15c967422cb1ff01dc78f5d9b1892c3d.tar.bz2
Release-1.3.3-20030824
Diffstat (limited to 'src/filedef.cpp')
-rw-r--r--src/filedef.cpp64
1 files changed, 56 insertions, 8 deletions
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 0278688..2a94da2 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -263,6 +263,7 @@ void FileDef::writeDocumentation(OutputList &ol)
if (fd)
{
isIDLorJava = fd->name().right(4)==".idl" ||
+ fd->name().right(5)==".pidl" ||
fd->name().right(5)==".java";
}
ol.startTypewriter();
@@ -648,18 +649,24 @@ void FileDef::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 FileDef::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);
}
void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local)
@@ -706,18 +713,18 @@ void FileDef::addIncludedUsingDirectives()
{
if (ii->fileDef && ii->fileDef!=this)
{
- NamespaceList *unl = ii->fileDef->usingDirList;
+ NamespaceSDict *unl = ii->fileDef->usingDirList;
if (unl)
{
- NamespaceListIterator nli(*unl);
+ NamespaceSDict::Iterator nli(*unl);
NamespaceDef *nd;
for (nli.toLast();(nd=nli.current());--nli)
{
// append each using directive found in a #include file
- if (usingDirList==0) usingDirList = new NamespaceList;
+ if (usingDirList==0) usingDirList = new NamespaceSDict;
//printf("Prepending used namespace %s to the list of file %s\n",
// nd->name().data(),name().data());
- usingDirList->prepend(nd);
+ usingDirList->prepend(nd->qualifiedName(),nd);
}
}
}
@@ -994,3 +1001,44 @@ void generateFileTree(QTextStream &t)
delete root;
}
+void FileDef::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);
+ }
+ }
+ }
+ }
+}
+
+