Exemple #1
0
void GroupDef::writeFiles(OutputList &ol,const QCString &title)
{
  // write list of files
  if (fileList->count()>0)
  {
    ol.startMemberHeader("files");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    FileDef *fd=fileList->first();
    while (fd)
    {
      ol.startMemberItem(fd->getOutputFileBase(),0);
      ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
      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();
      if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription(fd->getOutputFileBase());
        ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE);
        ol.endMemberDescription();
      }
      fd=fileList->next();
    }
    ol.endMemberList();
  }
}
Exemple #2
0
void GroupDef::writeDirs(OutputList &ol,const QCString &title)
{
  // write list of directories
  if (dirList->count()>0)
  {
    ol.startMemberHeader("dirs");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    DirDef *dd=dirList->first();
    while (dd)
    {
      ol.startMemberItem(dd->getOutputFileBase(),0);
      ol.parseText(theTranslator->trDir(FALSE,TRUE));
      ol.insertMemberAlign();
      ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
      ol.endMemberItem();
      if (!Config_getString("GENERATE_TAGFILE").isEmpty()) 
      {
        Doxygen::tagFile << "    <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
      }
      if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription(dd->getOutputFileBase());
        ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE);
        ol.endMemberDescription();
      }
      dd=dirList->next();
    }

    ol.endMemberList();
  }
}
Exemple #3
0
void GroupDef::writeDirs(OutputList &ol,const QCString &title)
{
  // write list of directories
  if (dirList->count()>0)
  {
    ol.startMemberHeader("dirs");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    QListIterator<DirDef> it(*dirList);
    DirDef *dd;
    for (;(dd=it.current());++it)
    {
      if (!dd->hasDocumentation()) continue;
      ol.startMemberDeclaration();
      ol.startMemberItem(dd->getOutputFileBase(),0);
      ol.parseText(theTranslator->trDir(FALSE,TRUE));
      ol.insertMemberAlign();
      ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
      ol.endMemberItem();
      if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
      {
        ol.startMemberDescription(dd->getOutputFileBase());
        ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE);
        ol.endMemberDescription();
      }
      ol.endMemberDeclaration(0,0);
    }

    ol.endMemberList();
  }
}
Exemple #4
0
void GroupDef::writeNestedGroups(OutputList &ol,const QCString &title)
{
  // write list of groups
  if (groupList->count()>0)
  {
    ol.startMemberHeader("groups");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    GroupDef *gd=groupList->first();
    while (gd)
    {
      ol.startMemberItem(gd->getOutputFileBase(),0);
      //ol.docify(theTranslator->trGroup(FALSE,TRUE));
      //ol.docify(" ");
      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();
      if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription(gd->getOutputFileBase());
        ol.parseDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE);
        ol.endMemberDescription();
      }
      gd=groupList->next();
    }
    ol.endMemberList();
  }
}
Exemple #5
0
void GroupDef::writeFiles(OutputList &ol,const QCString &title)
{
  // write list of files
  if (fileList->count()>0)
  {
    ol.startMemberHeader("files");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    QListIterator<FileDef> it(*fileList);
    FileDef *fd;
    for (;(fd=it.current());++it)
    {
      if (!fd->hasDocumentation()) continue;
      ol.startMemberDeclaration();
      ol.startMemberItem(fd->getOutputFileBase(),0);
      ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
      ol.insertMemberAlign();
      ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
      ol.endMemberItem();
      if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
      {
        ol.startMemberDescription(fd->getOutputFileBase());
        ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE);
        ol.endMemberDescription();
      }
      ol.endMemberDeclaration(0,0);
    }
    ol.endMemberList();
  }
}
Exemple #6
0
void DirDef::writeFileList(OutputList &ol)
{
  // write file list
  if (m_fileList->count()>0)
  {
    ol.startMemberHeader("files");
    ol.parseText(theTranslator->trFile(TRUE,FALSE));
    ol.endMemberHeader();
    ol.startMemberList();
    QListIterator<FileDef> it(*m_fileList);
    FileDef *fd;
    for (;(fd=it.current());++it)
    {
      if (!fd->hasDocumentation()) continue;
      ol.startMemberDeclaration();
      ol.startMemberItem(fd->getOutputFileBase(),0);
      ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
      ol.insertMemberAlign();
      if (fd->isLinkable())
      {
        ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
      }
      else
      {
        ol.startBold();
        ol.docify(fd->name()); 
        ol.endBold();
      }
      if (fd->generateSourceFile())
      {
        ol.pushGeneratorState();
        ol.disableAllBut(OutputGenerator::Html);
        ol.docify(" ");
        ol.startTextLink(fd->includeName(),0);
        ol.docify("[");
        ol.parseText(theTranslator->trCode());
        ol.docify("]");
        ol.endTextLink();
        ol.popGeneratorState();
      }
      ol.endMemberItem();
      if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription(fd->getOutputFileBase());
        ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
            FALSE, // indexWords
            FALSE, // isExample
            0,     // exampleName
            TRUE,  // single line
            TRUE   // link from index
           );
        ol.endMemberDescription();
      }
      ol.endMemberDeclaration(0,0);
    }
    ol.endMemberList();
  }
}
void MemberList::writeDeclarations(OutputList &ol,
             ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
             const char *title,const char *subtitle, bool showEnumValues
             /*, bool inGroup,bool countSubGroups*/)
{
  //printf("----- writeDeclaration() ----\n");
  countDecMembers(showEnumValues); // count member not in group
  if (numDecMembers()==0) return;
  //printf("MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n",title,subtitle,numDecMembers());
  if (title) 
  {
    ol.startMemberHeader();
    ol.parseText(title);
    ol.endMemberHeader();
  }
  if (subtitle && subtitle[0]!=0) 
  {
    //printf("subtitle=`%s'\n",subtitle);
    ol.startMemberSubtitle();
    ol.parseDoc("[generated]",-1,0,0,subtitle,FALSE,FALSE);
    ol.endMemberSubtitle();
  }

  writePlainDeclarations(ol,cd,nd,fd,gd);
  
  //printf("memberGroupList=%p\n",memberGroupList);
  if (memberGroupList)
  {
    MemberGroupListIterator mgli(*memberGroupList);
    MemberGroup *mg;
    while ((mg=mgli.current()))
    {
      bool hasHeader=mg->header()!="[NOHEADER]";
      ol.startMemberGroupHeader(hasHeader);
      if (hasHeader)
      {
        ol.parseText(mg->header());
      }
      ol.endMemberGroupHeader();
      if (!mg->documentation().isEmpty())
      {
        //printf("Member group has docs!\n");
        ol.startMemberGroupDocs();
        ol.parseDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE);
        ol.endMemberGroupDocs();
      }
      ol.startMemberGroup();
      //printf("--- mg->writePlainDeclarations ---\n");
      mg->writePlainDeclarations(ol,cd,nd,fd,gd);
      ol.endMemberGroup(hasHeader);
      ++mgli;
    }
  }
  //printf("----- end writeDeclaration() ----\n");

}
Exemple #8
0
void GroupDef::writeNestedGroups(OutputList &ol,const QCString &title)
{
  // write list of groups
  int count=0;
  if (groupList->count()>0)
  {
    QListIterator<GroupDef> it(*groupList);
    GroupDef *gd;
    for (;(gd=it.current());++it)
    {
      if (gd->isVisible()) count++;
    }
  }
  if (count>0)
  {
    ol.startMemberHeader("groups");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    if (Config_getBool("SORT_GROUP_NAMES"))
    {
      groupList->sort();
    }
    QListIterator<GroupDef> it(*groupList);
    GroupDef *gd;
    for (;(gd=it.current());++it)
    {
      if (gd->isVisible())
      {
        ol.startMemberDeclaration();
        ol.startMemberItem(gd->getOutputFileBase(),0);
        //ol.docify(theTranslator->trGroup(FALSE,TRUE));
        //ol.docify(" ");
        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();
        if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
        {
          ol.startMemberDescription(gd->getOutputFileBase());
          ol.generateDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE);
          ol.endMemberDescription();
        }
        ol.endMemberDeclaration(0,0);
      }
    }
    ol.endMemberList();
  }
}
Exemple #9
0
void DirDef::writeSubDirList(OutputList &ol)
{
  int numSubdirs = 0;
  QListIterator<DirDef> it(m_subdirs);
  DirDef *dd;
  for (it.toFirst();(dd=it.current());++it)
  {
    if (dd->hasDocumentation() || dd->getFiles()->count()>0)
    {
      numSubdirs++;
    }
  }

  // write subdir list
  if (numSubdirs>0)
  {
    ol.startMemberHeader("subdirs");
    ol.parseText(theTranslator->trDir(TRUE,FALSE));
    ol.endMemberHeader();
    ol.startMemberList();
    for (it.toFirst();(dd=it.current());++it)
    {
      if (dd->hasDocumentation() || dd->getFiles()->count()==0)
      {
        ol.startMemberDeclaration();
        ol.startMemberItem(dd->getOutputFileBase(),0);
        ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
        ol.insertMemberAlign();
        ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
        ol.endMemberItem();
        if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
        {
          ol.startMemberDescription(dd->getOutputFileBase());
          ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
              FALSE, // indexWords
              FALSE, // isExample
              0,     // exampleName
              TRUE,  // single line
              TRUE   // link from index
              );
          ol.endMemberDescription();
        }
        ol.endMemberDeclaration(0,0);
      }
    }

    ol.endMemberList();
  }
}
Exemple #10
0
void DirDef::writeSubDirList(OutputList &ol)
{
  // write subdir list
  if (m_subdirs.count()>0)
  {
    ol.startMemberHeader();
    ol.parseText(theTranslator->trDir(TRUE,FALSE));
    ol.endMemberHeader();
    ol.startMemberList();
    DirDef *dd=m_subdirs.first();
    while (dd)
    {
      ol.startMemberItem(0);
      ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
      ol.insertMemberAlign();
      ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
      ol.endMemberItem();
      if (!Config_getString("GENERATE_TAGFILE").isEmpty()) 
      {
        Doxygen::tagFile << "    <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
      }
      if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startParagraph();
        ol.startMemberDescription();
        ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
            FALSE, // indexWords
            FALSE, // isExample
            0,     // exampleName
            FALSE, // single line
            TRUE   // link from index
           );
        ol.endMemberDescription();
        ol.endParagraph();
      }
      dd=m_subdirs.next();
    }

    ol.endMemberList();
  }
}
Exemple #11
0
void DirDef::writeFileList(OutputList &ol)
{
  // write file list
  if (m_fileList->count()>0)
  {
    ol.startMemberHeader();
    ol.parseText(theTranslator->trFile(TRUE,FALSE));
    ol.endMemberHeader();
    ol.startMemberList();
    FileDef *fd=m_fileList->first();
    while (fd)
    {
      ol.startMemberItem(0);
      ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
      ol.insertMemberAlign();
      if (fd->isLinkable())
      {
        ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
      }
      else
      {
        ol.startBold();
        ol.docify(fd->name()); 
        ol.endBold();
      }
      if (fd->generateSourceFile())
      {
        ol.pushGeneratorState();
        ol.disableAllBut(OutputGenerator::Html);
        ol.docify(" ");
        ol.startTextLink(fd->includeName(),0);
        ol.docify("[");
        ol.parseText(theTranslator->trCode());
        ol.docify("]");
        ol.endTextLink();
        ol.popGeneratorState();
      }
      if (!Config_getString("GENERATE_TAGFILE").isEmpty()) 
      {
        Doxygen::tagFile << "    <file>" << convertToXML(fd->name()) << "</file>" << endl;
      }
      ol.endMemberItem();
      if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startParagraph();
        ol.startMemberDescription();
        ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
            FALSE, // indexWords
            FALSE, // isExample
            0,     // exampleName
            FALSE, // single line
            TRUE   // link from index
           );
        ol.endMemberDescription();
        ol.endParagraph();
      }
      fd=m_fileList->next();
    }
    ol.endMemberList();
  }
}
Exemple #12
0
/** Writes the list of members to the output.
 *  @param ol Output list to write to
 *  @param cd non-null if this list is part of class documentation.
 *  @param nd non-null if this list is part of namespace documentation.
 *  @param fd non-null if this list is part of file documentation.
 *  @param gd non-null if this list is part of group documentation.
 *  @param title Title to use for the member list.
 *  @param subtitle Sub title to use for the member list.
 *  @param compoundType Container type for this member list.
 *  @param showEnumValues Obsolete, always set to FALSE.
 *  @param showInline if set to TRUE if title is rendered differently
 *  @param inheritedFrom if not 0, the list is shown inside the
 *         given class as inherited members, parameter cd points to the
 *         class containing the members.
 *  @param lt Type of list that is inherited from.
 */
