Doxygen
xmlgen.h 文件参考
#include "outputgen.h"
+ xmlgen.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  XMLCodeGenerator
 

函数

void generateXML ()
 

函数说明

◆ generateXML()

void generateXML ( )

在文件 xmlgen.cpp1888 行定义.

1889 {
1890  // + classes
1891  // + concepts
1892  // + namespaces
1893  // + files
1894  // + groups
1895  // + related pages
1896  // - examples
1897 
1898  QCString outputDirectory = Config_getString(XML_OUTPUT);
1899  Dir xmlDir(outputDirectory.str());
1900  createSubDirs(xmlDir);
1901 
1902  ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
1903  ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
1904  ResourceMgr::instance().copyResource("doxyfile.xsd",outputDirectory);
1905 
1906  QCString fileName=outputDirectory+"/compound.xsd";
1907  std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
1908  if (!f.is_open())
1909  {
1910  err("Cannot open file %s for writing!\n",qPrint(fileName));
1911  return;
1912  }
1913  {
1914  TextStream t(&f);
1915 
1916  // write compound.xsd, but replace special marker with the entities
1917  QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
1918  const char *startLine = compound_xsd.data();
1919  while (*startLine)
1920  {
1921  // find end of the line
1922  const char *endLine = startLine+1;
1923  while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
1924  int len=static_cast<int>(endLine-startLine);
1925  if (len>0)
1926  {
1927  QCString s(startLine,len);
1928  if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
1929  {
1931  }
1932  else
1933  {
1934  t.write(startLine,len);
1935  }
1936  }
1937  startLine=endLine;
1938  }
1939  }
1940  f.close();
1941 
1942  fileName=outputDirectory+"/Doxyfile.xml";
1943  f.open(fileName.str(),std::ofstream::out | std::ofstream::binary);
1944  if (!f.is_open())
1945  {
1946  err("Cannot open file %s for writing\n",fileName.data());
1947  return;
1948  }
1949  else
1950  {
1951  TextStream t(&f);
1953  }
1954  f.close();
1955 
1956  fileName=outputDirectory+"/index.xml";
1957  f.open(fileName.str(),std::ofstream::out | std::ofstream::binary);
1958  if (!f.is_open())
1959  {
1960  err("Cannot open file %s for writing!\n",qPrint(fileName));
1961  return;
1962  }
1963  else
1964  {
1965  TextStream t(&f);
1966 
1967  // write index header
1968  t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";;
1969  t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
1970  t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
1971  t << "version=\"" << getDoxygenVersion() << "\" ";
1972  t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
1973  t << ">\n";
1974 
1975  for (const auto &cd : *Doxygen::classLinkedMap)
1976  {
1977  generateXMLForClass(cd.get(),t);
1978  }
1979  for (const auto &cd : *Doxygen::conceptLinkedMap)
1980  {
1981  msg("Generating XML output for concept %s\n",qPrint(cd->name()));
1982  generateXMLForConcept(cd.get(),t);
1983  }
1984  for (const auto &nd : *Doxygen::namespaceLinkedMap)
1985  {
1986  msg("Generating XML output for namespace %s\n",qPrint(nd->name()));
1987  generateXMLForNamespace(nd.get(),t);
1988  }
1989  for (const auto &fn : *Doxygen::inputNameLinkedMap)
1990  {
1991  for (const auto &fd : *fn)
1992  {
1993  msg("Generating XML output for file %s\n",qPrint(fd->name()));
1994  generateXMLForFile(fd.get(),t);
1995  }
1996  }
1997  for (const auto &gd : *Doxygen::groupLinkedMap)
1998  {
1999  msg("Generating XML output for group %s\n",qPrint(gd->name()));
2000  generateXMLForGroup(gd.get(),t);
2001  }
2002  for (const auto &pd : *Doxygen::pageLinkedMap)
2003  {
2004  msg("Generating XML output for page %s\n",qPrint(pd->name()));
2005  generateXMLForPage(pd.get(),t,FALSE);
2006  }
2007  for (const auto &dd : *Doxygen::dirLinkedMap)
2008  {
2009  msg("Generate XML output for dir %s\n",qPrint(dd->name()));
2010  generateXMLForDir(dd.get(),t);
2011  }
2012  for (const auto &pd : *Doxygen::exampleLinkedMap)
2013  {
2014  msg("Generating XML output for example %s\n",qPrint(pd->name()));
2015  generateXMLForPage(pd.get(),t,TRUE);
2016  }
2017  if (Doxygen::mainPage)
2018  {
2019  msg("Generating XML output for the main page\n");
2021  }
2022 
2023  //t << " </compoundlist>\n";
2024  t << "</doxygenindex>\n";
2025  }
2026 
2028  clearSubDirs(xmlDir);
2029 }

