Doxygen
context.h 文件参考
#include "types.h"
#include "template.h"
#include "classdef.h"
#include "searchindex.h"
#include "memberlist.h"
#include "dotgfxhierarchytable.h"
+ context.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  ConfigContext
 
class  DoxygenContext
 
class  TranslateContext
 
class  UsedFilesContext
 
class  IncludeInfoContext
 
class  IncludeInfoListContext
 
class  ClassContext
 
class  ConceptContext
 
class  NamespaceContext
 
class  FileContext
 
class  DirContext
 
class  PageContext
 
class  MemberContext
 
class  ModuleContext
 
class  ClassListContext
 
class  ClassIndexContext
 
class  InheritanceGraphContext
 
class  ClassInheritanceNodeContext
 
class  ClassInheritanceContext
 
class  ClassHierarchyContext
 
class  NestingNodeContext
 
class  NestingContext
 
class  ClassTreeContext
 
class  ConceptListContext
 
class  NamespaceListContext
 
class  NamespaceTreeContext
 
class  DirListContext
 
class  FileListContext
 
class  FileTreeContext
 
class  PageListContext
 
class  PageTreeContext
 
class  ModuleNodeContext
 
class  ModuleListContext
 
class  ConceptTreeContext
 
class  ModuleTreeContext
 
class  ExampleListContext
 
class  ExampleTreeContext
 
class  GlobalsIndexContext
 
class  ClassMembersIndexContext
 
class  NamespaceMembersIndexContext
 
class  NavPathElemContext
 
class  InheritanceNodeContext
 
class  InheritanceListContext
 
class  MemberListContext
 
class  MemberGroupInfoContext
 
class  MemberGroupListContext
 
class  MemberListInfoContext
 
class  MemberInfoContext
 
class  InheritedMemberInfoContext
 
class  InheritedMemberInfoListContext
 
class  AllMembersListContext
 
class  ArgumentContext
 
class  ArgumentListContext
 
class  SymbolContext
 
class  SymbolListContext
 
class  SymbolGroupContext
 
class  SymbolGroupListContext
 
class  SymbolIndexContext
 
class  SymbolIndicesContext
 
class  SearchIndexContext
 
class  SearchIndicesContext
 

枚举

enum  ContextTreeType {
  ContextTreeType::Namespace, ContextTreeType::ClassInheritance, ContextTreeType::ClassNesting, ContextTreeType::Module,
  ContextTreeType::File, ContextTreeType::Page, ContextTreeType::Concept, ContextTreeType::Example
}
 

函数

void generateOutputViaTemplate ()
 
void generateTemplateFiles (const QCString &templateDir)
 

枚举类型说明

◆ ContextTreeType

enum ContextTreeType
strong
枚举值
Namespace 
ClassInheritance 
ClassNesting 
Module 
File 
Page 
Concept 
Example 

在文件 context.h481 行定义.

482 {
483  Namespace, // NamespaceTreeContext
484  ClassInheritance, // ClassHierarchyContext
485  ClassNesting, // ClassTreeContext
486  Module, // ModuleTreeContext
487  File, // FileTreeContext
488  Page, // PageTreeContext
489  Concept, // ContextTreeContext
490  Example // ExampleTreeContext
491 };

函数说明

◆ generateOutputViaTemplate()

void generateOutputViaTemplate ( )

在文件 context.cpp8994 行定义.

