Doxygen
layout.cpp 文件参考
#include <array>
#include <assert.h>
#include "layout.h"
#include "message.h"
#include "language.h"
#include "vhdldocgen.h"
#include "util.h"
#include "doxygen.h"
#include "version.h"
#include "config.h"
#include "xml.h"
#include "resourcemgr.h"
#include "debug.h"
+ layout.cpp 的引用(Include)关系图:

浏览源代码.

class  LayoutParser
 
struct  ElementCallbacks
 
class  LayoutDocManager::Private
 

函数

QCString compileOptions (const QCString &def)
 
QCString compileOptions (const QCString &def, SrcLangExt langId1, const QCString &value1)
 
QCString compileOptions (const QCString &def, SrcLangExt langId1, const QCString &value1, SrcLangExt langId2, const QCString &value2)
 
QCString compileOptions (const QCString &def, SrcLangExt langId1, const QCString &value1, SrcLangExt langId2, const QCString &value2, SrcLangExt langId3, const QCString &value3)
 
QCString compileOptions (const QCString &def, SrcLangExt langId1, const QCString &value1, SrcLangExt langId2, const QCString &value2, SrcLangExt langId3, const QCString &value3, SrcLangExt langId4, const QCString &value4)
 
QCString compileOptions (const QCString &def, SrcLangExt langId1, const QCString &value1, SrcLangExt langId2, const QCString &value2, SrcLangExt langId3, const QCString &value3, SrcLangExt langId4, const QCString &value4, SrcLangExt langId5, const QCString &value5)
 
static bool elemIsVisible (const XMLHandlers::Attributes &attrib, bool defVal=TRUE)
 
static ElementCallbacks::StartCallback startCb (void(LayoutParser::*fn)(const XMLHandlers::Attributes &))
 
static ElementCallbacks::StartCallback startCb (void(LayoutParser::*fn)(LayoutDocEntry::Kind, const XMLHandlers::Attributes &), LayoutDocEntry::Kind kind)
 
static ElementCallbacks::StartCallback startCb (void(LayoutParser::*fn)(LayoutDocEntry::Kind, const XMLHandlers::Attributes &, const QCString &), LayoutDocEntry::Kind kind, std::function< QCString()> title)
 
static ElementCallbacks::StartCallback startCb (void(LayoutParser::*fn)(const XMLHandlers::Attributes &, MemberListType, const QCString &, const QCString &), MemberListType type, std::function< QCString()> title)
 
static ElementCallbacks::StartCallback startCb (void(LayoutParser::*fn)(const XMLHandlers::Attributes &, MemberListType, const QCString &, const QCString &), MemberListType type, std::function< QCString()> title, std::function< QCString()> subtitle)
 
static ElementCallbacks::EndCallback endCb (void(LayoutParser::*fn)())
 
static ElementCallbacks::EndCallback endCb ()
 
void writeDefaultLayoutFile (const QCString &fileName)
 
QCString extractLanguageSpecificTitle (const QCString &input, SrcLangExt lang)
 

变量

static const std::map< std::string, ElementCallbacksg_elementHandlers
 

函数说明

◆ compileOptions() [1/6]

QCString compileOptions ( const QCString def)
inline

在文件 layout.cpp35 行定义.

36 {
37  return def;
38 }

被这些函数引用 compileOptions().

◆ compileOptions() [2/6]

QCString compileOptions ( const QCString def,
SrcLangExt  langId1,
const QCString value1 
)
inline

在文件 layout.cpp40 行定义.

41 {
42  return compileOptions(def)+"|"+QCString().setNum(langId1)+"="+value1;
43 }

引用了 compileOptions() , 以及 QCString::setNum().

◆ compileOptions() [3/6]

QCString compileOptions ( const QCString def,
SrcLangExt  langId1,
const QCString value1,
SrcLangExt  langId2,
const QCString value2 
)
inline

在文件 layout.cpp45 行定义.

47 {
48  return compileOptions(def,langId1,value1)+
49  "|"+QCString().setNum(langId2)+"="+value2;
50 }

引用了 compileOptions() , 以及 QCString::setNum().

◆ compileOptions() [4/6]

QCString compileOptions ( const QCString def,
SrcLangExt  langId1,
const QCString value1,
SrcLangExt  langId2,
const QCString value2,
SrcLangExt  langId3,
const QCString value3 
)
inline

