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) { ol.startMemberDeclaration(); 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.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE); ol.endMemberDescription(); } ol.endMemberDeclaration(0,0); } ol.endMemberList(); } }
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 DirDef::writeTagFile(FTextStream &tagFile) { tagFile << " <compound kind=\"dir\">" << endl; tagFile << " <name>" << convertToXML(displayName()) << "</name>" << endl; tagFile << " <path>" << convertToXML(name()) << "</path>" << endl; tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl; QListIterator<LayoutDocEntry> eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)); LayoutDocEntry *lde; for (eli.toFirst();(lde=eli.current());++eli) { switch (lde->kind()) { case LayoutDocEntry::DirSubDirs: { if (m_subdirs.count()>0) { DirDef *dd; QListIterator<DirDef> it(m_subdirs); for (;(dd=it.current());++it) { tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl; } } } break; case LayoutDocEntry::DirFiles: { if (m_fileList->count()>0) { QListIterator<FileDef> it(*m_fileList); FileDef *fd; for (;(fd=it.current());++it) { tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl; } } } break; default: break; } } writeDocAnchorsToTagFile(tagFile); tagFile << " </compound>" << endl; }
void computeDirDependencies() { DirDef *dir; DirSDict::Iterator sdi(*Doxygen::directories); // compute nesting level for each directory for (sdi.toFirst();(dir=sdi.current());++sdi) { dir->setLevel(); } // compute uses dependencies between directories for (sdi.toFirst();(dir=sdi.current());++sdi) { //printf("computeDependencies for %s: #dirs=%d\n",dir->name().data(),Doxygen::directories.count()); dir->computeDependencies(); } #if 0 printf("-------------------------------------------------------------\n"); // print dependencies (for debugging) for (sdi.toFirst();(dir=sdi.current());++sdi) { if (dir->usedDirs()) { QDictIterator<UsedDir> udi(*dir->usedDirs()); UsedDir *usedDir; for (udi.toFirst();(usedDir=udi.current());++udi) { printf("%s depends on %s due to ", dir->shortName().data(),usedDir->dir()->shortName().data()); QDictIterator<FileDef> fdi(usedDir->files()); FileDef *fd; for (fdi.toFirst();(fd=fdi.current());++fdi) { printf("%s ",fd->name().data()); } printf("\n"); } } } printf("^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^\n"); #endif }
void generateSqlite3() { // + classes // + namespaces // + files // - groups // - related pages // - examples //QCString outputDirectory = Config_getString("SQLITE3_OUTPUT"); QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY"); QDir sqlite3Dir(outputDirectory); sqlite3 *db; sqlite3_initialize(); int rc = sqlite3_open_v2(outputDirectory+"/doxygen_sqlite3.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); if (rc != SQLITE_OK) { sqlite3_close(db); msg("database open failed: %s\n", "doxygen_sqlite3.db"); exit(-1); } beginTransaction(db); pragmaTuning(db); initializeSchema(db); if ( -1 == prepareStatements(db) ) { err("sqlite generator: prepareStatements failed!"); return; } // + classes ClassSDict::Iterator cli(*Doxygen::classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { msg("Generating Sqlite3 output for class %s\n",cd->name().data()); generateSqlite3ForClass(db,cd); } // + namespaces NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { msg("Generating Sqlite3 output for namespace %s\n",nd->name().data()); generateSqlite3ForNamespace(db,nd); } // + files FileNameListIterator fnli(*Doxygen::inputNameList); FileName *fn; for (;(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); FileDef *fd; for (;(fd=fni.current());++fni) { msg("Generating Sqlite3 output for file %s\n",fd->name().data()); generateSqlite3ForFile(db,fd); } } endTransaction(db); }
void GroupDef::writeTagFile(FTextStream &tagFile) { tagFile << " <compound kind=\"group\">" << endl; tagFile << " <name>" << convertToXML(name()) << "</name>" << endl; tagFile << " <title>" << convertToXML(title) << "</title>" << endl; tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl; QListIterator<LayoutDocEntry> eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); LayoutDocEntry *lde; for (eli.toFirst();(lde=eli.current());++eli) { switch (lde->kind()) { case LayoutDocEntry::GroupClasses: { if (classSDict) { SDict<ClassDef>::Iterator ci(*classSDict); ClassDef *cd; for (ci.toFirst();(cd=ci.current());++ci) { if (cd->isLinkableInProject()) { tagFile << " <class kind=\"" << cd->compoundTypeString() << "\">" << convertToXML(cd->name()) << "</class>" << endl; } } } } break; case LayoutDocEntry::GroupNamespaces: { if (namespaceSDict) { SDict<NamespaceDef>::Iterator ni(*namespaceSDict); NamespaceDef *nd; for (ni.toFirst();(nd=ni.current());++ni) { if (nd->isLinkableInProject()) { tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl; } } } } break; case LayoutDocEntry::GroupFiles: { if (fileList) { QListIterator<FileDef> it(*fileList); FileDef *fd; for (;(fd=it.current());++it) { if (fd->isLinkableInProject()) { tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl; } } } } break; case LayoutDocEntry::GroupPageDocs: { if (pageDict) { PageSDict::Iterator pdi(*pageDict); PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { QCString pageName = pd->getOutputFileBase(); if (pd->isLinkableInProject()) { tagFile << " <page>" << convertToXML(pageName) << "</page>" << endl; } } } } break; case LayoutDocEntry::GroupDirs: { if (dirList) { QListIterator<DirDef> it(*dirList); DirDef *dd; for (;(dd=it.current());++it) { if (dd->isLinkableInProject()) { tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl; } } } } break; case LayoutDocEntry::GroupNestedGroups: { if (groupList) { QListIterator<GroupDef> it(*groupList); GroupDef *gd; for (;(gd=it.current());++it) { if (gd->isVisible()) { tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>" << endl; } } } } break; case LayoutDocEntry::MemberDecl: { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; MemberList * ml = getMemberList(lmd->type); if (ml) { ml->writeTagFile(tagFile); } } break; case LayoutDocEntry::MemberGroups: { if (memberGroupSDict) { MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { mg->writeTagFile(tagFile); } } } break; default: break; } } writeDocAnchorsToTagFile(tagFile); tagFile << " </compound>" << endl; }
void generateSqlite3() { // + classes // + namespaces // + files // + groups // + related pages // + examples // + main page QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY"); QDir sqlite3Dir(outputDirectory); sqlite3 *db; sqlite3_initialize(); int rc = sqlite3_open_v2(outputDirectory+"/doxygen_sqlite3.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); if (rc != SQLITE_OK) { sqlite3_close(db); msg("database open failed: %s\n", "doxygen_sqlite3.db"); return; } beginTransaction(db); pragmaTuning(db); if (-1==initializeSchema(db)) return; if ( -1 == prepareStatements(db) ) { err("sqlite generator: prepareStatements failed!"); return; } // + classes ClassSDict::Iterator cli(*Doxygen::classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { msg("Generating Sqlite3 output for class %s\n",cd->name().data()); generateSqlite3ForClass(db,cd); } // + namespaces NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { msg("Generating Sqlite3 output for namespace %s\n",nd->name().data()); generateSqlite3ForNamespace(db,nd); } // + files FileNameListIterator fnli(*Doxygen::inputNameList); FileName *fn; for (;(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); FileDef *fd; for (;(fd=fni.current());++fni) { msg("Generating Sqlite3 output for file %s\n",fd->name().data()); generateSqlite3ForFile(db,fd); } } // + groups GroupSDict::Iterator gli(*Doxygen::groupSDict); GroupDef *gd; for (;(gd=gli.current());++gli) { msg("Generating Sqlite3 output for group %s\n",gd->name().data()); generateSqlite3ForGroup(db,gd); } // + page { PageSDict::Iterator pdi(*Doxygen::pageSDict); PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { msg("Generating Sqlite3 output for page %s\n",pd->name().data()); generateSqlite3ForPage(db,pd,FALSE); } } // + dirs { DirDef *dir; DirSDict::Iterator sdi(*Doxygen::directories); for (sdi.toFirst();(dir=sdi.current());++sdi) { msg("Generating Sqlite3 output for dir %s\n",dir->name().data()); generateSqlite3ForDir(db,dir); } } // + examples { PageSDict::Iterator pdi(*Doxygen::exampleSDict); PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { msg("Generating Sqlite3 output for example %s\n",pd->name().data()); generateSqlite3ForPage(db,pd,TRUE); } } // + main page if (Doxygen::mainPage) { msg("Generating Sqlite3 output for the main page\n"); generateSqlite3ForPage(db,Doxygen::mainPage,FALSE); } endTransaction(db); }
void DocSets::addIndexItem(Definition *context,MemberDef *md, const char *,const char *) { if (md==0 && context==0) return; FileDef *fd = 0; ClassDef *cd = 0; NamespaceDef *nd = 0; if (md) { fd = md->getFileDef(); cd = md->getClassDef(); nd = md->getNamespaceDef(); if (!md->isLinkable()) return; // internal symbol } QCString scope; QCString type; QCString decl; // determine language QCString lang; SrcLangExt langExt = SrcLangExt_Cpp; if (md) { langExt = md->getLanguage(); } else if (context) { langExt = context->getLanguage(); } switch (langExt) { case SrcLangExt_Cpp: case SrcLangExt_ObjC: { if (md && (md->isObjCMethod() || md->isObjCProperty())) lang="occ"; // Objective C/C++ else if (fd && fd->name().right(2).lower()==".c") lang="c"; // Plain C else if (cd==0 && nd==0) lang="c"; // Plain C symbol outside any class or namespace else lang="cpp"; // C++ } break; 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_Fortran: lang="fortran"; break; // Fortran case SrcLangExt_VHDL: lang="vhdl"; break; // VHDL case SrcLangExt_XML: lang="xml"; break; // DBUS XML case SrcLangExt_Tcl: lang="tcl"; break; // Tcl case SrcLangExt_Markdown:lang="markdown"; break; // Markdown case SrcLangExt_Unknown: lang="unknown"; break; // should not happen! } if (md) { if (context==0) { if (md->getGroupDef()) context = md->getGroupDef(); else if (md->getFileDef()) context = md->getFileDef(); } if (context==0) return; // should not happen switch (md->memberType()) { case MemberType_Define: type="macro"; break; case MemberType_Function: if (cd && (cd->compoundType()==ClassDef::Interface || cd->compoundType()==ClassDef::Class)) { if (md->isStatic()) type="clm"; // class member else type="instm"; // instance member } else if (cd && cd->compoundType()==ClassDef::Protocol) { if (md->isStatic()) type="intfcm"; // interface class member else type="intfm"; // interface member } else type="func"; break; case MemberType_Variable: type="data"; break; case MemberType_Typedef: type="tdef"; break; case MemberType_Enumeration: type="enum"; break; case MemberType_EnumValue: type="econst"; break; //case MemberDef::Prototype: // type="prototype"; break; case MemberType_Signal: type="signal"; break; case MemberType_Slot: type="slot"; break; case MemberType_Friend: type="ffunc"; break; case MemberType_DCOP: type="dcop"; break; case MemberType_Property: if (cd && cd->compoundType()==ClassDef::Protocol) type="intfp"; // interface property else type="instp"; // instance property break; case MemberType_Event: type="event"; break; case MemberType_Interface: type="ifc"; break; case MemberType_Service: type="svc"; break; } cd = md->getClassDef(); nd = md->getNamespaceDef(); if (cd) { scope = cd->qualifiedName(); } else if (nd) { scope = nd->name(); } MemberDef *declMd = md->memberDeclaration(); if (declMd==0) declMd = md; { fd = md->getFileDef(); if (fd) { decl = fd->name(); } } writeToken(m_tts,md,type,lang,scope,md->anchor(),decl); } else if (context && context->isLinkable()) { if (fd==0 && context->definitionType()==Definition::TypeFile) { fd = (FileDef*)context; } if (cd==0 && context->definitionType()==Definition::TypeClass) { cd = (ClassDef*)context; } if (nd==0 && context->definitionType()==Definition::TypeNamespace) { nd = (NamespaceDef*)context; } if (fd) { type="file"; } else if (cd) { scope = cd->qualifiedName(); if (cd->isTemplate()) { type="tmplt"; } else if (cd->compoundType()==ClassDef::Protocol) { type="intf"; if (scope.right(2)=="-p") scope=scope.left(scope.length()-2); } else if (cd->compoundType()==ClassDef::Interface) { type="cl"; } else if (cd->compoundType()==ClassDef::Category) { type="cat"; } else { type = "cl"; } IncludeInfo *ii = cd->includeInfo(); if (ii) { decl=ii->includeName; } } else if (nd) { scope = nd->name(); type = "ns"; } if (m_scopes.find(context->getOutputFileBase())==0) { writeToken(m_tts,context,type,lang,scope,0,decl); m_scopes.append(context->getOutputFileBase(),(void*)0x8); } } }
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()); }