8995 {
8996  {
8997  auto e = std::make_unique<TemplateEngine>();
8998  auto ctx = e->createContext();
8999  if (ctx)
9000  {
9025 
9026  //%% Doxygen doxygen:
9027  ctx->set("doxygen",doxygen);
9028  //%% Translator tr:
9029  ctx->set("tr",tr);
9030  //%% Config config:
9031  ctx->set("config",config);
9032  //%% ClassList classList:
9033  ctx->set("classList",classList); // not used for standard HTML
9034  //%% ClassTree classTree:
9035  ctx->set("classTree",classTree);
9036  //%% ClassIndex classIndex:
9037  ctx->set("classIndex",classIndex);
9038  //%% ClassHierarchy classHierarchy:
9039  ctx->set("classHierarchy",classHierarchy);
9040  //%% ConceptList conceptList:
9041  ctx->set("conceptList",conceptList);
9042  //%% ConceptTree conceptTree:
9043  ctx->set("conceptTree",conceptTree);
9044  //%% NamespaceList namespaceList:
9045  ctx->set("namespaceList",namespaceList);
9046  //%% NamespaceTree namespaceTree:
9047  ctx->set("namespaceTree",namespaceTree);
9048  //%% FileList fileList:
9049  ctx->set("fileList",fileList);
9050  //%% FileTree fileTree:
9051  ctx->set("fileTree",fileTree);
9052  //%% PageList pageList
9053  ctx->set("pageList",pageList);
9054  //%% PageTree pageTree
9055  ctx->set("pageTree",pageTree);
9056  //%% ExampleTree exampleTree
9057  ctx->set("exampleTree",exampleTree);
9058  //%% ExampleList exampleList
9059  ctx->set("exampleList",exampleList);
9060  //%% ModuleTree moduleTree
9061  ctx->set("moduleTree",moduleTree);
9062  //%% ModuleList moduleList
9063  ctx->set("moduleList",moduleList);
9064  //%% DirList dirList
9065  ctx->set("dirList",dirList);
9066  //%% Page mainPage
9067  if (Doxygen::mainPage)
9068  {
9070  ctx->set("mainPage",mainPage);
9071  }
9072  else
9073  {
9074  // TODO: for LaTeX output index should be main... => solve in template
9075  Doxygen::mainPage.reset(createPageDef("[generated]",1,"index","",Config_getString(PROJECT_NAME)));
9076  Doxygen::mainPage->setFileName("index");
9078  ctx->set("mainPage",mainPage);
9079  }
9080  //%% GlobalsIndex globalsIndex:
9081  ctx->set("globalsIndex",globalsIndex);
9082  //%% ClassMembersIndex classMembersIndex:
9083  ctx->set("classMembersIndex",classMembersIndex);
9084  //%% NamespaceMembersIndex namespaceMembersIndex:
9085  ctx->set("namespaceMembersIndex",namespaceMembersIndex);
9086  //%% SearchIndices searchIndices
9087  ctx->set("searchIndices",searchIndices);
9088  //%% string space
9089  ctx->set("space"," ");
9090 
9091  //if (Config_getBool(GENERATE_HTML))
9092  { // render HTML output
9093  e->setTemplateDir("templates/html"); // TODO: make template part user configurable
9094  Template *tpl = e->loadByName("htmllayout.tpl",1);
9095  if (tpl)
9096  {
9098  g_globals.dynSectionId = 0;
9099  g_globals.outputDir = Config_getString(HTML_OUTPUT);
9100  Dir dir(g_globals.outputDir.str());
9101  createSubDirs(dir);
9102  ctx->setEscapeIntf(Config_getString(HTML_FILE_EXTENSION),std::make_unique<HtmlEscaper>());
9103  ctx->setSpacelessIntf(std::make_unique<HtmlSpaceless>());
9104  ctx->setOutputDirectory(g_globals.outputDir);
9105  TextStream ts;
9106  tpl->render(ts,ctx.get());
9107  }
9108  e->unload(tpl);
9109  }
9110 
9111  // TODO: clean index before each run...
9112 
9113  //if (Config_getBool(GENERATE_LATEX))
9114  if (0)
9115  { // render LaTeX output
9116  e->setTemplateDir("templates/latex"); // TODO: make template part user configurable
9117  Template *tpl = e->loadByName("latexlayout.tpl",1);
9118  if (tpl)
9119  {
9121  g_globals.dynSectionId = 0;
9122  g_globals.outputDir = Config_getString(LATEX_OUTPUT);
9123  Dir dir(g_globals.outputDir.str());
9124  createSubDirs(dir);
9125  ctx->setEscapeIntf(".tex",std::make_unique<LatexEscaper>());
9126  ctx->setSpacelessIntf(std::make_unique<LatexSpaceless>());
9127  ctx->setOutputDirectory(g_globals.outputDir);
9128  TextStream ts;
9129  tpl->render(ts,ctx.get());
9130  }
9131  e->unload(tpl);
9132  }
9133  }
9134  }
9135 }

引用了 ConfigContext::alloc(), DoxygenContext::alloc(), TranslateContext::alloc(), PageContext::alloc(), ClassListContext::alloc(), ClassIndexContext::alloc(), ClassHierarchyContext::alloc(), ClassTreeContext::alloc(), ConceptListContext::alloc(), NamespaceListContext::alloc(), NamespaceTreeContext::alloc(), DirListContext::alloc(), FileListContext::alloc(), FileTreeContext::alloc(), PageListContext::alloc(), PageTreeContext::alloc(), ModuleListContext::alloc(), ConceptTreeContext::alloc(), ModuleTreeContext::alloc(), ExampleListContext::alloc(), ExampleTreeContext::alloc(), GlobalsIndexContext::alloc(), ClassMembersIndexContext::alloc(), NamespaceMembersIndexContext::alloc(), SearchIndicesContext::alloc(), Config_getString, ContextOutputFormat_Html, ContextOutputFormat_Latex, createPageDef(), createSubDirs(), ContextGlobals::dynSectionId, FALSE, g_globals, Doxygen::mainPage, ContextGlobals::outputDir, ContextGlobals::outputFormat, Doxygen::pageLinkedMap, Template::render(), QCString::str() , 以及 TRUE.

被这些函数引用 generateOutput().