在文件 layout.cpp52 行定义.

55 {
56  return compileOptions(def,langId1,value1,langId2,value2)+
57  "|"+QCString().setNum(langId3)+"="+value3;
58 }

引用了 compileOptions() , 以及 QCString::setNum().

◆ compileOptions() [5/6]

QCString compileOptions ( const QCString def,
SrcLangExt  langId1,
const QCString value1,
SrcLangExt  langId2,
const QCString value2,
SrcLangExt  langId3,
const QCString value3,
SrcLangExt  langId4,
const QCString value4 
)
inline

在文件 layout.cpp60 行定义.

64 {
65  return compileOptions(def,langId1,value1,langId2,value2,langId3,value3)+
66  "|"+QCString().setNum(langId4)+"="+value4;
67 }

引用了 compileOptions() , 以及 QCString::setNum().

◆ compileOptions() [6/6]

QCString compileOptions ( const QCString def,
SrcLangExt  langId1,
const QCString value1,
SrcLangExt  langId2,
const QCString value2,
SrcLangExt  langId3,
const QCString value3,
SrcLangExt  langId4,
const QCString value4,
SrcLangExt  langId5,
const QCString value5 
)
inline

在文件 layout.cpp69 行定义.

74 {
75  return compileOptions(def,langId1,value1,langId2,value2,langId3,value3,langId4,value4)+
76  "|"+QCString().setNum(langId5)+"="+value5;
77 }

引用了 compileOptions() , 以及 QCString::setNum().

◆ elemIsVisible()

static bool elemIsVisible ( const XMLHandlers::Attributes attrib,
bool  defVal = TRUE 
)
static

在文件 layout.cpp80 行定义.

81 {
82  QCString visible = XMLHandlers::value(attrib,"visible");
83  if (visible.isEmpty()) return defVal;
84  if (visible.at(0)=='$' && visible.length()>1)
85  {
86  QCString id = visible.mid(1);
87  const ConfigValues::Info *opt = ConfigValues::instance().get(id);
88  if (opt && opt->type==ConfigValues::Info::Bool)
89  {
90  return ConfigValues::instance().*(opt->value.b);
91  }
92  else if (opt && opt->type==ConfigValues::Info::String)
93  {
94  return ConfigValues::instance().*(opt->value.s) != "NO";
95  }
96  else if (!opt)
97  {
98  err("found unsupported value %s for visible attribute in layout file\n",
99  qPrint(visible));
100  }
101  }
102  return visible!="no" && visible!="0";
103 }

引用了 QCString::at(), err(), QCString::isEmpty(), QCString::length(), QCString::mid(), qPrint() , 以及 XMLHandlers::value().

被这些函数引用 LayoutParser::startNavEntry(), LayoutParser::startSectionEntry() , 以及 LayoutParser::startSimpleEntry().

◆ endCb() [1/2]

static ElementCallbacks::EndCallback endCb ( )
static

在文件 layout.cpp764 行定义.

765 {
766  return [](LayoutParser &){};
767 }

◆ endCb() [2/2]

static ElementCallbacks::EndCallback endCb ( void(LayoutParser::*)()  fn)
static

在文件 layout.cpp759 行定义.

760 {
761  return [fn](LayoutParser &parser) { (parser.*fn)(); };
762 }

◆ extractLanguageSpecificTitle()

QCString extractLanguageSpecificTitle ( const QCString input,
SrcLangExt  lang 
)

在文件 layout.cpp1638 行定义.

1639 {
1640  int i,s=0,e=input.find('|');
1641  if (e==-1) return input; // simple title case
1642  int e1=e;
1643  while (e!=-1) // look for 'number=title' pattern separated by '|'
1644  {
1645  s=e+1;
1646  e=input.find('|',s);
1647  i=input.find('=',s);
1648  assert(i>s);
1649  int key=input.mid(s,i-s).toInt();
1650  if (key==(int)lang) // found matching key
1651  {
1652  if (e==-1) e=input.length();
1653  return input.mid(i+1,e-i-1);
1654  }
1655  }
1656  return input.left(e1); // fallback, no explicit language key found
1657 }

引用了 QCString::find(), QCString::left(), QCString::length(), QCString::mid() , 以及 QCString::toInt().

