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

📄 htmlgen.cpp

📁 doxygen(一个自动从源代码生成文档的工具)的源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
        case '\t': spacesToNextTabStop =                          Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE"));                    t << spaces.left(spacesToNextTabStop);                    col+=spacesToNextTabStop;                    break;         case '\n': t << '\n'; col=0;                    break;        case '\r': break;        case '<':  t << "&lt;"; col++;                    break;        case '>':  t << "&gt;"; col++;                    break;        case '&':  t << "&amp;"; col++;                    break;        case '\\':                   if (*p=='<')                     { t << "&lt;"; p++; }                   else if (*p=='>')                     { t << "&gt;"; p++; }                   else                     t << "\\";                   col++;                   break;        default:   t << c;                       col++;                                       break;      }    }  }}void HtmlGenerator::writeChar(char c){  char cs[2];  cs[0]=c;  cs[1]=0;  docify(cs);}void HtmlGenerator::startClassDiagram(){  t << "<p>";}void HtmlGenerator::endClassDiagram(ClassDiagram &d,                                const char *fileName,const char *name){  t << ":\n<p><center><img src=\""    << fileName << ".gif\" usemap=\"#" << name << "_map\""    << " border=\"0\"></center>" << endl    << "<map name=\"" << name << "_map\">" << endl;  d.writeImage(t,dir,fileName);}//void HtmlGenerator::startColorFont(uchar red,uchar green,uchar blue)//{//  QCString colorString;//  colorString.sprintf("%02x%02x%02x",red,green,blue);//  t << "<font color=\"#" << colorString << "\">";//}////void HtmlGenerator::endColorFont()//{//  t << "</font>";//}void HtmlGenerator::writeFormula(const char *n,const char *text){  if (text && text[0]=='\\') t << "<p><center>" << endl;  t << "<img align=";#if !defined(_WIN32)  t << "\"top\"";            // assume Unix users use Netscape 4.x which does                             // not seem to support align == "middle" :-((#else  t << "\"middle\"";         // assume Windows users use IE or HtmlHelp which only                             // displays formulas nicely with align == "middle" #endif  t << " src=\"" << n << ".gif\">" << endl;  if (text && text[0]=='\\') t << "</center><p>" << endl;}void HtmlGenerator::startMemberList()  {   DBG_HTML(t << "<!-- startMemberList -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {  }  else  {    t << "<ul>" << endl;   }}void HtmlGenerator::endMemberList()    {   DBG_HTML(t << "<!-- endMemberList -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {  }  else  {    t << "</ul>" << endl;   }}// annonymous type://  0 = single column right aligned//  1 = double column left aligned//  2 = single column left alignedvoid HtmlGenerator::startMemberItem(int annoType) {   DBG_HTML(t << "<!-- startMemberItem() -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "<tr>";    switch(annoType)    {      case 0:  t << "<td nowrap align=right valign=top>"; break;      case 1:  t << "<td nowrap>"; break;      default: t << "<td nowrap valign=top>"; break;    }  }  else  {    t << "<li>";   }}void HtmlGenerator::endMemberItem(bool) {   //DBG_HTML(t << "<!-- endMemberItem(" << (int)inGroup << "," << fileName << "," << headerName << " -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "</td></tr>";   }  t << endl; }void HtmlGenerator::insertMemberAlign() {   DBG_HTML(t << "<!-- insertMemberAlign -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "&nbsp;</td><td valign=bottom>";   }}void HtmlGenerator::startMemberDescription() {   DBG_HTML(t << "<!-- startMemberDescription -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    //t << "<tr><td><img src=null.gif></td><td><img src=null.gif></td>"    //     "<td></td><td><font size=-1><em>";     t << "<tr><td>&nbsp;</td><td><font size=-1><em>";   }  else  {    t << "<dl class=\"el\"><dd><font size=-1><em>";  }}void HtmlGenerator::endMemberDescription()   {   DBG_HTML(t << "<!-- endMemberDescription -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "</em></font><br><br></td></tr>" << endl;   }  else  {    t << "<br><br></em></font></dl>";  }}void HtmlGenerator::startMemberSections(){  DBG_HTML(t << "<!-- startMemberSections -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "<table border=0 cellpadding=0 cellspacing=0>" << endl;  }}void HtmlGenerator::endMemberSections(){  DBG_HTML(t << "<!-- endMemberSections -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "</table>" << endl;  }}void HtmlGenerator::startMemberHeader(){  DBG_HTML(t << "<!-- startMemberHeader -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "<tr><td colspan=2><br><h2>";  }  else  {    startGroupHeader();  }}void HtmlGenerator::endMemberHeader(){  DBG_HTML(t << "<!-- endMemberHeader -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS"))  {    t << "</h2></td></tr>" << endl;  }  else  {    endGroupHeader();  }}void HtmlGenerator::startMemberSubtitle(){  DBG_HTML(t << "<!-- startMemberSubtitle -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS")) t << "<tr><td colspan=2>";}void HtmlGenerator::endMemberSubtitle(){  DBG_HTML(t << "<!-- endMemberSubtitle -->" << endl)  if (Config_getBool("HTML_ALIGN_MEMBERS")) t << "<br><br></td></tr>" << endl;}void HtmlGenerator::startIndexList() {   t << "<table>"  << endl; }void HtmlGenerator::endIndexList(){  t << "</table>" << endl;}void HtmlGenerator::startIndexKey() {   t << "  <tr bgcolor=\"#f0f0f0\"><td>"; }void HtmlGenerator::endIndexKey(){  t << "</td>";}void HtmlGenerator::startIndexValue(bool) {   t << "<td>"; }void HtmlGenerator::endIndexValue(const char *,bool){  t << "</td></tr>" << endl;}void HtmlGenerator::startAlphabeticalIndexList(){  t << "<table align=center width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" << endl;}void HtmlGenerator::endAlphabeticalIndexList(){  t << "</table>" << endl;}void HtmlGenerator::writeIndexHeading(const char *s){  t << "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">&nbsp;&nbsp;" << s     << "&nbsp;&nbsp;</td></tr></table>";}void HtmlGenerator::startImage(const char *name,const char *,bool hasCaption){  QCString baseName=name;  int i;  if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)  {    baseName=baseName.right(baseName.length()-i-1);   }  t << "<div align=\"center\">" << endl;  t << "<img src=\"" << name << "\" alt=\"" << baseName << "\">" << endl;  if (hasCaption)  {    t << "<p><strong>";  } }void HtmlGenerator::endImage(bool hasCaption){  if (hasCaption)  {    t << "</strong></p>" << endl;  }  t << "</div>" << endl;}void HtmlGenerator::startDotFile(const char *name,bool hasCaption){  QCString baseName=name;  int i;  if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)  {    baseName=baseName.right(baseName.length()-i-1);   }  QCString outName = Config_getString("HTML_OUTPUT")+#ifdef _WIN32    "\\"#else    "/"#endif    +baseName;  writeDotGraphFromFile(name,outName,GIF);  t << "<div align=\"center\">" << endl;  t << "<img src=\"" << baseName << ".gif\" alt=\"" << baseName << "\">" << endl;  if (hasCaption)  {    t << "<p><strong>";  } }void HtmlGenerator::endDotFile(bool hasCaption){  if (hasCaption)  {    t << "</strong></p>" << endl;  }  t << "</div>" << endl;}void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *) {   DBG_HTML(t << "<!-- startMemberDoc -->" << endl;)  t << "<p>" << endl;  t << "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">" << endl;  t << "  <tr>" << endl;  t << "    <td class=\"md\">" << endl;   t << "      <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" << endl;}void HtmlGenerator::startMemberDocPrefixItem(){  DBG_HTML(t << "<!-- startMemberDocPrefixItem -->" << endl;)  t << "        <tr>" << endl;  t << "          <td class=\"md\" colspan=\"4\">" << endl; }void HtmlGenerator::endMemberDocPrefixItem(){  DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;)  t << "</td>" << endl;  t << "        </tr>" << endl;}void HtmlGenerator::startMemberDocName(){  DBG_HTML(t << "<!-- startMemberDocName -->" << endl;)  t << "        <tr>" << endl;  t << "          <td class=\"md\" nowrap valign=\"top\"> ";}void HtmlGenerator::endMemberDocName(){  DBG_HTML(t << "<!-- endMemberDocName -->" << endl;)  t << "</td>" << endl;}void HtmlGenerator::startParameterList(){  DBG_HTML(t << "<!-- startParameterList -->" << endl;)  t << "          <td class=\"md\" valign=\"top\">(&nbsp;</td>" << endl;}void HtmlGenerator::startParameterType(bool first){  if (first)  {    DBG_HTML(t << "<!-- startFirstParameterType -->" << endl;)    t << "          <td class=\"md\" nowrap valign=\"top\">";  }  else  {    DBG_HTML(t << "<!-- startParameterType -->" << endl;)    t << "        <tr>" << endl;    t << "          <td></td>" << endl;    t << "          <td></td>" << endl;    t << "          <td class=\"md\" nowrap>";  }}void HtmlGenerator::endParameterType(){  DBG_HTML(t << "<!-- endParameterType -->" << endl;)  t << "&nbsp;</td>" << endl;}void HtmlGenerator::startParameterName(bool oneArgOnly){  DBG_HTML(t << "<!-- startParameterName -->" << endl;)  t << "          <td class=\"mdname";  if (oneArgOnly)   {    t << "1\" valign=\"top";  }  t << "\" nowrap>&nbsp;";}void HtmlGenerator::endParameterName(bool last,bool emptyList){  DBG_HTML(t << "<!-- endParameterName -->" << endl;)  if (last)  {    if (emptyList)    {      t << "          </td>" << endl;      t << "          <td class=\"md\" valign=\"top\">)&nbsp;</td>" << endl;      t << "          <td class=\"md\" nowrap>";    }    else    {      t << "</td>" << endl;      t << "        </tr>" << endl;      t << "        <tr>" << endl;      t << "          <td></td>" << endl;      t << "          <td class=\"md\">)&nbsp;</td>" << endl;      t << "          <td class=\"md\" colspan=\"2\">";    }  }  else  {    t << "</td>" << endl;    t << "        </tr>" << endl;  }}void HtmlGenerator::endParameterList(){  DBG_HTML(t << "<!-- endParameterList -->" << endl;)  t << "</td>" << endl;  t << "        </tr>" << endl;}void HtmlGenerator::endMemberDoc()     {   DBG_HTML(t << "<!-- endMemberDoc -->" << endl;)  t << endl;  t << "      </table>" << endl;  t << "    </td>" << endl;  t << "  </tr>" << endl;  t << "</table>" << endl; }void HtmlGenerator::startDotGraph(){}void HtmlGenerator::endDotGraph(DotClassGraph &g){  g.writeGraph(t,GIF,Config_getString("HTML_OUTPUT"));}void HtmlGenerator::startInclDepGraph(){}void HtmlGenerator::endInclDepGraph(DotInclDepGraph &g){  g.writeGraph(t,GIF,Config_getString("HTML_OUTPUT"));}void HtmlGenerator::writeGraphicalHierarchy(DotGfxHierarchyTable &g){  g.writeGraph(t,Config_getString("HTML_OUTPUT"));}void HtmlGenerator::startMemberGroupHeader(bool){  t << "<tr><td colspan=\"2\"><div class=\"groupHeader\">";}void HtmlGenerator::endMemberGroupHeader(){  t << "</div></td></tr>" << endl;}void HtmlGenerator::startMemberGroupDocs(){  t << "<tr><td colspan=\"2\"><div class=\"groupText\">";}void HtmlGenerator::endMemberGroupDocs(){  t << "<br><br></div></td></tr>" << endl;}void HtmlGenerator::startMemberGroup(){}void HtmlGenerator::endMemberGroup(bool){}void HtmlGenerator::startIndent()        {   // I really wanted to use CSS here to provide an indented section, but  // alas, Netscape is buggy enough to sometimes "forget" to end the  // indent cause a staircase effect where the indent continuously increases.  // It's back to abusing tables :-(    //t << "<div class=\"in\">" << endl;   t << "<table cellspacing=5 cellpadding=0 border=0>\n"       "  <tr>\n"       "    <td>\n"       "      &nbsp;\n"       "    </td>\n"       "    <td>\n";}void HtmlGenerator::endIndent()          {   t << "    </td>\n"       "  </tr>\n"       "</table>\n";  //t << "</div>" << endl; }void HtmlGenerator::addIndexItem(const char *,const char *){}void HtmlGenerator::writeNonBreakableSpace(int n){  int i;  for (i=0;i<n;i++)  {    t << "&nbsp;";  }}void HtmlGenerator::writeLineNumber(const char *ref,const char *file,                                    const char *anchor,int l){  QCString lineNumber,lineAnchor;  lineNumber.sprintf("%05d",l);  lineAnchor.sprintf("l%05d",l);  if (file)  {    startCodeAnchor(lineAnchor);    writeCodeLink(ref,file,anchor,lineNumber);    endCodeAnchor();  }  else  {    codify(lineNumber);  }  codify(" ");}

⌨️ 快捷键说明

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