◆ generateTemplateFiles()

void generateTemplateFiles ( const QCString templateDir)

在文件 context.cpp9137 行定义.

9138 {
9139  if (templateDir.isEmpty()) return;
9140  Dir thisDir;
9141  if (!thisDir.exists(templateDir.str()) && !thisDir.mkdir(templateDir.str()))
9142  {
9143  err("Failed to create output directory '%s'\n",qPrint(templateDir));
9144  return;
9145  }
9146  std::string outDir = templateDir.str()+"/html";
9147  if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir))
9148  {
9149  err("Failed to create output directory '%s'\n",outDir.c_str());
9150  return;
9151  }
9152  ResourceMgr::instance().writeCategory("html",outDir.c_str());
9153 }

引用了 err(), Dir::exists(), ResourceMgr::instance(), QCString::isEmpty(), Dir::mkdir(), qPrint(), QCString::str() , 以及 ResourceMgr::writeCategory().

被这些函数引用 readConfiguration().

ContextOutputFormat_Latex
@ ContextOutputFormat_Latex
Definition: context.cpp:79
ModuleListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:776
ResourceMgr::instance
static ResourceMgr & instance()
Returns the one and only instance of this class
Definition: resourcemgr.cpp:32
ResourceMgr::writeCategory
bool writeCategory(const QCString &categoryName, const QCString &targetDir) const
Writes all resource belonging to a given category to a given target directory
Definition: resourcemgr.cpp:54
ContextGlobals::outputFormat
ContextOutputFormat outputFormat
Definition: context.cpp:78
Doxygen::mainPage
static std::unique_ptr< PageDef > mainPage
Definition: doxygen.h:83
ClassHierarchyContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:464
Example
Data associated with an example.
Definition: example.h:28
Dir
Class representing a directory in the file system
Definition: dir.h:68
ContextTreeType::File
@ File
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
Doxygen::pageLinkedMap
static PageLinkedMap * pageLinkedMap
Definition: doxygen.h:82
TranslateContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:115
createPageDef
PageDef * createPageDef(const QCString &f, int l, const QCString &n, const QCString &d, const QCString &t)
Definition: pagedef.cpp:76
Template::render
virtual void render(TextStream &ts, TemplateContext *c)=0
Renders a template instance to a stream.
ContextTreeType::Concept
@ Concept
GlobalsIndexContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:882
ExampleListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:840
ClassIndexContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:382
QCString::str
std::string str() const
Definition: qcstring.h:442
Template
Abstract interface for a template.
Definition: template.h:475
PageTreeContext::alloc
static TemplateStructIntfPtr alloc(const PageLinkedMap &pages)
Definition: context.h:736
ContextGlobals::outputDir
QCString outputDir
Definition: context.cpp:77
err
void err(const char *fmt,...)
Definition: message.cpp:203
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
PageListContext::alloc
static TemplateListIntfPtr alloc(const PageLinkedMap &pages)
Definition: context.h:713
ClassMembersIndexContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:902
TemplateStructIntfPtr
std::shared_ptr< TemplateStructIntf > TemplateStructIntfPtr
Definition: template.h:33
NamespaceMembersIndexContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:922
ContextGlobals::dynSectionId
int dynSectionId
Definition: context.cpp:76
NamespaceTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:631
ExampleTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:862
ModuleTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:820
ConfigContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:75
ContextTreeType::Page
@ Page
TRUE
#define TRUE
Definition: qcstring.h:36
DirListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:651
ConceptListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:589
ContextTreeType::ClassInheritance
@ ClassInheritance
NamespaceListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:610
ConceptTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:800
g_globals
struct ContextGlobals g_globals
ClassListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:361
ClassTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:569
TemplateListIntfPtr
std::shared_ptr< TemplateListIntf > TemplateListIntfPtr
Definition: template.h:32
FileTreeContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:693
FileListContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:672
ContextOutputFormat_Html
@ ContextOutputFormat_Html
Definition: context.cpp:78
DoxygenContext::alloc
static TemplateStructIntfPtr alloc()
Definition: context.h:95
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Config_getString
#define Config_getString(name)
Definition: config.h:32
PageContext::alloc
static TemplateStructIntfPtr alloc(const PageDef *pd, bool isMainPage, bool isExample)
Definition: context.h:300
ContextTreeType::ClassNesting
@ ClassNesting
Dir::exists
bool exists() const
Definition: dir.cpp:199
ContextTreeType::Module
@ Module
SearchIndicesContext::alloc
static TemplateListIntfPtr alloc()
Definition: context.h:1378
ContextTreeType::Namespace
@ Namespace
Dir::mkdir
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:237
createSubDirs
void createSubDirs(const Dir &d)
Definition: util.cpp:3677
FALSE
#define FALSE
Definition: qcstring.h:33