summaryrefslogtreecommitdiffstats
path: root/src/memberdef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2000-08-06 15:11:00 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2000-08-06 15:11:00 (GMT)
commitc4ef46195917656ebebed63e3fab5c135d9905a2 (patch)
treeaa501b0916e827fee6032245628509acc64efbba /src/memberdef.cpp
parent5ad8b41eb93b9ca6a4c2ce90837103f8a4e750d8 (diff)
downloadDoxygen-c4ef46195917656ebebed63e3fab5c135d9905a2.zip
Doxygen-c4ef46195917656ebebed63e3fab5c135d9905a2.tar.gz
Doxygen-c4ef46195917656ebebed63e3fab5c135d9905a2.tar.bz2
Release-1.2.0-20000806
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r--src/memberdef.cpp58
1 files changed, 35 insertions, 23 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index d64225c..f64950f 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -21,13 +21,14 @@
#include "membername.h"
#include "doxygen.h"
#include "util.h"
+#include "code.h"
#include "message.h"
#include "htmlhelp.h"
#include "language.h"
#include "outputlist.h"
#include "example.h"
#include "membergroup.h"
-#include "scanner.h"
+#include "doc.h"
#include "groupdef.h"
#include "defargs.h"
#include "xml.h"
@@ -583,7 +584,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
{
QCString doxyName=name().copy();
if (!cname.isEmpty()) doxyName.prepend(cname+"::");
- ol.startDoxyAnchor(cfname,cname,anchor(),doxyName);
+ ol.startDoxyAnchor(cfname,anchor(),doxyName);
ol.addToIndex(name(),cname);
ol.addToIndex(cname,name());
if (hasHtmlHelp)
@@ -763,7 +764,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (!detailsVisible && !Config::extractAllFlag && !annMemb)
{
- ol.endDoxyAnchor();
+ ol.endDoxyAnchor(cfname,anchor());
}
ol.endMemberItem((annoClassDef!=0 && indDepth==0) || annEnumType);
@@ -796,7 +797,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
* all active output formats.
*/
void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
- const char *scopeName)
+ const char *scopeName,Definition *container)
{
if (getClassDef()==0 && isStatic() && !Config::extractStaticFlag) return;
bool hasDocs = detailsAreVisible();
@@ -809,16 +810,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
(!hasDocs && !briefDescription().isEmpty() && annUsed)
)
{
- // get definition. TODO: make a method of this
- NamespaceDef *nd=getNamespaceDef();
- ClassDef *cd=getClassDef();
- FileDef *fd=getFileDef();
- Definition *d = 0;
- if (cd) d=cd; else if (nd) d=nd; else d=fd;
- ASSERT(d!=0);
-
- QCString cname = d->name();
- QCString cfname = d->getOutputFileBase();
+ // get definition.
+ QCString cname = container->name();
+ QCString cfname = container->getOutputFileBase();
// get member name
QCString doxyName=name().copy();
@@ -858,7 +852,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{
if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name())
{
- ol.startDoxyAnchor(cfname,cname,anchor(),doxyName);
+ ol.startDoxyAnchor(cfname,anchor(),doxyName);
ol.startMemberDoc(cname,name(),anchor(),name());
if (hasHtmlHelp)
{
@@ -874,7 +868,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (!found) // anonymous compound
{
//printf("Annonymous compound `%s'\n",cname.data());
- ol.startDoxyAnchor(cfname,cname,anchor(),doxyName);
+ ol.startDoxyAnchor(cfname,anchor(),doxyName);
ol.startMemberDoc(cname,name(),anchor(),name());
if (hasHtmlHelp)
{
@@ -895,13 +889,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
else
{
- ol.startDoxyAnchor(cfname,cname,anchor(),doxyName);
+ ol.startDoxyAnchor(cfname,anchor(),doxyName);
ol.startMemberDoc(cname,name(),anchor(),name());
if (hasHtmlHelp)
{
htmlHelp->addIndexItem(cname,name(),cfname,anchor());
}
+ ClassDef *cd=getClassDef();
ArgumentList *scopeAl=scopeDefTemplateArguments();
if (scopeAl==0 && cd) scopeAl=cd->templateArguments();
@@ -1016,7 +1011,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
if (!isDefine()) ol.endParameter(TRUE);
ol.endMemberDoc();
- ol.endDoxyAnchor();
+ ol.endDoxyAnchor(cfname,anchor());
ol.startIndent();
ol.pushGeneratorState();
@@ -1121,7 +1116,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
//ol.writeListItem();
ol.startDescTableTitle();
- ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name());
+ ol.startDoxyAnchor(cfname,fmd->anchor(),fmd->name());
first=FALSE;
ol.startEmphasis();
ol.docify(fmd->name());
@@ -1129,7 +1124,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" ");
ol.enableAll();
- ol.endDoxyAnchor();
+ ol.endDoxyAnchor(cfname,fmd->anchor());
ol.endDescTableTitle();
//ol.newParagraph();
ol.startDescTableData();
@@ -1324,10 +1319,10 @@ void MemberDef::warnIfUndocumented()
t="class", d=cd;
else if (nd)
t="namespace", d=nd;
- else if (fd)
- t="file", d=fd;
- else
+ else if (gd)
t="group", d=gd;
+ else
+ t="file", d=fd;
if (d && d->isLinkable() && !isLinkable() && name().find('@')==-1)
warn_undoc(defFileName,defLine,"Warning: Member %s of %s %s is not documented.",
@@ -1570,3 +1565,20 @@ void MemberDef::generateXML(QTextStream &t,Definition *def)
t << ">" << endl;
}
+Definition *MemberDef::getCompoundDef() const
+{
+ NamespaceDef *nd=getNamespaceDef();
+ ClassDef *cd=getClassDef();
+ FileDef *fd=getFileDef();
+ GroupDef *gd=getGroupDef();
+ Definition *d = 0;
+ if (cd) d=cd; else if (nd) d=nd; else if (gd) d=gd; else d=fd;
+ ASSERT(d!=0);
+ return d;
+}
+
+QCString MemberDef::anchor() const
+{
+ if (enumScope) return enumScope->anchor()+anc;
+ return anc;
+}