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

📄 latexgen.cpp

📁 doxygen(一个自动从源代码生成文档的工具)的源代码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
      {        writeDefaultHeaderPart2(t);      }      break;    case isMainPage:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Introduction}\n"      break;    case isPackageIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Package Index}\n"      break;    case isModuleIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Module Index}\n"      break;    case isNamespaceIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Namespace Index}\"      break;    case isClassHierarchyIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Hierarchical Index}\n"      break;    case isCompoundIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Annotated Compound Index}\n"      break;    case isFileIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Annotated File Index}\n"      break;    case isPageIndex:      if (compactLatex) t << "\\section"; else t << "\\chapter";      t << "{"; //Annotated Page Index}\n"      break;    case isPackageDocumentation:      {        PackageSDict::Iterator pdi(Doxygen::packageDict);        PackageDef *pd=pdi.toFirst();        bool found=FALSE;        while (pd && !found)        {          if (compactLatex) t << "\\section"; else t << "\\chapter";          t << "{";           found=TRUE;          ++pdi;          pd=pdi.current();        }      }      break;    case isModuleDocumentation:      {        GroupSDict::Iterator gli(Doxygen::groupSDict);        GroupDef *gd;        bool found=FALSE;        for (gli.toFirst();(gd=gli.current()) && !found;++gli)        {          if (!gd->isReference())          {            if (compactLatex) t << "\\section"; else t << "\\chapter";            t << "{"; //Module Documentation}\n";            found=TRUE;          }        }      }      break;    case isNamespaceDocumentation:      {        NamespaceSDict::Iterator nli(Doxygen::namespaceSDict);        NamespaceDef *nd;        bool found=FALSE;        for (nli.toFirst();(nd=nli.current()) && !found;++nli)        {          if (nd->isLinkableInProject())          {            if (compactLatex) t << "\\section"; else t << "\\chapter";            t << "{"; // Namespace Documentation}\n":            found=TRUE;          }        }       }      break;    case isClassDocumentation:      {        ClassSDict::Iterator cli(Doxygen::classSDict);        ClassDef *cd=0;        bool found=FALSE;        for (cli.toFirst();(cd=cli.current()) && !found;++cli)        {          if (cd->isLinkableInProject() && cd->templateMaster()==0)          {            if (compactLatex) t << "\\section"; else t << "\\chapter";            t << "{"; //Compound Documentation}\n";            found=TRUE;          }        }      }      break;    case isFileDocumentation:      {        bool isFirst=TRUE;        FileName *fn=Doxygen::inputNameList.first();        while (fn)        {          FileDef *fd=fn->first();          while (fd)          {            if (fd->isLinkableInProject())            {              if (isFirst)              {                if (compactLatex) t << "\\section"; else t << "\\chapter";                t << "{"; //File Documentation}\n";                isFirst=FALSE;                break;              }            }            fd=fn->next();          }          fn=Doxygen::inputNameList.next();        }      }      break;    case isExampleDocumentation:      {        if (compactLatex) t << "\\section"; else t << "\\chapter";        t << "{"; //Example Documentation}\n";      }      break;    case isPageDocumentation:      {        if (compactLatex) t << "\\section"; else t << "\\chapter";        t << "{"; //Page Documentation}\n";      }      break;    case isEndIndex:      break;  }}void LatexGenerator::endIndexSection(IndexSections is){  bool &compactLatex = Config_getBool("COMPACT_LATEX");  QCString &latexHeader = Config_getString("LATEX_HEADER");  switch (is)  {    case isTitlePageStart:      break;    case isTitlePageAuthor:      if (latexHeader.isEmpty())      {        writeDefaultHeaderPart3(t);      }      break;    case isMainPage:      {        QCString indexName="index";        if (Config_getBool("GENERATE_TREEVIEW")) indexName="main";        t << "}\n\\label{index}";        if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}";        t << "\\input{" << indexName << "}\n";      }      break;    case isPackageIndex:      t << "}\n\\input{packages}\n";      break;    case isModuleIndex:      t << "}\n\\input{modules}\n";      break;    case isNamespaceIndex:      t << "}\n\\input{namespaces}\n";      break;    case isClassHierarchyIndex:      t << "}\n\\input{hierarchy}\n";      break;    case isCompoundIndex:      t << "}\n\\input{annotated}\n";      break;    case isFileIndex:      t << "}\n\\input{files}\n";      break;    case isPageIndex:      t << "}\n\\input{pages}\n";      break;    case isPackageDocumentation:      {        PackageSDict::Iterator pdi(Doxygen::packageDict);        PackageDef *pd=pdi.toFirst();        bool found=FALSE;        while (pd && !found)        {          t << "}\n\\input{" << pd->getOutputFileBase() << "}\n";          found=TRUE;          ++pdi;          pd=pdi.current();        }        while (pd)        {          if (compactLatex) t << "\\input"; else t << "\\include";          t << "{" << pd->getOutputFileBase() << "}\n";          ++pdi;          pd=pdi.current();        }      }      break;    case isModuleDocumentation:      {        GroupSDict::Iterator gli(Doxygen::groupSDict);        GroupDef *gd;        bool found=FALSE;        for (gli.toFirst();(gd=gli.current()) && !found;++gli)        {          if (!gd->isReference())          {            t << "}\n\\input{" << gd->getOutputFileBase() << "}\n";            found=TRUE;          }        }        for (;(gd=gli.current());++gli)        {          if (!gd->isReference())          {            if (compactLatex) t << "\\input"; else t << "\\include";            t << "{" << gd->getOutputFileBase() << "}\n";          }        }      }      break;    case isNamespaceDocumentation:      {        NamespaceSDict::Iterator nli(Doxygen::namespaceSDict);        NamespaceDef *nd;        bool found=FALSE;        for (nli.toFirst();(nd=nli.current()) && !found;++nli)        {          if (nd->isLinkableInProject())          {            t << "}\n\\input{" << nd->getOutputFileBase() << "}\n";            found=TRUE;          }        }        while ((nd=nli.current()))        {          if (nd->isLinkableInProject())          {            if (compactLatex) t << "\\input"; else t << "\\include";            t << "{" << nd->getOutputFileBase() << "}\n";          }          ++nli;        }      }      break;    case isClassDocumentation:      {        ClassSDict::Iterator cli(Doxygen::classSDict);        ClassDef *cd=0;        bool found=FALSE;        for (cli.toFirst();(cd=cli.current()) && !found;++cli)        {          if (cd->isLinkableInProject() && cd->templateMaster()==0)          {            t << "}\n\\input{" << cd->getOutputFileBase() << "}\n";            found=TRUE;          }        }        for (;(cd=cli.current());++cli)        {          if (cd->isLinkableInProject() && cd->templateMaster()==0)          {            if (compactLatex) t << "\\input"; else t << "\\include";            t << "{" << cd->getOutputFileBase() << "}\n";          }         }      }      break;    case isFileDocumentation:      {        bool isFirst=TRUE;        FileName *fn=Doxygen::inputNameList.first();        while (fn)        {          FileDef *fd=fn->first();          while (fd)          {            if (fd->isLinkableInProject())            {              if (isFirst)              {                t << "}\n\\input{" << fd->getOutputFileBase() << "}\n";                isFirst=FALSE;              }              else              {                if (compactLatex) t << "\\input" ; else t << "\\include";                t << "{" << fd->getOutputFileBase() << "}\n";              }            }            fd=fn->next();          }          fn=Doxygen::inputNameList.next();        }      }      break;    case isExampleDocumentation:      {        t << "}\n";        PageSDict::Iterator pdi(*Doxygen::exampleSDict);        PageInfo *pi=pdi.toFirst();        if (pi)        {          t << "\\input{" << convertNameToFile(pi->name+"-example") << "}\n";        }        for (++pdi;(pi=pdi.current());++pdi)        {          if (compactLatex) t << "\\input" ; else t << "\\include";          t << "{" << convertNameToFile(pi->name+"-example") << "}\n";        }      }      break;    case isPageDocumentation:      {        t << "}\n";        PageSDict::Iterator pdi(*Doxygen::pageSDict);        PageInfo *pi=pdi.toFirst();        bool first=TRUE;        for (pdi.toFirst();(pi=pdi.current());++pdi)        {          if (!pi->inGroup && !pi->isReference())          {            QCString pageName;            if (Config_getBool("CASE_SENSE_NAMES"))              pageName=pi->name.copy();            else              pageName=pi->name.lower();            if (compactLatex || first) t << "\\input" ; else t << "\\include";            t << "{" << pageName << "}\n";            first=FALSE;          }        }      }      break;    case isEndIndex:      t << "\\printindex\n";      t << "\\end{document}\n";      break;  }}void LatexGenerator::writeStyleInfo(int part){  switch(part)  {    case 0:      {        //QCString pname=Config_getString("PROJECT_NAME").stripWhiteSpace();        startPlainFile("doxygen.sty");        writeDefaultStyleSheetPart1(t);      }      break;    case 1:    case 3:      t << " Doxygen ";      break;    case 2:      {        t << " Dimitri van Heesch \\copyright~1997-2001";        t << "}]{}\n";        writeDefaultStyleSheetPart2(t);      }      break;    case 4:      {        t << " Dimitri van Heesch \\copyright~1997-2001";        writeDefaultStyleSheetPart3(t);        endPlainFile();      }      break;  }}void LatexGenerator::newParagraph(){  t << endl << endl;}void LatexGenerator::writeString(const char *text){  t << text;}void LatexGenerator::writeIndexItem(const char *ref,const char *fn,                                    const char *name){  t << "\\item ";  if (!ref && fn)  {    t << "\\contentsline{section}{";    docify(name);    t << "}{\\pageref{" << fn << "}}{}" << endl;  }  else    docify(name);}//void LatexGenerator::writeIndexFileItem(const char *,const char *text)//{//  t << "\\item\\contentsline{section}{";//  docify(text);//  t << "}{\\pageref{" << text << "}}" << endl;//}void LatexGenerator::startHtmlLink(const char *url){  if (Config_getBool("PDF_HYPERLINKS"))  {    t << "\\href{";    t << url;    t << "}";  }  t << "{\\tt ";}void LatexGenerator::endHtmlLink(){  t << "}";}void LatexGenerator::writeMailLink(const char *url){  if (Config_getBool("PDF_HYPERLINKS"))  {    t << "\\href{mailto:";    t << url;    t << "}";  }  t << "{\\tt ";   docify(url);  t << "}";}void LatexGenerator::writeStartAnnoItem(const char *,const char *,                                        const char *path,const char *name){  t << "\\item\\contentsline{section}{{\\bf ";  if (path) docify(path);  docify(name);   t << "} ";}void LatexGenerator::writeEndAnnoItem(const char *name){  t << "}{\\pageref{" << name << "}}{}" << endl;}void LatexGenerator::startIndexKey(){  t << "\\item\\contentsline{section}{";}

⌨️ 快捷键说明

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