被这些函数引用 LayoutDocEntryMemberDecl::subtitle(), LayoutDocEntrySection::title(), LayoutDocEntryMemberDecl::title() , 以及 LayoutDocEntryMemberDef::title().

◆ startCb() [1/5]

static ElementCallbacks::StartCallback startCb ( void(LayoutParser::*)(const XMLHandlers::Attributes &)  fn)
static

在文件 layout.cpp723 行定义.

724 {
725  return [fn](LayoutParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(attr); };
726 }

◆ startCb() [2/5]

static ElementCallbacks::StartCallback startCb ( void(LayoutParser::*)(const XMLHandlers::Attributes &, MemberListType, const QCString &, const QCString &)  fn,
MemberListType  type,
std::function< QCString()>  title 
)
static

在文件 layout.cpp741 行定义.

745 {
746  return [fn,type,title](LayoutParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(attr,type,title(),QCString()); };
747 }

◆ startCb() [3/5]

static ElementCallbacks::StartCallback startCb ( void(LayoutParser::*)(const XMLHandlers::Attributes &, MemberListType, const QCString &, const QCString &)  fn,
MemberListType  type,
std::function< QCString()>  title,
std::function< QCString()>  subtitle 
)
static

在文件 layout.cpp749 行定义.

754 {
755  return [fn,type,title,subtitle](LayoutParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(attr,type,title(),subtitle()); };
756 }

◆ startCb() [4/5]

static ElementCallbacks::StartCallback startCb ( void(LayoutParser::*)(LayoutDocEntry::Kind, const XMLHandlers::Attributes &)  fn,
LayoutDocEntry::Kind  kind 
)
static

在文件 layout.cpp728 行定义.

729 {
730  return [fn,kind](LayoutParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(kind,attr); };
731 }

◆ startCb() [5/5]

static ElementCallbacks::StartCallback startCb ( void(LayoutParser::*)(LayoutDocEntry::Kind, const XMLHandlers::Attributes &, const QCString &)  fn,
LayoutDocEntry::Kind  kind,
std::function< QCString()>  title 
)
static

在文件 layout.cpp733 行定义.

737 {
738  return [fn,kind,title](LayoutParser &parser,const XMLHandlers::Attributes &attr) { (parser.*fn)(kind,attr,title()); };
739 }

◆ writeDefaultLayoutFile()

void writeDefaultLayoutFile ( const QCString fileName)

在文件 layout.cpp1614 行定义.

1615 {
1616  std::ofstream f;
1617  if (openOutputFile(fileName,f))
1618  {
1619  TextStream t(&f);
1620  QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
1621  t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
1622  }
1623  else
1624  {
1625  err("Failed to open file %s for writing!\n",qPrint(fileName));
1626  return;
1627  }
1628  f.close();
1629 }

引用了 err(), ResourceMgr::getAsString(), ResourceMgr::instance(), openOutputFile(), qPrint() , 以及 substitute().

被这些函数引用 readConfiguration().

变量说明

◆ g_elementHandlers

const std::map< std::string, ElementCallbacks > g_elementHandlers
static

在文件 layout.cpp769 行定义.

被这些函数引用 LayoutParser::endElement() , 以及 LayoutParser::startElement().

ResourceMgr::instance
static ResourceMgr & instance()
Returns the one and only instance of this class
Definition: resourcemgr.cpp:32
XMLHandlers::Attributes
std::unordered_map< std::string, std::string > Attributes
Definition: xml.h:42
ResourceMgr::getAsString
QCString getAsString(const QCString &name) const
Gets the resource data as a C string
Definition: resourcemgr.cpp:192
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
LayoutParser
Definition: layout.cpp:163
err
void err(const char *fmt,...)
Definition: message.cpp:203
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
compileOptions
QCString compileOptions(const QCString &def)
Definition: layout.cpp:35
QCString::toInt
int toInt(bool *ok=0, int base=10) const
Definition: qcstring.cpp:244
QCString::setNum
QCString & setNum(short n)
Definition: qcstring.h:372
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
openOutputFile
bool openOutputFile(const QCString &outFile, std::ofstream &f)
Definition: util.cpp:7039
XMLHandlers::value
static std::string value(const Attributes &attrib, const std::string &key)
Definition: xml.h:57
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108