引用了 Doxygen::classLinkedMap, clearSubDirs(), Doxygen::conceptLinkedMap, Config_getString, ResourceMgr::copyResource(), createSubDirs(), QCString::data(), Doxygen::dirLinkedMap, err(), Doxygen::exampleLinkedMap, FALSE, QCString::find(), generateXMLForClass(), generateXMLForConcept(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForNamespace(), generateXMLForPage(), ResourceMgr::getAsString(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, HtmlEntityMapper::instance(), ResourceMgr::instance(), Doxygen::mainPage, msg(), Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, qPrint(), QCString::str(), theTranslator, Translator::trISOLang(), TRUE, TextStream::write(), writeCombineScript(), Config::writeXMLDoxyfile() , 以及 HtmlEntityMapper::writeXMLSchema().

被这些函数引用 generateOutput().

ResourceMgr::copyResource
bool copyResource(const QCString &name, const QCString &targetDir) const
Copies a registered resource to a given target directory
Definition: resourcemgr.cpp:180
ResourceMgr::instance
static ResourceMgr & instance()
Returns the one and only instance of this class
Definition: resourcemgr.cpp:32
HtmlEntityMapper::writeXMLSchema
void writeXMLSchema(TextStream &t)
Definition: htmlentity.cpp:477
generateXMLForGroup
static void generateXMLForGroup(const GroupDef *gd, TextStream &ti)
Definition: xmlgen.cpp:1645
generateXMLForFile
static void generateXMLForFile(FileDef *fd, TextStream &ti)
Definition: xmlgen.cpp:1531
Doxygen::mainPage
static std::unique_ptr< PageDef > mainPage
Definition: doxygen.h:83
generateXMLForDir
static void generateXMLForDir(DirDef *dd, TextStream &ti)
Definition: xmlgen.cpp:1712
ResourceMgr::getAsString
QCString getAsString(const QCString &name) const
Gets the resource data as a C string
Definition: resourcemgr.cpp:192
Dir
Class representing a directory in the file system
Definition: dir.h:68
generateXMLForPage
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition: xmlgen.cpp:1750
Doxygen::conceptLinkedMap
static ConceptLinkedMap * conceptLinkedMap
Definition: doxygen.h:80
Doxygen::pageLinkedMap
static PageLinkedMap * pageLinkedMap
Definition: doxygen.h:82
QCString::str
std::string str() const
Definition: qcstring.h:442
err
void err(const char *fmt,...)
Definition: message.cpp:203
generateXMLForClass
static void generateXMLForClass(const ClassDef *cd, TextStream &ti)
Definition: xmlgen.cpp:1231
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
Doxygen::dirLinkedMap
static DirLinkedMap * dirLinkedMap
Definition: doxygen.h:109
writeCombineScript
static void writeCombineScript()
Definition: xmlgen.cpp:161
HtmlEntityMapper::instance
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:341
generateXMLForNamespace
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition: xmlgen.cpp:1461
Doxygen::inputNameLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
Definition: doxygen.h:88
Translator::trISOLang
virtual QCString trISOLang()=0
theTranslator
Translator * theTranslator
Definition: language.cpp:156
Doxygen::groupLinkedMap
static GroupLinkedMap * groupLinkedMap
Definition: doxygen.h:96
TRUE
#define TRUE
Definition: qcstring.h:36
clearSubDirs
void clearSubDirs(const Dir &d)
Definition: util.cpp:3704
msg
void msg(const char *fmt,...)
Definition: message.cpp:53
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Config_getString
#define Config_getString(name)
Definition: config.h:32
Doxygen::namespaceLinkedMap
static NamespaceLinkedMap * namespaceLinkedMap
Definition: doxygen.h:97
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
generateXMLForConcept
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition: xmlgen.cpp:1417
Config::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
Doxygen::classLinkedMap
static ClassLinkedMap * classLinkedMap
Definition: doxygen.h:78
createSubDirs
void createSubDirs(const Dir &d)
Definition: util.cpp:3677
FALSE
#define FALSE
Definition: qcstring.h:33
Doxygen::exampleLinkedMap
static PageLinkedMap * exampleLinkedMap
Definition: doxygen.h:81
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108