void MemberList::writeDeclarations(OutputList &ol,
             ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
             const char *title,const char *subtitle,
             const DefinitionIntf::DefType compoundType,bool showEnumValues,
             bool showInline,ClassDef *inheritedFrom,MemberListType lt)
{
  (void)showEnumValues; // unused

  //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
  static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
  QCString inheritId;

  countDecMembers(/*showEnumValues*/FALSE,gd); // count members shown in this section
  Definition *ctx = cd;
  if (ctx==0 && nd) ctx = nd;
  if (ctx==0 && gd) ctx = gd;
  if (ctx==0 && fd) ctx = fd;

  //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d inheritedFrom=%p\n",
  //       this,title,subtitle,numDecMembers(),inheritedFrom);

  int num = numDecMembers();
  if (inheritedFrom)
  {
    //if ( cd && !optimizeVhdl && countInheritableMembers(inheritedFrom)>0 )
    if ( cd && !optimizeVhdl && cd->countMembersIncludingGrouped(
                                      m_listType,inheritedFrom,TRUE)>0 )
    {
      ol.pushGeneratorState();
      ol.disableAllBut(OutputGenerator::Html);
      inheritId = substitute(listTypeAsString(lt),"-","_")+"_"+
                  stripPath(cd->getOutputFileBase());
      if (title)
      {
        ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
                                      cd->getOutputFileBase(), 
                                      cd->anchor(),title,cd->displayName());
      }
      ol.popGeneratorState();
    }
  }
  else if (num>0)
  {
    if (title) 
    {
      if (showInline)
      {
        ol.startInlineHeader();
      }
      else
      {
        ol.startMemberHeader(listTypeAsString(m_listType));
      }
      ol.parseText(title);
      if (showInline)
      {
        ol.endInlineHeader();
      }
      else
      {
        ol.endMemberHeader();
      }
    }
    if (subtitle) 
    {
      QCString st=subtitle;
      st = st.stripWhiteSpace();
      if (!st.isEmpty())
      {
        ol.startMemberSubtitle();
        ol.generateDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE);
        ol.endMemberSubtitle();
      }
    }
  }
  if (num>0)
  {
    // TODO: Two things need to be worked out for proper VHDL output:
    // 1. Signals and types under the group need to be
    //    formatted to associate them with the group somehow
    //    indentation, or at the very least, extra space after
    //    the group is done
    // 2. This might need to be repeated below for memberGroupLists
    if (optimizeVhdl) // use specific declarations function
    {
      VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0,0);
    }
    else
    {
      writePlainDeclarations(ol,cd,nd,fd,gd,compoundType,inheritedFrom,inheritId);
    }

    //printf("memberGroupList=%p\n",memberGroupList);
    if (memberGroupList)
    {
      MemberGroupListIterator mgli(*memberGroupList);
      MemberGroup *mg;
      while ((mg=mgli.current()))
      {
        bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
        if (inheritId.isEmpty())
        {
          //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
          ol.startMemberGroupHeader(hasHeader);
          if (hasHeader)
          {
            ol.parseText(mg->header());
          }
          ol.endMemberGroupHeader();
          if (!mg->documentation().isEmpty())
          {
            //printf("Member group has docs!\n");
            ol.startMemberGroupDocs();
            ol.generateDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE);
            ol.endMemberGroupDocs();
          }
          ol.startMemberGroup();
        }
        //printf("--- mg->writePlainDeclarations ---\n");
        mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
        if (inheritId.isEmpty())
        {
          ol.endMemberGroup(hasHeader);
        }
        ++mgli;
      }
    }
  }
  if (inheritedFrom && cd) 
  {
    // also add members that of this list type, that are grouped together
    // in a separate list in class 'inheritedFrom'
    cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
  }
  //printf("----- end writeDeclaration() ----\n");
}
Exemple #13
0
void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,
                                      bool const isConstantGroup,bool localName)
{


    if (count()==0) return; // no namespaces in the list

    if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) return;


    SDict<NamespaceDef>::Iterator ni(*this);
    NamespaceDef *nd;
    bool found=FALSE;
    for (ni.toFirst(); (nd=ni.current()) && !found; ++ni)
    {
        if (nd->isLinkable())
        {
            SrcLangExt lang = nd->getLanguage();
            if (SrcLangExt_IDL==lang)
            {
                if (isConstantGroup == nd->isConstantGroup())
                {
                    found=TRUE;
                    break;
                }
            }
            else if (!isConstantGroup) // ensure we only get extra section in IDL
            {
                if (nd->isConstantGroup())
                {
                    err("Internal inconsistency: constant group but not IDL?\n");
                }
                found=TRUE;
                break;
            }
        }
    }
    if (!found) return; // no linkable namespaces in the list

    // write list of namespaces
    ol.startMemberHeader("namespaces");
    //bool javaOpt    = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
    //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
    ol.parseText(title);
    ol.endMemberHeader();
    ol.startMemberList();
    for (ni.toFirst(); (nd=ni.current()); ++ni)
    {
        if (nd->isLinkable())
        {
            SrcLangExt lang = nd->getLanguage();
            if (lang==SrcLangExt_IDL && (isConstantGroup != nd->isConstantGroup()))
                continue; // will be output in another pass, see layout_default.xml
            ol.startMemberDeclaration();
            ol.startMemberItem(nd->getOutputFileBase(),0);
            QCString ct = nd->compoundTypeString();
            ol.docify(ct);
            ol.docify(" ");
            ol.insertMemberAlign();
            QCString name;
            if (localName)
            {
                name = nd->localName();
            }
            else
            {
                name = nd->displayName();
            }
            ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,name);
            ol.endMemberItem();
            if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
            {
                ol.startMemberDescription(nd->getOutputFileBase());
                ol.generateDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE);
                ol.endMemberDescription();
            }
            ol.endMemberDeclaration(0,0);
        }
    }
    ol.endMemberList();
}
Exemple #14
0
void MemberList::writeDeclarations(OutputList &ol,
             ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
             const char *title,const char *subtitle, bool showEnumValues
             /*, bool inGroup,bool countSubGroups*/)
{
  //printf("----- writeDeclaration() this=%p ----\n",this);
  static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL");

  countDecMembers(showEnumValues); // count member not in group
  Definition *ctx = cd;
  if (ctx==0 && nd) ctx = nd;
  if (ctx==0 && gd) ctx = gd;
  if (ctx==0 && fd) ctx = fd;

  if (numDecMembers()==0) return;
  //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n",
  //    this,title,subtitle,numDecMembers());
  if (title) 
  {
    ol.startMemberHeader();
    ol.parseText(title);
    ol.endMemberHeader();
  }
  if (subtitle) 
  {
    QCString st=subtitle;
    st = st.stripWhiteSpace();
    if (!st.isEmpty())
    {
      ol.startMemberSubtitle();
      ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE);
      ol.endMemberSubtitle();
    }
  }

  // TODO: Two things need to be worked out for proper VHDL output:
  // 1. Signals and types under the group need to be
  //    formatted to associate them with the group somehow
  //    indentation, or at the very least, extra space after
  //    the group is done
  // 2. This might need to be repeated below for memberGroupLists
  if (optimizeVhdl) // use specific declarations function
  {
    VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0);
  }
  else
  {
    writePlainDeclarations(ol,cd,nd,fd,gd);
  }
 
  //printf("memberGroupList=%p\n",memberGroupList);
  if (memberGroupList)
  {
    MemberGroupListIterator mgli(*memberGroupList);
    MemberGroup *mg;
    while ((mg=mgli.current()))
    {
      //printf("mg->header=%s\n",mg->header().data());
      bool hasHeader=mg->header()!="[NOHEADER]";
      ol.startMemberGroupHeader(hasHeader);
      if (hasHeader)
      {
        ol.parseText(mg->header());
      }
      ol.endMemberGroupHeader();
      if (!mg->documentation().isEmpty())
      {
        //printf("Member group has docs!\n");
        ol.startMemberGroupDocs();
        ol.parseDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE);
        ol.endMemberGroupDocs();
      }
      ol.startMemberGroup();
      //printf("--- mg->writePlainDeclarations ---\n");
      mg->writePlainDeclarations(ol,cd,nd,fd,gd);
      ol.endMemberGroup(hasHeader);
      ++mgli;
    }
  }
  //printf("----- end writeDeclaration() ----\n");

}
void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,
                                  const char *header,bool localNames)
{
  if (count()>0)
  {
    ClassSDict::Iterator sdi(*this);
    ClassDef *cd=0;
    bool found=FALSE;
    for (sdi.toFirst();(cd=sdi.current());++sdi)
    {
      if (cd->name().find('@')==-1 && 
          (filter==0 || *filter==cd->compoundType())
         )
      {
        bool isLink = cd->isLinkable();
        if (isLink || 
             (!Config_getBool("HIDE_UNDOC_CLASSES") && 
              (!cd->isLocal() || Config_getBool("EXTRACT_LOCAL_CLASSES"))
             )
           )
        {
          if (!found)
          {
            ol.startMemberHeader();
            if (header)
            {
              ol.parseText(header);
            }
            else
            {
              ol.parseText(theTranslator->trCompounds());
            }
            ol.endMemberHeader();
            ol.startMemberList();
            found=TRUE;
          }
          if (!Config_getString("GENERATE_TAGFILE").isEmpty()) 
          {
            Doxygen::tagFile << "    <class kind=\"" << cd->compoundTypeString() 
                    << "\">" << convertToXML(cd->name()) << "</class>" << endl;
          }
          ol.startMemberItem(FALSE);
          QCString tmp = cd->compoundTypeString();
          QCString cname;
          if (localNames)
          {
            cname = cd->localName();
          }
          else
          {
            cname = cd->displayName();
          }
          ol.writeString(tmp);
          ol.writeString(" ");
          ol.insertMemberAlign();
          if (isLink) 
          {
            ol.writeObjectLink(cd->getReference(),
                cd->getOutputFileBase(),
                0,
                cname
               );
          }
          else 
          {
            ol.startBold();
            ol.docify(cname);
            ol.endBold();
          }
          ol.endMemberItem();
          if (!cd->briefDescription().isEmpty())
          {
            ol.startMemberDescription();
            ol.parseDoc(cd->briefFile(),cd->briefLine(),cd,0,
                        cd->briefDescription(),FALSE,FALSE);
            if (//(!cd->briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) ||
                //!cd->documentation().isEmpty())
                cd->isLinkableInProject()
               )
            {
              ol.pushGeneratorState();
              ol.disableAllBut(OutputGenerator::Html);
              //ol.endEmphasis();
              ol.docify(" ");
              ol.startTextLink(cd->getOutputFileBase(),"_details");
              ol.parseText(theTranslator->trMore());
              ol.endTextLink();
              //ol.startEmphasis();
              ol.popGeneratorState();
            }
            ol.endMemberDescription();
          }
        }
      }
    }
    if (found) ol.endMemberList();
  }
}
void NamespaceSDict::writeDeclaration(OutputList &ol,bool localName)
{
  if (count()==0) return; // no namespaces in the list

  SDict<NamespaceDef>::Iterator ni(*this);
  NamespaceDef *nd;
  bool found=FALSE;
  for (ni.toFirst();(nd=ni.current()) && !found;++ni)
  {
    if (nd->isLinkable()) found=TRUE;
  }
  if (!found) return; // no linkable namespaces in the list

  // write list of namespaces
  ol.startMemberHeader();
  bool javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
  if (javaOpt)
  {
    ol.parseText(theTranslator->trPackages());
  }
  else
  {
    ol.parseText(theTranslator->trNamespaces());
  }
  ol.endMemberHeader();
  ol.startMemberList();
  for (ni.toFirst();(nd=ni.current());++ni)
  {
    if (nd->isLinkable())
    {
      ol.startMemberItem(0);
      if (javaOpt)
      {
        ol.docify("package ");
      }
      else
      {
        ol.docify("namespace ");
      }
      ol.insertMemberAlign();
      QCString name;
      if (localName)
      {
        name = nd->localName();
      }
      else
      {
        name = nd->displayName();
      }
      ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,name);
      if (!Config_getString("GENERATE_TAGFILE").isEmpty()) 
      {
        Doxygen::tagFile << "    <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;
      }
      ol.endMemberItem();
      if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription();
        ol.parseDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE);
        ol.endMemberDescription();
        ol.newParagraph();
      }
    }
  }
  ol.endMemberList();
}
Exemple #17
0
void GroupDef::writeDocumentation(OutputList &ol)
{
    ol.pushGeneratorState();
    startFile(ol,getOutputFileBase(),name(),title);
    startTitle(ol,getOutputFileBase());
    ol.parseText(title);
    addGroupListToTitle(ol,this);
    endTitle(ol,getOutputFileBase(),title);

    if (Config_getBool("SEARCHENGINE"))
    {
        Doxygen::searchIndex->setCurrentDoc(title,getOutputFileBase());
        static QRegExp we("[a-zA-Z_][a-zA-Z_0-9]*");
        int i=0,p=0,l=0;
        while ((i=we.match(title,p,&l))!=-1) // foreach word in the title
        {
            Doxygen::searchIndex->addWord(title.mid(i,l),TRUE);
            p=i+l;
        }
    }

    if (Config_getBool("HAVE_DOT") && Config_getBool("GROUP_GRAPHS") )
    {
        DotGroupCollaboration graph(this);
        if (!graph.isTrivial())
        {
            msg("Generating dependency graph for group %s\n",qualifiedName().data());
            ol.pushGeneratorState();
            ol.disable(OutputGenerator::Man);
            ol.newParagraph();
            ol.startGroupCollaboration();
            ol.parseText(theTranslator->trCollaborationDiagram(title));
            ol.endGroupCollaboration(graph);
            ol.popGeneratorState();
        }
    }


    if (Config_getBool("DETAILS_AT_TOP"))
    {
        writeDetailedDocumentation(ol);
        ol.newParagraph();
    }
    else if (!briefDescription().isEmpty())
    {
        ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),TRUE,FALSE);
        ol.writeString(" \n");
        ol.pushGeneratorState();
        ol.disable(OutputGenerator::Latex);
        ol.disable(OutputGenerator::RTF);
        ol.disable(OutputGenerator::Man);
        ol.startTextLink(0,"_details");
        ol.parseText(theTranslator->trMore());
        ol.endTextLink();
        ol.enableAll();
        ol.disableAllBut(OutputGenerator::Man);
        ol.newParagraph();
        ol.popGeneratorState();
    }

    if (!Config_getString("GENERATE_TAGFILE").isEmpty())
    {
        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()) << Doxygen::htmlFileExtension << "</filename>" << endl;
    }

    ol.startMemberSections();

    // write list of files
    if (fileList->count()>0)
    {
        ol.startMemberHeader();
        ol.parseText(theTranslator->trFile(TRUE,FALSE));
        ol.endMemberHeader();
        ol.startMemberList();
        FileDef *fd=fileList->first();
        while (fd)
        {
            ol.startMemberItem(0);
            ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
            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();
            if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
            {
                ol.startMemberDescription();
                ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE);
                ol.endMemberDescription();
                ol.newParagraph();
            }
            fd=fileList->next();
        }
        ol.endMemberList();
    }

    // write list of namespaces
    namespaceSDict->writeDeclaration(ol);

    // write list of groups
    if (groupList->count()>0)
    {
        ol.startMemberHeader();
        ol.parseText(theTranslator->trModules());
        ol.endMemberHeader();
        ol.startMemberList();
        GroupDef *gd=groupList->first();
        while (gd)
        {
            ol.startMemberItem(0);
            //ol.docify(theTranslator->trGroup(FALSE,TRUE));
            //ol.docify(" ");
            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();
            if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
            {
                ol.startMemberDescription();
                ol.parseDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE);
                ol.endMemberDescription();
                ol.newParagraph();
            }
            gd=groupList->next();
        }
        ol.endMemberList();
    }

    // write list of directories
    if (dirList->count()>0)
    {
        ol.startMemberHeader();
        ol.parseText(theTranslator->trDirectories());
        ol.endMemberHeader();
        ol.startMemberList();
        DirDef *dd=dirList->first();
        while (dd)
        {
            ol.startMemberItem(0);
            ol.parseText(theTranslator->trDir(FALSE,TRUE));
            ol.insertMemberAlign();
            ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
            ol.endMemberItem();
            if (!Config_getString("GENERATE_TAGFILE").isEmpty())
            {
                Doxygen::tagFile << "    <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
            }
            if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
            {
                ol.startMemberDescription();
                ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE);
                ol.endMemberDescription();
                ol.newParagraph();
            }
            dd=dirList->next();
        }

        ol.endMemberList();
    }

    // write list of classes
    classSDict->writeDeclaration(ol);

    // write list of members
    if (allMemberList->count()>0)
    {
        /* write user defined member groups */
        MemberGroupSDict::Iterator mgli(*memberGroupSDict);
        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 (!Config_getBool("DETAILS_AT_TOP"))
    {
        writeDetailedDocumentation(ol);
    }

    PageDef *pd=0;
    PageSDict::Iterator pdi(*pageDict);
    for (pdi.toFirst(); (pd=pdi.current()); ++pdi)
    {
        if (!pd->isReference())
        {
            QCString pageName = pd->getOutputFileBase();

            if (!Config_getString("GENERATE_TAGFILE").isEmpty())
            {
                Doxygen::tagFile << "    <page>" << convertToXML(pageName) << "</page>" << endl;
            }

            SectionInfo *si=0;
            if (!pd->title().isEmpty() && !pd->name().isEmpty() &&
                    (si=Doxygen::sectionDict[pd->name()])!=0)
            {
                ol.startSection(si->label,si->title,SectionInfo::Subsection);
                ol.docify(si->title);
                ol.endSection(si->label,SectionInfo::Subsection);
            }
            ol.startTextBlock();
            ol.parseDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation(),TRUE,FALSE);
            ol.endTextBlock();
        }
    }

    writeMemberDocumentation(ol);

    if (!Config_getString("GENERATE_TAGFILE").isEmpty())
    {
        writeDocAnchorsToTagFile();
        Doxygen::tagFile << "  </compound>" << endl;
    }

    endFile(ol);
    ol.popGeneratorState();

    if (Config_getBool("SEPARATE_MEMBER_PAGES"))
    {
        allMemberList->sort();
        writeMemberPages(ol);
    }

}
Exemple #18
0
void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,bool localName)
{
 

  if (count()==0) return; // no namespaces in the list

  if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) return;
 

  SDict<NamespaceDef>::Iterator ni(*this);
  NamespaceDef *nd;
  bool found=FALSE;
  for (ni.toFirst();(nd=ni.current()) && !found;++ni)
  {
    if (nd->isLinkable()) found=TRUE;
  }
  if (!found) return; // no linkable namespaces in the list

  // write list of namespaces
  ol.startMemberHeader("namespaces");
  //bool javaOpt    = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
  //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
  ol.parseText(title);
  ol.endMemberHeader();
  ol.startMemberList();
  for (ni.toFirst();(nd=ni.current());++ni)
  {
    if (nd->isLinkable())
    {
      SrcLangExt lang = nd->getLanguage();
      ol.startMemberItem(nd->getOutputFileBase(),0);
      if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
      {
        ol.docify("package ");
      }
      else if (lang==SrcLangExt_Fortran)
      {
        ol.docify("module ");
      }
      else
      {
        ol.docify("namespace ");
      }
      ol.insertMemberAlign();
      QCString name;
      if (localName)
      {
        name = nd->localName();
      }
      else
      {
        name = nd->displayName();
      }
      ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,name);
      if (!Config_getString("GENERATE_TAGFILE").isEmpty() && !nd->isReference()) 
      {
        Doxygen::tagFile << "    <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;
      }
      ol.endMemberItem();
      if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
      {
        ol.startMemberDescription(nd->getOutputFileBase());
        ol.parseDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE);
        ol.endMemberDescription();
      }
    }
  }
  ol.endMemberList();
}
 void VerilogDocGen::writeVerilogDeclarations(MemberList* ml,OutputList &ol,
               ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
               const char *title,const char *subtitle,bool showEnumValues,int type) {


  MemberDef *mdd=NULL;
 // if(ml==NULL) return;
  MemberListIterator mmli(*ml);
  setType(ml);
 
if (!membersHaveSpecificType(ml,type)) return;
  
  if (title) 
  {
    ol.startMemberHeader(title);
    ol.parseText(title);
    ol.endMemberHeader();
	ol.docify(" ");
  }
  if (subtitle && subtitle[0]!=0) 
  {
    //printf("subtitle=`%s'\n",subtitle);
    ol.startMemberSubtitle();
    ol.generateDoc("[generated]",-1,0,0,subtitle,FALSE,FALSE);
    ol.endMemberSubtitle();
  } 
  
  VerilogDocGen::writePlainVerilogDeclarations(mdd,ml,ol,cd,nd,fd,gd,type);
 
  if (ml->getMemberGroupList())
  {
    MemberGroupListIterator mgli(*ml->getMemberGroupList());
    MemberGroup *mg;
    while ((mg=mgli.current()))
    {
     // assert(0);
       if (membersHaveSpecificType(mg->members(),type))
    
     {
      //printf("mg->header=%s\n",mg->header().data());
      bool hasHeader=mg->header()!="[NOHEADER]";
      ol.startMemberGroupHeader(hasHeader);
      if (hasHeader)
      {
        ol.parseText(mg->header());
      }
      ol.endMemberGroupHeader();
      if (!mg->documentation().isEmpty())
      {
        //printf("Member group has docs!\n");
        ol.startMemberGroupDocs();
        ol.generateDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE);
        ol.endMemberGroupDocs();
      }
      ol.startMemberGroup();
      //printf("--- mg->writePlainDeclarations ---\n");
      //mg->writePlainDeclarations(ol,cd,nd,fd,gd);
          VerilogDocGen::writePlainVerilogDeclarations(0,mg->members(),ol,cd,nd,fd,gd,type);
   
      ol.endMemberGroup(hasHeader);
     }
      ++mgli;
    }
  }
 
 }// writeVerilogDeclarations