summaryrefslogtreecommitdiffstats
path: root/src/membergroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/membergroup.cpp')
-rw-r--r--src/membergroup.cpp238
1 files changed, 27 insertions, 211 deletions
diff --git a/src/membergroup.cpp b/src/membergroup.cpp
index 0aa678d..c376632 100644
--- a/src/membergroup.cpp
+++ b/src/membergroup.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id$
+ *
*
* Copyright (C) 1997-2000 by Dimitri van Heesch.
*
@@ -25,19 +25,21 @@
#include "language.h"
#include "scanner.h"
-static QCString idToName(int id)
-{
- QCString result;
- result.sprintf("mgroup_%d",id);
- return result;
-}
+//static QCString idToName(int id)
+//{
+// QCString result;
+// result.sprintf("mgroup_%d",id);
+// return result;
+//}
-MemberGroup::MemberGroup(int id,const char *hdr) : Definition(idToName(id))
+MemberGroup::MemberGroup(int id,const char *hdr,const char *d) /* : Definition(idToName(id)) */
{
memberList = new MemberList;
- grpId = id;
- grpHeader = hdr;
- fileName = name();
+ grpId = id;
+ grpHeader = hdr;
+ doc = d;
+ scope = 0;
+ //printf("Member group docs=`%s'\n",doc.data());
}
MemberGroup::~MemberGroup()
@@ -45,214 +47,28 @@ MemberGroup::~MemberGroup()
delete memberList;
}
-void MemberGroup::insertMember(MemberDef *m)
+void MemberGroup::insertMember(MemberDef *md)
{
- memberList->append(m);
+ //printf("MemberGroup::insertMember(%s)\n",md->name().data());
+ memberList->append(md);
}
-void MemberGroup::writeDocumentation(OutputList &ol)
-{
- //printf("Writing documentation for group %s\n",fileName.data());
-
- if (memberList->count()==0) return; // no member in this group!
-
- QCString title = grpHeader.copy();
- if (title.isEmpty())
- {
- title = "Member Group"; // TODO: make translatable.
- }
- ol.disable(OutputGenerator::Man);
- startFile(ol,fileName,title);
- startTitle(ol,getOutputFileBase());
- ol.docify(title);
- endTitle(ol,getOutputFileBase(),name());
-
-
- OutputList briefOutput(&ol);
- if (!briefDescription().isEmpty())
- {
- parseDoc(briefOutput,0,0,briefDescription());
- ol+=briefOutput;
- ol.writeString(" \n");
- if (!documentation().isEmpty() || Config::repeatBriefFlag)
- {
- //bool htmlEnabled = ol.isEnabled(OutputGenerator::Html);
- //bool latexEnabled = ol.isEnabled(OutputGenerator::Latex);
- //if (htmlEnabled) ol.disable(OutputGenerator::Html);
- //if (latexEnabled) ol.disable(OutputGenerator::Latex);
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
- ol.startTextLink(0,"_details");
- parseText(ol,theTranslator->trMore());
- ol.endTextLink();
- ol.popGeneratorState();
- //if (htmlEnabled) ol.enable(OutputGenerator::Html);
- //if (latexEnabled) ol.enable(OutputGenerator::Latex);
- }
- }
- // TODO: man page synopsis
-
- //if (memberList->count()>0)
- //{
- QCString scopeName;
-
- MemberDef *md = memberList->first();
- ClassDef *cd = md->memberClass();
- NamespaceDef *nd = md->getNamespace();
- FileDef *fd = md->getFileDef();
- //printf("member %s brief=`%s' docs=`%s'\n",
- // md->name().data(), md->briefDescription().data(),
- // md->documentation().data());
- if (cd)
- {
- ol.newParagraph();
- ol.docify("Inside class ");
- ol.writeObjectLink(cd->getReference(),
- cd->getOutputFileBase(),0,
- cd->name()
- );
- scopeName=cd->name().copy();
- }
- else if (nd)
- {
- ol.newParagraph();
- ol.docify("Inside namespace ");
- ol.writeObjectLink(nd->getReference(),
- nd->getOutputFileBase(),0,
- nd->name()
- );
- scopeName=nd->name().copy();
- }
- else if (fd)
- {
- ol.newParagraph();
- ol.docify("#include <");
- ol.writeObjectLink(fd->getReference(),
- fd->getOutputFileBase(),0,
- fd->name()
- );
- ol.docify(">");
- }
- ol.startMemberSections();
- memberList->writeDeclarations(ol,cd,nd,fd,0,"Synopsis",0,TRUE);
- ol.endMemberSections();
-
- if ((!briefDescription().isEmpty() && Config::repeatBriefFlag) ||
- !documentation().isEmpty())
- {
- ol.writeRuler();
- //bool latexOn = ol.isEnabled(OutputGenerator::Latex);
- //if (latexOn) ol.disable(OutputGenerator::Latex);
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor("_details");
- //if (latexOn) ol.enable(OutputGenerator::Latex);
- ol.popGeneratorState();
- ol.startGroupHeader();
- parseText(ol,theTranslator->trDetailedDescription());
- ol.endGroupHeader();
- // repeat brief description
- if (!briefDescription().isEmpty() && Config::repeatBriefFlag)
- {
- ol+=briefOutput;
- ol.newParagraph();
- }
- // write documentation
- if (!documentation().isEmpty())
- {
- parseDoc(ol,scopeName,0,documentation()+"\n");
- }
- }
-
-// memberList->countDocMembers(TRUE);
-//
-// if ( memberList->defineCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trDefineDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Define);
-// }
-//
-// if ( memberList->protoCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trFunctionPrototypeDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Prototype);
-// }
-//
-// if ( memberList->typedefCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trTypedefDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Typedef);
-// }
-//
-// if ( memberList->enumCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trEnumerationTypeDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Enumeration);
-// }
-//
-// if ( memberList->enumValueCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trEnumerationValueDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::EnumValue);
-// }
-//
-// if ( memberList->funcCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trFunctionDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Function);
-// }
-//
-// if ( memberList->varCount()>0 )
-// {
-// ol.writeRuler();
-// ol.startGroupHeader();
-// parseText(ol,theTranslator->trVariableDocumentation());
-// ol.endGroupHeader();
-// writeMemberDocs(ol,memberList,scopeName,MemberDef::Variable);
-// }
-
- endFile(ol);
- ol.enable(OutputGenerator::Man);
-}
-
-bool MemberGroup::isLinkableInProject()
+void MemberGroup::setAnchors()
{
- return hasDocumentation() && !isReference();
+ ::setAnchors('z',memberList,grpId);
}
-bool MemberGroup::isLinkable()
+
+void MemberGroup::writeDeclarations(OutputList &ol,
+ ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd)
{
- return isLinkableInProject() || isReference();
+ memberList->writeDeclarations(ol,cd,nd,fd,gd,grpHeader,doc,TRUE);
}
-void MemberGroup::addDocumentation()
+void MemberGroup::writePlainDeclarations(OutputList &ol,
+ ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd)
{
- //printf("adding documentation for membergroup %s\n",name().data());
- MemberListIterator mli(*memberList);
- MemberDef *md;
- for (;(md=mli.current());++mli)
- {
- //printf("Adding docs `%s' `%s'\n",md->briefDescription().data(),md->documentation().data());
- setBriefDescription(briefDescription()+"\n"+md->briefDescription());
- setDocumentation(documentation()+"\n"+md->documentation());
- }
- //printf("isLinkable()=%d\n",isLinkable());
+ //printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count());
+ memberList->writePlainDeclarations(ol,cd,nd,fd,gd,TRUE);
}
+