⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 groupdef.cpp

📁 doxygen(一个自动从源代码生成文档的工具)的源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    Doxygen::tagFile << "  <compound kind=\"group\">" << endl;    Doxygen::tagFile << "    <name>" << convertToXML(name()) << "</name>" << endl;    Doxygen::tagFile << "    <title>" << convertToXML(title) << "</title>" << endl;    Doxygen::tagFile << "    <filename>" << convertToXML(getOutputFileBase()) << ".html</filename>" << endl;  }    ol.startMemberSections();  if (fileList->count()>0)  {    ol.startMemberHeader();    parseText(ol,theTranslator->trFile(TRUE,FALSE));    ol.endMemberHeader();    ol.startMemberList();    FileDef *fd=fileList->first();    while (fd)    {      ol.startMemberItem(0);      ol.docify("file ");      ol.insertMemberAlign();      ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());      if (!Config_getString("GENERATE_TAGFILE").isEmpty())       {        Doxygen::tagFile << "    <file>" << convertToXML(fd->name()) << "</file>" << endl;      }      ol.endMemberItem(FALSE);      if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))      {        ol.startMemberDescription();        parseDoc(ol,m_defFileName,m_defLine,0,0,fd->briefDescription());        ol.endMemberDescription();        ol.newParagraph();      }      fd=fileList->next();    }    ol.endMemberList();  }  if (namespaceList->count()>0)  {    ol.startMemberHeader();    parseText(ol,theTranslator->trNamespaces());    ol.endMemberHeader();    ol.startMemberList();    NamespaceDef *nd=namespaceList->first();    while (nd)    {      ol.startMemberItem(0);      ol.docify("namespace ");      ol.insertMemberAlign();      ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,nd->name());      if (!Config_getString("GENERATE_TAGFILE").isEmpty())       {        Doxygen::tagFile << "    <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;      }      ol.endMemberItem(FALSE);      if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))      {        ol.startMemberDescription();        parseDoc(ol,m_defFileName,m_defLine,0,0,nd->briefDescription());        ol.endMemberDescription();        ol.newParagraph();      }      nd=namespaceList->next();    }    ol.endMemberList();  }  if (groupList->count()>0)  {    ol.startMemberHeader();    parseText(ol,theTranslator->trModules());    ol.endMemberHeader();    ol.startMemberList();    GroupDef *gd=groupList->first();    while (gd)    {      ol.startMemberItem(0);      //ol.insertMemberAlign();      ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),0,gd->groupTitle());      if (!Config_getString("GENERATE_TAGFILE").isEmpty())       {        Doxygen::tagFile << "    <subgroup>" << convertToXML(gd->name()) << "</subgroup>" << endl;      }      ol.endMemberItem(FALSE);      if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))      {        ol.startMemberDescription();        parseDoc(ol,m_defFileName,m_defLine,0,0,gd->briefDescription());        ol.endMemberDescription();        ol.newParagraph();      }      gd=groupList->next();    }    ol.endMemberList();  }  classSDict->writeDeclaration(ol);  if (allMemberList->count()>0)  {    /* write user defined member groups */    MemberGroupListIterator mgli(*memberGroupList);    MemberGroup *mg;    for (;(mg=mgli.current());++mgli)    {      mg->writeDeclarations(ol,0,0,0,this);    }    //allMemberList->writeDeclarations(ol,0,0,0,this,0,0);     decDefineMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trDefines(),0);    decProtoMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFuncProtos(),0);    decTypedefMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trTypedefs(),0);    decEnumMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trEnumerations(),0);    decFuncMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFunctions(),0);    decVarMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trVariables(),0);  }  ol.endMemberSections();  if (!briefDescription().isEmpty() || !documentation().isEmpty())  {        if (pageDict->count()!=countMembers()) // classical layout    {      ol.writeRuler();      ol.pushGeneratorState();      ol.disable(OutputGenerator::Latex);      ol.disable(OutputGenerator::RTF);      ol.writeAnchor(0,"_details");      ol.popGeneratorState();      ol.startGroupHeader();      parseText(ol,theTranslator->trDetailedDescription());      ol.endGroupHeader();      // repeat brief description      if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF"))      {        ol+=briefOutput;        ol.newParagraph();      }    }    // write documentation    if (!documentation().isEmpty())    {      parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");    }  }  PageInfo *pi=0;  PageSDict::Iterator pdi(*pageDict);  for (pdi.toFirst();(pi=pdi.current());++pdi)  {    if (!pi->isReference())    {      QCString pageName = pi->getOutputFileBase();      if (!Config_getString("GENERATE_TAGFILE").isEmpty())       {        Doxygen::tagFile << "    <page>" << convertToXML(pageName) << "</page>" << endl;      }      SectionInfo *si=0;      if (!pi->title.isEmpty() && !pi->name.isEmpty() &&          (si=Doxygen::sectionDict[pi->name])!=0)      {        ol.startSection(si->label,si->title,TRUE);        ol.docify(si->title);        ol.endSection(si->label,TRUE);      }      ol.startTextBlock();      parseDoc(ol,pi->defFileName,pi->defLine,0,0,pi->doc);      ol.endTextBlock();    }  }  docDefineMembers.writeDocumentation(ol,name(),this,                             theTranslator->trDefineDocumentation());    docProtoMembers.writeDocumentation(ol,name(),this,                             theTranslator->trFunctionPrototypeDocumentation());  docTypedefMembers.writeDocumentation(ol,name(),this,                             theTranslator->trTypedefDocumentation());    docEnumMembers.writeDocumentation(ol,name(),this,                             theTranslator->trEnumerationTypeDocumentation());  docFuncMembers.writeDocumentation(ol,name(),this,                             theTranslator->trFunctionDocumentation());    docVarMembers.writeDocumentation(ol,name(),this,                             theTranslator->trVariableDocumentation());  if (!Config_getString("GENERATE_TAGFILE").isEmpty())   {    writeDocAnchorsToTagFile();    Doxygen::tagFile << "  </compound>" << endl;  }  endFile(ol);   ol.popGeneratorState();}//---- helper functions ------------------------------------------------------void addClassToGroups(Entry *root,ClassDef *cd){  QListIterator<Grouping> gli(*root->groups);  Grouping *g;  for (;(g=gli.current());++gli)  {    GroupDef *gd=0;    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname]))    {      gd->addClass(cd);      //printf("Compound %s: in group %s\n",cd->name().data(),s->data());    }  }}void addNamespaceToGroups(Entry *root,NamespaceDef *nd){  //printf("root->groups->count()=%d\n",root->groups->count());  QListIterator<Grouping> gli(*root->groups);  Grouping *g;  for (;(g=gli.current());++gli)  {    GroupDef *gd=0;    //printf("group `%s'\n",s->data());    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname]))    {      gd->addNamespace(nd);      //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());    }  }}void addGroupToGroups(Entry *root,GroupDef *subGroup){  QListIterator<Grouping> gli(*root->groups);  Grouping *g;  for (;(g=gli.current());++gli)  {    GroupDef *gd=0;    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname]) &&	!gd->containsGroup(subGroup) )    {      gd->addGroup(subGroup);      subGroup->addParentGroup(gd);    }  }}/*! Add a member to the group with the highest priority */void addMemberToGroups(Entry *root,MemberDef *md){  //printf("  Root 0x%p = %s, md 0x%p %s\n", root, root->name.data(), md, md->name().data() );  QListIterator<Grouping> gli(*root->groups);  Grouping *g;  // Search entry's group list for group with highest pri.  Grouping::GroupPri_t pri = Grouping::GROUPING_LOWEST;  GroupDef *fgd=0;  for (;(g=gli.current());++gli)  {    GroupDef *gd=0;    if (!g->groupname.isEmpty() &&        (gd=Doxygen::groupSDict[g->groupname]) &&	g->pri >= pri)    {      if( fgd && g->pri == pri ) {         warn(root->fileName.data(), root->startLine,           "Warning: Member %s found in multiple %s groups! "           "The member will be put in group %s, and not in group %s",	   md->name().data(), Grouping::getGroupPriName( pri ),	   gd->name().data(), fgd->name().data()          );      }      fgd = gd;      pri = g->pri;    }  }  // put member into group defined by this entry?  if( fgd )  {    GroupDef *mgd = md->getGroupDef();    bool insertit = FALSE;    if (mgd==0)      insertit = TRUE;    else if (mgd!=fgd)    {      bool moveit = FALSE;      // move member from one group to another if       // - the new one has a higher priority      // - the new entry has the same priority, but with docs where the old one had no docs      if( md->getGroupPri() < pri )	  moveit = TRUE;      else      {	  if( md->getGroupPri() == pri )	  {	      if( root->doc.length() != 0 && !md->getGroupHasDocs() )		  moveit = TRUE;	      else if( root->doc.length() != 0 && md->getGroupHasDocs() )	      {		  warn(md->getGroupFileName(),md->getGroupStartLine(),		       "Warning: Member documentation for %s found several times in %s groups!\n"		       "%s:%d: The member will remain in group %s, and won't be put into group %s",		       md->name().data(), Grouping::getGroupPriName( pri ),		       root->fileName.data(), root->startLine,		       mgd->name().data(),		       fgd->name().data()		       );	      }	  }      }      if( moveit )      {        mgd->removeMember(md);        insertit = TRUE;      }    }    if( insertit )    {      fgd->insertMember(md);      md->setGroupDef(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);      ClassDef *cd = md->getClassDefOfAnonymousType();      if (cd) cd->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);    }  }}void addExampleToGroups(Entry *root,PageInfo *eg){  QListIterator<Grouping> gli(*root->groups);  Grouping *g;  for (;(g=gli.current());++gli)  {    GroupDef *gd=0;    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname]))    {      gd->addExample(eg);      //printf("Example %s: in group %s\n",eg->name().data(),s->data());    }  }}QCString GroupDef::getOutputFileBase() const {   return convertNameToFile(fileName); }void GroupDef::addListReferences(){  addRefItem(todoId(),testId(),bugId(),             theTranslator->trGroup(TRUE,TRUE),             getOutputFileBase(),name()            );  MemberGroupListIterator mgli(*memberGroupList);  MemberGroup *mg;  for (;(mg=mgli.current());++mgli)  {    mg->addListReferences(this);  }  docDefineMembers.addListReferences(this);  docProtoMembers.addListReferences(this);  docTypedefMembers.addListReferences(this);  docEnumMembers.addListReferences(this);  docFuncMembers.addListReferences(this);  docVarMembers.addListReferences(this);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -