summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-21 17:27:45 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-21 17:27:45 (GMT)
commitff31b2f109848ea3e08fb17d5821beb7af879193 (patch)
tree4859bfed167f695f5ce9e9c0f2f6f02313de2ed3 /src/doxygen.cpp
parentbc629c9003d59b736cc996a05b95bac8ab50123a (diff)
downloadDoxygen-ff31b2f109848ea3e08fb17d5821beb7af879193.zip
Doxygen-ff31b2f109848ea3e08fb17d5821beb7af879193.tar.gz
Doxygen-ff31b2f109848ea3e08fb17d5821beb7af879193.tar.bz2
Release-1.2.15-20020421
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp544
1 files changed, 284 insertions, 260 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 1e5f361..499564e 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id$
+ *
*
*
* Copyright (C) 1997-2002 by Dimitri van Heesch.
@@ -541,232 +541,232 @@ ArgumentList *getTemplateArgumentsFromName(
return ali.current();
}
-
-//----------------------------------------------------------------------
-// build a list of all classes mentioned in the documentation
-// and all classes that have a documentation block before their definition.
-static void buildClassList(Entry *root)
+static void addClassToContext(Entry *root)
{
- if (
- ((root->section & Entry::COMPOUNDDOC_MASK) ||
- ((root->section & Entry::COMPOUND_MASK))
- ) &&
- !root->name.isEmpty()
- )
+ QCString fullName=removeRedundantWhiteSpace(root->name);
+ if (fullName.isEmpty())
{
- QCString fullName=removeRedundantWhiteSpace(root->name);
- if (fullName.isEmpty())
- {
- // this should not be called
- warn(root->fileName,root->startLine,
- "Warning: invalid class name found!"
- );
- goto error;
- }
- Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data());
+ // this should not be called
+ warn(root->fileName,root->startLine,
+ "Warning: invalid class name found!"
+ );
+ return;
+ }
+ Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data());
- fullName=stripAnonymousNamespaceScope(fullName);
- fullName=stripTemplateSpecifiersFromScope(fullName);
+ fullName=stripAnonymousNamespaceScope(fullName);
+ fullName=stripTemplateSpecifiersFromScope(fullName);
- Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data());
+ Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data());
- bool ambig;
- ClassDef *cd;
- //printf("findFileDef(%s)\n",root->fileName.data());
- FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig);
+ bool ambig;
+ ClassDef *cd;
+ //printf("findFileDef(%s)\n",root->fileName.data());
+ FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig);
- if ((cd=getClass(fullName)))
- {
- Debug::print(Debug::Classes,0," Existing class!\n",fullName.data());
- //if (cd->templateArguments()==0)
- //{
- // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data());
- // cd->setTemplateArguments(tArgList);
- //}
- if (!root->doc.isEmpty() || !root->brief.isEmpty() ||
- (root->bodyLine!=-1 && Config_getBool("SOURCE_BROWSER"))
- )
- // block contains something that ends up in the docs
- {
- if (!root->doc.isEmpty() && !cd->documentation().isEmpty())
- {
- warn(
- root->fileName,root->startLine,
- "Warning: class %s already has a detailed description. "
- "Skipping the one found here.",
- fullName.data()
- );
- }
- else if (!root->doc.isEmpty())
- {
- cd->setDocumentation(root->doc,root->docFile,root->docLine);
- }
- if (!root->brief.isEmpty() && !cd->briefDescription().isEmpty())
- {
- warn(
- root->fileName,root->startLine,
- "Warning: class %s already has a brief description\n"
- " skipping the one found here.",
- fullName.data()
- );
- }
- else if (!root->brief.isEmpty())
- {
- cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- }
- if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1)
- {
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
- cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig));
- }
- cd->addSectionsToDefinition(root->anchors);
- cd->setName(fullName); // change name to match docs
- }
- cd->setFileDef(fd);
- if (cd->hasDocumentation())
+ if ((cd=getClass(fullName)))
+ {
+ Debug::print(Debug::Classes,0," Existing class!\n",fullName.data());
+ //if (cd->templateArguments()==0)
+ //{
+ // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data());
+ // cd->setTemplateArguments(tArgList);
+ //}
+ if (!root->doc.isEmpty() || !root->brief.isEmpty() ||
+ (root->bodyLine!=-1 && Config_getBool("SOURCE_BROWSER"))
+ )
+ // block contains something that ends up in the docs
+ {
+ if (!root->doc.isEmpty() && !cd->documentation().isEmpty())
{
- addIncludeFile(cd,fd,root);
+ warn(
+ root->fileName,root->startLine,
+ "Warning: class %s already has a detailed description. "
+ "Skipping the one found here.",
+ fullName.data()
+ );
}
- addNamespace(root,cd);
- if (fd && (root->section & Entry::COMPOUND_MASK))
+ else if (!root->doc.isEmpty())
{
- //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
- // cd->name().data(),
- // fd->name().data(),
- // root->fileName.data()
- // );
- fd->insertClass(cd);
+ cd->setDocumentation(root->doc,root->docFile,root->docLine);
}
- addClassToGroups(root,cd);
- cd->setRefItems(root->todoId,root->testId,root->bugId);
- if (!root->subGrouping) cd->setSubGrouping(FALSE);
-
- if (cd->templateArguments()==0)
+ if (!root->brief.isEmpty() && !cd->briefDescription().isEmpty())
{
- // this happens if a template class declared with @class is found
- // before the actual definition.
- ArgumentList *tArgList =
- getTemplateArgumentsFromName(fullName,root->tArgLists);
- cd->setTemplateArguments(tArgList);
+ warn(
+ root->fileName,root->startLine,
+ "Warning: class %s already has a brief description\n"
+ " skipping the one found here.",
+ fullName.data()
+ );
}
- }
- else // new class
- {
-
- ClassDef::CompoundType sec=ClassDef::Class;
- switch(root->section)
+ else if (!root->brief.isEmpty())
{
- case Entry::UNION_SEC:
- case Entry::UNIONDOC_SEC:
- sec=ClassDef::Union; break;
- case Entry::STRUCT_SEC:
- case Entry::STRUCTDOC_SEC:
- sec=ClassDef::Struct; break;
- case Entry::INTERFACE_SEC:
- case Entry::INTERFACEDOC_SEC:
- sec=ClassDef::Interface; break;
- case Entry::EXCEPTION_SEC:
- case Entry::EXCEPTIONDOC_SEC:
- sec=ClassDef::Exception; break;
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
}
- Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)! #tArgLists=%d\n",
- fullName.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1);
- QCString className;
- QCString namespaceName;
- extractNamespaceName(fullName,className,namespaceName);
-
- //printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data());
-
- QCString tagName;
- QCString refFileName;
- if (root->tagInfo)
+ if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1)
{
- tagName = root->tagInfo->tagName;
- refFileName = root->tagInfo->fileName;
+ cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig));
}
- ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec,
- tagName,refFileName);
- cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
- cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
-
+ cd->addSectionsToDefinition(root->anchors);
+ cd->setName(fullName); // change name to match docs
+ }
+ cd->setFileDef(fd);
+ if (cd->hasDocumentation())
+ {
+ addIncludeFile(cd,fd,root);
+ }
+ addNamespace(root,cd);
+ if (fd && (root->section & Entry::COMPOUND_MASK))
+ {
+ //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
+ // cd->name().data(),
+ // fd->name().data(),
+ // root->fileName.data()
+ // );
+ fd->insertClass(cd);
+ }
+ addClassToGroups(root,cd);
+ cd->setRefItems(root->todoId,root->testId,root->bugId);
+ if (!root->subGrouping) cd->setSubGrouping(FALSE);
+ if (cd->templateArguments()==0)
+ {
+ // this happens if a template class declared with @class is found
+ // before the actual definition.
ArgumentList *tArgList =
getTemplateArgumentsFromName(fullName,root->tArgLists);
- //printf("class %s template args=%s\n",fullName.data(),
- // tArgList ? tempArgListToString(tArgList).data() : "<none>");
cd->setTemplateArguments(tArgList);
- cd->setProtection(root->protection);
- cd->addSectionsToDefinition(root->anchors);
- cd->setIsStatic(root->stat);
+ }
+ }
+ else // new class
+ {
+
+ ClassDef::CompoundType sec=ClassDef::Class;
+ switch(root->section)
+ {
+ case Entry::UNION_SEC:
+ case Entry::UNIONDOC_SEC:
+ sec=ClassDef::Union; break;
+ case Entry::STRUCT_SEC:
+ case Entry::STRUCTDOC_SEC:
+ sec=ClassDef::Struct; break;
+ case Entry::INTERFACE_SEC:
+ case Entry::INTERFACEDOC_SEC:
+ sec=ClassDef::Interface; break;
+ case Entry::EXCEPTION_SEC:
+ case Entry::EXCEPTIONDOC_SEC:
+ sec=ClassDef::Exception; break;
+ }
+ Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)! #tArgLists=%d\n",
+ fullName.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1);
+ QCString className;
+ QCString namespaceName;
+ extractNamespaceName(fullName,className,namespaceName);
- // file definition containing the class cd
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
- cd->setBodyDef(fd);
- if (!root->subGrouping) cd->setSubGrouping(FALSE);
+ //printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data());
- addClassToGroups(root,cd);
- cd->setRefItems(root->todoId,root->testId,root->bugId);
+ QCString tagName;
+ QCString refFileName;
+ if (root->tagInfo)
+ {
+ tagName = root->tagInfo->tagName;
+ refFileName = root->tagInfo->fileName;
+ }
+ ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec,
+ tagName,refFileName);
+ cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
- // see if the class is found inside a namespace
- bool found=addNamespace(root,cd);
- cd->setFileDef(fd);
- if (cd->hasDocumentation())
- {
- addIncludeFile(cd,fd,root);
- }
+ ArgumentList *tArgList =
+ getTemplateArgumentsFromName(fullName,root->tArgLists);
+ //printf("class %s template args=%s\n",fullName.data(),
+ // tArgList ? tempArgListToString(tArgList).data() : "<none>");
+ cd->setTemplateArguments(tArgList);
+ cd->setProtection(root->protection);
+ cd->addSectionsToDefinition(root->anchors);
+ cd->setIsStatic(root->stat);
- // namespace is part of the class name
- if (!found && !namespaceName.isEmpty())
- {
- NamespaceDef *nd = getResolvedNamespace(namespaceName);
- if (nd)
- {
- cd->setNamespace(nd);
- nd->insertClass(cd);
- found=TRUE;
- }
- }
+ // file definition containing the class cd
+ cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodyDef(fd);
+ if (!root->subGrouping) cd->setSubGrouping(FALSE);
- // if the class is not in a namespace then we insert
- // it in the file definition
- if (!found && fd && (root->section & Entry::COMPOUND_MASK))
- {
- //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
- // cd->name().data(),
- // fd->name().data(),
- // root->fileName.data()
- // );
- fd->insertClass(cd);
- }
+ addClassToGroups(root,cd);
+ cd->setRefItems(root->todoId,root->testId,root->bugId);
- // the empty string test is needed for extract all case
- cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- cd->insertUsedFile(root->fileName);
+ // see if the class is found inside a namespace
+ bool found=addNamespace(root,cd);
- // add class to the list
- //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
- Doxygen::classSDict.append(fullName,cd);
+ cd->setFileDef(fd);
+ if (cd->hasDocumentation())
+ {
+ addIncludeFile(cd,fd,root);
+ }
- // also add class to the correct structural context
- Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName);
- if (d==0)
- {
- //warn(root->fileName,root->startLine,
- // "Warning: Internal inconsistency: scope for class %s not "
- // "found!\n",fullName.data()
- // );
- }
- else
+ // namespace is part of the class name
+ if (!found && !namespaceName.isEmpty())
+ {
+ NamespaceDef *nd = getResolvedNamespace(namespaceName);
+ if (nd)
{
- //printf("****** adding %s to scope %s\n",cd->name().data(),d->name().data());
- d->addInnerCompound(cd);
- cd->setOuterScope(d);
+ cd->setNamespace(nd);
+ nd->insertClass(cd);
+ found=TRUE;
}
}
+
+ // if the class is not in a namespace then we insert
+ // it in the file definition
+ if (!found && fd && (root->section & Entry::COMPOUND_MASK))
+ {
+ //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
+ // cd->name().data(),
+ // fd->name().data(),
+ // root->fileName.data()
+ // );
+ fd->insertClass(cd);
+ }
+
+ // the empty string test is needed for extract all case
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ cd->insertUsedFile(root->fileName);
+
+ // add class to the list
+ //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
+ Doxygen::classSDict.append(fullName,cd);
+
+ // also add class to the correct structural context
+ Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName);
+ if (d==0)
+ {
+ //warn(root->fileName,root->startLine,
+ // "Warning: Internal inconsistency: scope for class %s not "
+ // "found!\n",fullName.data()
+ // );
+ }
+ else
+ {
+ //printf("****** adding %s to scope %s\n",cd->name().data(),d->name().data());
+ d->addInnerCompound(cd);
+ cd->setOuterScope(d);
+ }
+ }
+}
+
+//----------------------------------------------------------------------
+// build a list of all classes mentioned in the documentation
+// and all classes that have a documentation block before their definition.
+static void buildClassList(Entry *root)
+{
+ if (
+ (root->section & Entry::COMPOUND_MASK) && !root->name.isEmpty()
+ )
+ {
+ addClassToContext(root);
}
-error:
EntryListIterator eli(*root->sublist);
Entry *e;
for (;(e=eli.current());++eli)
@@ -775,18 +775,41 @@ error:
}
}
+static void buildClassDocList(Entry *root)
+{
+ if (
+ (root->section & Entry::COMPOUNDDOC_MASK) && !root->name.isEmpty()
+ )
+ {
+ addClassToContext(root);
+ }
+ EntryListIterator eli(*root->sublist);
+ Entry *e;
+ for (;(e=eli.current());++eli)
+ {
+ buildClassDocList(e);
+ }
+}
//----------------------------------------------------------------------
// build a list of all namespaces mentioned in the documentation
// and all namespaces that have a documentation block before their definition.
static void buildNamespaceList(Entry *root)
{
if (
- (root->section==Entry::NAMESPACE_SEC) ||
- (root->section==Entry::NAMESPACEDOC_SEC) &&
+ (root->section==Entry::NAMESPACE_SEC ||
+ root->section==Entry::NAMESPACEDOC_SEC ||
+ root->section==Entry::PACKAGEDOC_SEC
+ ) &&
!root->name.isEmpty()
)
{
- QCString fullName=stripAnonymousNamespaceScope(root->name.copy());
+ QCString fullName = root->name;
+ if (root->section==Entry::PACKAGEDOC_SEC)
+ {
+ fullName=substitute(fullName,".","::");
+ }
+
+ fullName = stripAnonymousNamespaceScope(fullName);
if (!fullName.isEmpty())
{
//printf("Found namespace %s in %s at line %d\n",root->name.data(),
@@ -5564,50 +5587,50 @@ static void findMainPage(Entry *root)
//----------------------------------------------------------------------------
-/*! Search for all Java package statements
- */
-static void buildPackageList(Entry *root)
-{
- if (root->section == Entry::PACKAGE_SEC || root->section == Entry::PACKAGEDOC_SEC && !root->name.isEmpty())
- {
- PackageDef *pd=0;
- if ((pd=Doxygen::packageDict.find(root->name))==0)
- {
- QCString tagName;
- if (root->tagInfo)
- {
- tagName=root->tagInfo->tagName;
- }
- pd = new PackageDef(root->fileName,root->startLine,root->name,tagName);
- Doxygen::packageDict.inSort(root->name,pd);
- pd->setDocumentation(root->doc,root->docFile,root->docLine);
- pd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- }
- else
- {
- if (!pd->documentation() && !root->doc.isEmpty())
- {
- pd->setDocumentation(root->doc,root->docFile,root->docLine);
- }
- if (!pd->briefDescription() && !root->brief.isEmpty())
- {
- pd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- }
- }
- bool ambig;
- FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig);
- if (fd)
- {
- fd->setPackageDef(pd);
- }
- }
- EntryListIterator eli(*root->sublist);
- Entry *e;
- for (;(e=eli.current());++eli)
- {
- buildPackageList(e);
- }
-}
+///*! Search for all Java package statements
+// */
+//static void buildPackageList(Entry *root)
+//{
+// if (root->section == Entry::PACKAGE_SEC || root->section == Entry::PACKAGEDOC_SEC && !root->name.isEmpty())
+// {
+// PackageDef *pd=0;
+// if ((pd=Doxygen::packageDict.find(root->name))==0)
+// {
+// QCString tagName;
+// if (root->tagInfo)
+// {
+// tagName=root->tagInfo->tagName;
+// }
+// pd = new PackageDef(root->fileName,root->startLine,root->name,tagName);
+// Doxygen::packageDict.inSort(root->name,pd);
+// pd->setDocumentation(root->doc,root->docFile,root->docLine);
+// pd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+// }
+// else
+// {
+// if (!pd->documentation() && !root->doc.isEmpty())
+// {
+// pd->setDocumentation(root->doc,root->docFile,root->docLine);
+// }
+// if (!pd->briefDescription() && !root->brief.isEmpty())
+// {
+// pd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+// }
+// }
+// bool ambig;
+// FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig);
+// if (fd)
+// {
+// fd->setPackageDef(pd);
+// }
+// }
+// EntryListIterator eli(*root->sublist);
+// Entry *e;
+// for (;(e=eli.current());++eli)
+// {
+// buildPackageList(e);
+// }
+//}
//----------------------------------------------------------------------------
@@ -5814,20 +5837,20 @@ static void generateGroupDocs()
//----------------------------------------------------------------------------
-static void generatePackageDocs()
-{
- writePackageIndex(*outputList);
-
- if (Doxygen::packageDict.count()>0)
- {
- PackageSDict::Iterator pdi(Doxygen::packageDict);
- PackageDef *pd;
- for (pdi.toFirst();(pd=pdi.current());++pdi)
- {
- pd->writeDocumentation(*outputList);
- }
- }
-}
+//static void generatePackageDocs()
+//{
+// writePackageIndex(*outputList);
+//
+// if (Doxygen::packageDict.count()>0)
+// {
+// PackageSDict::Iterator pdi(Doxygen::packageDict);
+// PackageDef *pd;
+// for (pdi.toFirst();(pd=pdi.current());++pdi)
+// {
+// pd->writeDocumentation(*outputList);
+// }
+// }
+//}
//----------------------------------------------------------------------------
// generate module pages
@@ -7220,6 +7243,7 @@ void parseInput()
msg("Building class list...\n");
buildClassList(root);
+ buildClassDocList(root);
findUsingDeclarations(root);
msg("Building example list...\n");
@@ -7268,8 +7292,8 @@ void parseInput()
msg("Building page list...\n");
buildPageList(root);
- msg("Building package list...\n");
- buildPackageList(root);
+ //msg("Building package list...\n");
+ //buildPackageList(root);
msg("Search for main page...\n");
findMainPage(root);
@@ -7425,9 +7449,9 @@ void generateOutput()
msg("Generating group index...\n");
writeGroupIndex(*outputList);
-
- msg("Generating package index...\n");
- generatePackageDocs();
+
+ //msg("Generating package index...\n");
+ //generatePackageDocs();
msg("Generating example index...\n");
writeExampleIndex(*outputList);