Ejemplo n.º 1
0
static void lookupSymbol(Definition *d)
{
  if (d!=Doxygen::globalScope && // skip the global namespace symbol
      d->name().at(0)!='@'       // skip anonymous stuff
     )      
  {
    printf("Symbol info\n");
    printf("-----------\n");
    printf("Name: %s\n",d->name().data());
    printf("File: %s\n",d->getDefFileName().data());
    printf("Line: %d\n",d->getDefLine());
    // depending on the definition type we can case to the appropriate
    // derived to get additional information
    switch (d->definitionType())
    {
      case Definition::TypeClass:
        {
          ClassDef *cd = (ClassDef *)d;
          printf("Kind: %s\n",cd->compoundTypeString().data());
        }
        break;
      case Definition::TypeFile:
        {
          FileDef *fd = (FileDef *)d;
          printf("Kind: File: #includes %d other files\n",
              fd->includeFileList() ? fd->includeFileList()->count() : 0);
        }
        break;
      case Definition::TypeNamespace:
        {
          NamespaceDef *nd = (NamespaceDef *)d;
          printf("Kind: Namespace: contains %d classes and %d namespaces\n",
              nd->getClassSDict() ? nd->getClassSDict()->count() : 0,
              nd->getNamespaceSDict() ? nd->getNamespaceSDict()->count() : 0);
        }
        break;
      case Definition::TypeMember:
        {
          MemberDef *md = (MemberDef *)d;
          printf("Kind: %s\n",md->memberTypeName().data());
        }
        break;
      default:
        // ignore groups/pages/packages/dirs for now
        break;
    }
  }
}
Ejemplo n.º 2
0
/** Computes the dependencies between directories
 */
void DirDef::computeDependencies()
{
  FileList *fl = m_fileList;
  if (fl) 
  {
    QListIterator<FileDef> fli(*fl);
    FileDef *fd;
    for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd
    {
      //printf("  File %s\n",fd->name().data());
      //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data());
      QList<IncludeInfo> *ifl = fd->includeFileList();
      if (ifl)
      {
        QListIterator<IncludeInfo> ifli(*ifl); 
        IncludeInfo *ii;
        for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file
        {
          //printf("  > %s\n",ii->includeName.data());
          //printf("    #include %s\n",ii->includeName.data());
          if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file
          {
            DirDef *usedDir = ii->fileDef->getDirDef();
            if (usedDir)
            {
              // add dependency: thisDir->usedDir
              //static int count=0;
              //printf("      %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data());
              addUsesDependency(usedDir,fd,ii->fileDef,FALSE);
            }
          }
        }
      }
    }
  }
  if (m_usedDirs)
  {
    QDictIterator<UsedDir> udi(*m_usedDirs);
    UsedDir *udir;
    for (udi.toFirst();(udir=udi.current());++udi)
    {
      udir->sort();
    }
  }
}