📄 classdef.cpp
字号:
{ Doxygen::tagFile << " protection=\"protected\""; } else if (bcd->prot==Private) { Doxygen::tagFile << " protection=\"private\""; } if (bcd->virt==Virtual) { Doxygen::tagFile << " virtualness=\"virtual\""; } Doxygen::tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl; } ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers); } else { ol.docify(cd->name()); } } else { err("Error: invalid marker %d in inherits list!\n",entryIndex); } index=newIndex+matchLen; } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); } // write subclasses if ((count=m_inheritedBy->count())>0) { QCString inheritLine = theTranslator->trInheritedByList(m_inheritedBy->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; // now replace all markers in inheritLine with links to the classes while ((newIndex=marker.match(inheritLine,index,&matchLen))!=-1) { parseText(ol,inheritLine.mid(index,newIndex-index)); bool ok; uint entryIndex = inheritLine.mid(newIndex+1,matchLen-1).toUInt(&ok); BaseClassDef *bcd=m_inheritedBy->at(entryIndex); if (ok && bcd) { ClassDef *cd=bcd->classDef; if (cd->isLinkable()) { ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); } else { ol.docify(cd->name()); } writeInheritanceSpecifier(ol,bcd); } index=newIndex+matchLen; } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); } if (Config_getBool("CLASS_DIAGRAMS")) ol.enableAll(); count=0; BaseClassDef *ibcd; ibcd=m_inheritedBy->first(); while (ibcd) { ClassDef *icd=ibcd->classDef; if ( icd->isVisibleInHierarchy()) count++; ibcd=m_inheritedBy->next(); } ibcd=m_inherits->first(); while (ibcd) { ClassDef *icd=ibcd->classDef; if ( icd->isVisibleInHierarchy()) count++; ibcd=m_inherits->next(); } if (Config_getBool("HAVE_DOT") && Config_getBool("CLASS_GRAPH")) // write class diagram using dot { DotClassGraph inheritanceGraph(this,DotClassGraph::Inheritance); if (!inheritanceGraph.isTrivial()) { ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); ol.startDotGraph(); parseText(ol,theTranslator->trClassDiagram(name())); ol.endDotGraph(inheritanceGraph); if (Config_getBool("GENERATE_LEGEND")) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); ol.writeString("<center><font size=\"2\">["); ol.startHtmlLink("graph_legend.html"); ol.docify(theTranslator->trLegend()); ol.endHtmlLink(); ol.writeString("]</font></center>"); ol.popGeneratorState(); } ol.popGeneratorState(); } } else if (Config_getBool("CLASS_DIAGRAMS") && count>0) // write class diagram using build-in generator { ClassDiagram diagram(this); // create a diagram of this class. ol.startClassDiagram(); ol.disable(OutputGenerator::Man); parseText(ol,theTranslator->trClassDiagram(name())); ol.enable(OutputGenerator::Man); ol.endClassDiagram(diagram,getOutputFileBase(),name()); } if (Config_getBool("HAVE_DOT") && Config_getBool("COLLABORATION_GRAPH")) { DotClassGraph usageImplGraph(this,DotClassGraph::Implementation); if (!usageImplGraph.isTrivial()) { ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); ol.startDotGraph(); parseText(ol,theTranslator->trCollaborationDiagram(name())); ol.endDotGraph(usageImplGraph); if (Config_getBool("GENERATE_LEGEND")) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); ol.writeString("<center><font size=\"2\">["); ol.startHtmlLink("graph_legend.html"); ol.docify(theTranslator->trLegend()); ol.endHtmlLink(); ol.writeString("]</font></center>"); ol.popGeneratorState(); } ol.popGeneratorState(); } } // write link to list of all members (HTML only) if (m_allMemberNameInfoSDict->count()>0 && !Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(m_memListFileName,0); parseText(ol,theTranslator->trListOfAllMembers()); ol.endTextLink(); ol.enableAll(); } ol.endTextBlock(); // write member groups ol.startMemberSections(); // write user defined member groups MemberGroupListIterator mgli(*m_memberGroupList); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section { mg->writeDeclarations(ol,this,0,0,0); } else // add this group to the corresponding member section { mg->addToDeclarationSection(); } } // public types pubTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicTypes(),0); // public methods pubSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicSlots(),0); signals.writeDeclarations(ol,this,0,0,0,theTranslator->trSignals(),0); dcopMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trDCOPMethods(),0); properties.writeDeclarations(ol,this,0,0,0,theTranslator->trProperties(),0); pubMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicMembers(),0); pubStaticMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicMembers(),0); // public attribs pubAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicAttribs(),0); pubStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicAttribs(),0); // protected types proTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedTypes(),0); // protected methods proSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedSlots(),0); proMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedMembers(),0); proStaticMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedMembers(),0); // protected attribs proAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedAttribs(),0); proStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedAttribs(),0); if (Config_getBool("EXTRACT_PRIVATE")) { // private types priTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateTypes(),0); // private members priSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateSlots(),0); priMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateMembers(),0); priStaticMembers.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateMembers(),0); // private attribs priAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateAttribs(),0); priStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateAttribs(),0); } // friends friends.writeDeclarations(ol,this,0,0,0,theTranslator->trFriends(),0); // related functions related.writeDeclarations(ol,this,0,0,0, theTranslator->trRelatedFunctions(), theTranslator->trRelatedSubscript() ); ol.endMemberSections(); // write detailed description if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || !documentation().isEmpty() || /*(Config_getBool("SOURCE_BROWSER") && startBodyLine!=-1 && bodyDef) ||*/ exampleFlag) { 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(); ol.startTextBlock(); writeTemplateSpec(ol,this,pageType); // repeat brief description if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) { ol+=briefOutput; } if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && !documentation().isEmpty()) { ol.newParagraph(); } // write documentation if (!documentation().isEmpty()) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::RTF); ol.newParagraph(); ol.popGeneratorState(); parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); } // write examples if (exampleFlag) { ol.startDescList(BaseOutputDocInterface::Examples); parseText(ol,theTranslator->trExamples()+": "); ol.endDescTitle(); ol.writeDescItem(); ol.newParagraph(); writeExample(ol,m_exampleSDict); //ol.endDescItem(); ol.endDescList(); } ol.newParagraph(); writeSourceDef(ol,name()); ol.endTextBlock(); } else { writeTemplateSpec(ol,this,pageType); } typedefMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberTypedefDocumentation()); enumMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberEnumerationDocumentation()); constructors.writeDocumentation(ol,name(),this, theTranslator->trConstructorDocumentation()); functionMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberFunctionDocumentation()); relatedMembers.writeDocumentation(ol,name(),this, theTranslator->trRelatedFunctionDocumentation()); variableMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberDataDocumentation()); propertyMembers.writeDocumentation(ol,name(),this, theTranslator->trPropertyDocumentation()); ol.startTextBlock(); // write the list of used files (not for man pages) ol.pushGeneratorState(); if (Config_getBool("SHOW_USED_FILES")) { ol.disable(OutputGenerator::Man); ol.writeRuler(); parseText(ol,theTranslator->trGeneratedFromFiles(m_compType,m_files.count()==1)); bool first=TRUE; const char *file = m_files.first(); while (file) { bool ambig; FileDef *fd=findFileDef(Doxygen::inputNameDict,file,ambig); if (fd) { if (first) { first=FALSE; ol.startItemList(); } ol.writeListItem(); QCString path=fd->getPath().copy(); if (Config_getBool("FULL_PATH_NAMES")) { ol.docify(stripFromPath(path)); } if (fd->generateSourceFile()) { ol.writeObjectLink(0,fd->getSourceFileBase(),0,fd->name()); } else if (fd->isLinkable()) { ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, fd->name()); } else { ol.docify(fd->name()); } } file=m_files.next(); } if (!first) ol.endItemList(); } // write Author section (Man only) ol.enable(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man); ol.writeString("\n"); ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor(TRUE,TRUE)); ol.endGroupHeader(); parseText(ol,theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); ol.popGeneratorState(); ol.endTextBlock(); if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { writeDocAnchorsToTagFile(); Doxygen::tagFile << " </compound>" << endl; } endFile(ol);}void ClassDef::writeDocumentationForInnerClasses(OutputList &ol){ // write inner classes after the parent, so the tag files contain // the definition in proper order! if (m_innerClasses) { ClassSDict::Iterator cli(*m_innerClasses); ClassDef *innerCd; for (cli.toFirst();(innerCd=cli.current());++cli) { if (innerCd->isLinkableInProject() && innerCd->templateMaster()==0) { msg("Generating docs for nested compound %s...\n",innerCd->name().data()); innerCd->writeDocumentation(ol); innerCd->writeMemberList(ol); } } }}// write the list of all (inherited) members for this classvoid ClassDef::writeMemberList(OutputList &ol){ if (m_allMemberNameInfoSDict->count()==0 || Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -