示例#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();
    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();
  }
}
示例#2
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();
  }
}
示例#3
0
static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE)
{
    QCString url = n->file;
    if (!url.isEmpty() && url.at(0)=='!')  // relative URL
    {
        // remove leading !
        url = url.mid(1);
    }
    else if (!url.isEmpty() && url.at(0)=='^') // absolute URL
    {
        // skip, keep ^ in the output
    }
    else // local file (with optional anchor)
    {
        if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile)
        {
            FileDef *fd = (FileDef*)n->def;
            if (srcLink)
            {
                url = fd->getSourceFileBase();
            }
            else
            {
                url = fd->getOutputFileBase();
            }
        }
        url+=Doxygen::htmlFileExtension;
        if (!n->anchor.isEmpty()) url+="#"+n->anchor;
    }
    return url;
}
示例#4
0
void TagFileParser::addIncludes()
{
  TagFileInfo *tfi = m_tagFileFiles.first();
  while (tfi)
  {
    //printf("tag file tagName=%s path=%s name=%s\n",m_tagName.data(),tfi->path.data(),tfi->name.data());
    FileName *fn = Doxygen::inputNameDict->find(tfi->name);
    if (fn)
    {
      //printf("found\n");
      FileNameIterator fni(*fn);
      FileDef *fd;
      for (;(fd=fni.current());++fni)
      {
        //printf("input file path=%s name=%s\n",fd->getPath().data(),fd->name().data());
        if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
        {
          //printf("found\n");
          QListIterator<TagIncludeInfo> mii(tfi->includes);
          TagIncludeInfo *ii;
          for (;(ii=mii.current());++mii)
          {
            //printf("ii->name=`%s'\n",ii->name.data());
            FileName *ifn = Doxygen::inputNameDict->find(ii->name);
            ASSERT(ifn!=0);
            if (ifn)
            {
              FileNameIterator ifni(*ifn);
              FileDef *ifd;
              for (;(ifd=ifni.current());++ifni)
              {
                //printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
                //        ifd->getOutputFileBase().data(),ii->id.data());
                if (ifd->getOutputFileBase()==QCString(ii->id))
                {
                  fd->addIncludeDependency(ifd,ii->text,ii->isLocal,ii->isImported,FALSE);
                }
              }
            }
          }
        }
      } 
    }
    tfi = m_tagFileFiles.next();
  }
}
示例#5
0
void DocSets::addIndexItem(const char *, const char *, 
                           const char *, const char *,
                           const char *,const MemberDef *md)
{
  if (!md->isLinkable()) return; // internal symbol

  ClassDef *cd     = md->getClassDef();
  NamespaceDef *nd = md->getNamespaceDef();
  FileDef  *fd     = md->getFileDef();

  // determine language
  QCString lang;
  SrcLangExt langExt = SrcLangExt_Cpp;
  if (fd) langExt = getLanguageFromFileName(fd->name());
  switch (langExt)
  {
    case SrcLangExt_Cpp:
      {
        if (md->isObjCMethod())                        
          lang="occ";  // Objective C/C++
        else if (fd && fd->name().right(2).lower()==".c") 
          lang="c";    // Plain C
        else                                      
          lang="cpp";  // C++
      }
      break;
    case SrcLangExt_ObjC:   lang="occ"; break;        // Objective C++
    case SrcLangExt_IDL:    lang="idl"; break;        // IDL
    case SrcLangExt_CSharp: lang="csharp"; break;     // C#
    case SrcLangExt_PHP:    lang="php"; break;        // PHP4/5
    case SrcLangExt_D:      lang="d"; break;          // D
    case SrcLangExt_Java:   lang="java"; break;       // Java
    case SrcLangExt_JS:     lang="javascript"; break; // Javascript
    case SrcLangExt_Python: lang="python"; break;     // Python
    case SrcLangExt_F90:    lang="fortran"; break;    // Fortran
    case SrcLangExt_VHDL:   lang="vhdl"; break;       // VHDL
  }

  // determine scope
  QCString scope;
  QCString type;
  QCString decl;
  Definition *d = 0;
  if (fd && fd->isLinkable() && m_scopes.find(fd->getOutputFileBase())==0)
  {
    writeToken(m_tts,fd,"file",lang,0,0,0);
    m_scopes.append(fd->getOutputFileBase(),(void*)0x8);
  }
  if (cd) 
  {
    scope = cd->qualifiedName();
    if (cd->isTemplate()) 
      type="tmplt";
    else if (cd->compoundType()==ClassDef::Protocol) 
      type="intf";
    else if (cd->compoundType()==ClassDef::Interface) 
      type="cl";
    else if (cd->compoundType()==ClassDef::Category)
      type="cat";
    else 
      type = "cl";
    d = cd;
    IncludeInfo *ii = cd->includeInfo();
    if (ii)
    {
      decl=ii->includeName;
      if (decl.isEmpty())
      {
        decl=ii->local;
      }
    }
  }
  else if (nd) 
  {
    scope = nd->name();
    type = "ns";
    d = cd;
  }
  if (d && d->isLinkable() && m_scopes.find(d->getOutputFileBase())==0)
  {
    writeToken(m_tts,d,type,lang,0,0,decl);
    m_scopes.append(d->getOutputFileBase(),(void*)0x8);
  }

  switch (md->memberType())
  {
    case MemberDef::Define:
      type="macro"; break;
    case MemberDef::Function:
      if (cd && cd->compoundType()==ClassDef::Interface) 
        type="intfm";
      else if (cd && cd->compoundType()==ClassDef::Class) 
        type="clm"; 
      else 
        type="func"; 
      break;
    case MemberDef::Variable:
      type="data"; break;
    case MemberDef::Typedef:
      type="tdef"; break;
    case MemberDef::Enumeration:
      type="enum"; break;
    case MemberDef::EnumValue:
      type="econst"; break;
    //case MemberDef::Prototype:
    //  type="prototype"; break;
    case MemberDef::Signal:
      type="signal"; break;
    case MemberDef::Slot:
      type="slot"; break;
    case MemberDef::Friend:
      type="ffunc"; break;
    case MemberDef::DCOP:
      type="dcop"; break;
    case MemberDef::Property:
      type="property"; break;
    case MemberDef::Event:
      type="event"; break;
  }
  writeToken(m_tts,md,type,lang,scope,md->anchor());
}