Doxygen
HtmlEntityMapper类 参考

Singleton helper class to map html entities to other formats 更多...

#include <htmlentity.h>

+ HtmlEntityMapper 的协作图:

Public 成员函数

DocSymbol::SymType name2sym (const QCString &symName) const
 Give code of the requested HTML entity name 更多...
 
const char * utf8 (DocSymbol::SymType symb, bool useInPrintf=FALSE) const
 Access routine to the UTF8 code of the HTML entity 更多...
 
const char * html (DocSymbol::SymType symb, bool useInPrintf=FALSE) const
 Access routine to the html code of the HTML entity 更多...
 
const char * xml (DocSymbol::SymType symb) const
 Access routine to the XML code of the HTML entity 更多...
 
const char * docbook (DocSymbol::SymType symb) const
 Access routine to the docbook code of the HTML entity 更多...
 
const char * latex (DocSymbol::SymType symb) const
 Access routine to the LaTeX code of the HTML entity 更多...
 
const char * man (DocSymbol::SymType symb) const
 Access routine to the man code of the HTML entity 更多...
 
const char * rtf (DocSymbol::SymType symb) const
 Access routine to the RTF code of the HTML entity 更多...
 
const DocSymbol::PerlSymbperl (DocSymbol::SymType symb) const
 Access routine to the perl struct with the perl code of the HTML entity 更多...
 
void writeXMLSchema (TextStream &t)
 

静态 Public 成员函数

static HtmlEntityMapperinstance ()
 Returns the one and only instance of the HTML entity mapper 更多...
 
static void deleteInstance ()
 Deletes the one and only instance of the HTML entity mapper 更多...
 

Private 成员函数

void validate ()
 Routine to check if the entries of the html_entities are numbered correctly 更多...
 
 HtmlEntityMapper ()
 
 ~HtmlEntityMapper ()
 

Private 属性

std::unordered_map< std::string, DocSymbol::SymTypem_name2sym
 

静态 Private 属性

static HtmlEntityMappers_instance = 0
 

详细描述

Singleton helper class to map html entities to other formats

在文件 htmlentity.h26 行定义.

构造及析构函数说明

◆ HtmlEntityMapper()

HtmlEntityMapper::HtmlEntityMapper ( )
private

在文件 htmlentity.cpp326 行定义.

327 {
328 
329  for (int i = 0; i < g_numHtmlEntities; i++)
330  {
331  m_name2sym.insert(std::make_pair(g_htmlEntities[i].item,g_htmlEntities[i].symb));
332  }
333  validate();
334 }

引用了 g_htmlEntities, g_numHtmlEntities, m_name2sym , 以及 validate().

被这些函数引用 instance().

◆ ~HtmlEntityMapper()

HtmlEntityMapper::~HtmlEntityMapper ( )
private

在文件 htmlentity.cpp336 行定义.

337 {
338 }

成员函数说明

◆ deleteInstance()

void HtmlEntityMapper::deleteInstance ( )
static

Deletes the one and only instance of the HTML entity mapper

在文件 htmlentity.cpp351 行定义.

352 {
353  delete s_instance;
354  s_instance=0;
355 }

引用了 s_instance.

◆ docbook()

const char * HtmlEntityMapper::docbook ( DocSymbol::SymType  symb) const

Access routine to the docbook code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the docbook code of the HTML entity, in case the docbook code is unknown NULL is returned.

在文件 htmlentity.cpp415 行定义.

416 {
417  return g_htmlEntities[symb].docbook;
418 }

引用了 htmlEntityInfo::docbook , 以及 g_htmlEntities.

被这些函数引用 DocbookDocVisitor::visit().

◆ html()

const char * HtmlEntityMapper::html ( DocSymbol::SymType  symb,
bool  useInPrintf = FALSE 
) const

Access routine to the html code of the HTML entity

参数
symbCode of the requested HTML entity
useInPrintfIf TRUE the result will be escaped such that it can be used in a printf string pattern
返回
the html representation of the HTML entity, in case the html code is unknown NULL is returned.

在文件 htmlentity.cpp386 行定义.

387 {
388  if (useInPrintf && symb==DocSymbol::Sym_Percent)
389  {
390  return "%%"; // escape for printf
391  }
392  else
393  {
394  return g_htmlEntities[symb].html;
395  }
396 }

引用了 g_htmlEntities, htmlEntityInfo::html , 以及 DocSymbol::Sym_Percent.

被这些函数引用 HtmlDocVisitor::visit() , 以及 TextDocVisitor::visit().

◆ instance()

HtmlEntityMapper * HtmlEntityMapper::instance ( )
static

◆ latex()

const char * HtmlEntityMapper::latex ( DocSymbol::SymType  symb) const

Access routine to the LaTeX code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the LaTeX code of the HTML entity, in case the LaTeX code is unknown NULL is returned.

在文件 htmlentity.cpp426 行定义.

427 {
428  return g_htmlEntities[symb].latex;
429 }

引用了 g_htmlEntities , 以及 htmlEntityInfo::latex.

被这些函数引用 filterLatexString() , 以及 LatexDocVisitor::visit().

◆ man()

const char * HtmlEntityMapper::man ( DocSymbol::SymType  symb) const

Access routine to the man code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the man of the HTML entity, in case the man code is unknown NULL is returned.

在文件 htmlentity.cpp437 行定义.

438 {
439  return g_htmlEntities[symb].man;
440 }

引用了 g_htmlEntities , 以及 htmlEntityInfo::man.

被这些函数引用 ManDocVisitor::visit().

◆ name2sym()

DocSymbol::SymType HtmlEntityMapper::name2sym ( const QCString symName) const

Give code of the requested HTML entity name

参数
symNameHTML entity name without & and ;
返回
the code for the requested HTML entity name, in case the requested HTML item does not exist DocSymbol::Sym_unknown is returned.

在文件 htmlentity.cpp471 行定义.

472 {
473  auto it = m_name2sym.find(symName.str());
474  return it!=m_name2sym.end() ? it->second : DocSymbol::Sym_Unknown;
475 }

引用了 m_name2sym, QCString::str() , 以及 DocSymbol::Sym_Unknown.

被这些函数引用 convertCharEntitiesToUTF8(), convertToDocBook(), DocSymbol::decodeSymbol() , 以及 filterLatexString().

◆ perl()

const DocSymbol::PerlSymb * HtmlEntityMapper::perl ( DocSymbol::SymType  symb) const

Access routine to the perl struct with the perl code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the pointer to perl struct with the perl code of the HTML entity, in case the perl code does not exists the NULL pointer is entered in the symb field and in the DocSymbol::Perl_unknown in the type field.

在文件 htmlentity.cpp460 行定义.

461 {
462  return &g_htmlEntities[symb].perl;
463 }

引用了 g_htmlEntities , 以及 htmlEntityInfo::perl.

被这些函数引用 PerlModDocVisitor::visit().

◆ rtf()

const char * HtmlEntityMapper::rtf ( DocSymbol::SymType  symb) const

Access routine to the RTF code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the RTF of the HTML entity, in case the RTF code is unknown NULL is returned.

在文件 htmlentity.cpp448 行定义.

449 {
450  return g_htmlEntities[symb].rtf;
451 }

引用了 g_htmlEntities , 以及 htmlEntityInfo::rtf.

被这些函数引用 RTFDocVisitor::visit().

◆ utf8()

const char * HtmlEntityMapper::utf8 ( DocSymbol::SymType  symb,
bool  useInPrintf = FALSE 
) const

Access routine to the UTF8 code of the HTML entity

参数
symbCode of the requested HTML entity
useInPrintfIf TRUE the result will be escaped such that it can be used in a printf string pattern
返回
the UTF8 code of the HTML entity, in case the UTF code is unknown NULL is returned.

在文件 htmlentity.cpp366 行定义.

367 {
368  if (useInPrintf && symb==DocSymbol::Sym_Percent)
369  {
370  return "%%"; // escape for printf
371  }
372  else
373  {
374  return g_htmlEntities[symb].UTF8;
375  }
376 }

引用了 g_htmlEntities, DocSymbol::Sym_Percent , 以及 htmlEntityInfo::UTF8.

◆ validate()

void HtmlEntityMapper::validate ( )
private

Routine to check if the entries of the html_entities are numbered correctly

in case of a mismatch a warning message is given.

在文件 htmlentity.cpp493 行定义.

494 {
495  for (int i = 0; i < g_numHtmlEntities; i++)
496  {
497  if (i != g_htmlEntities[i].symb)
498  {
499  warn_uncond("Internal inconsistency, htmlentries code %d (item=%s)\n",i,g_htmlEntities[i].item);
500  }
501  }
502 }

引用了 g_htmlEntities, g_numHtmlEntities , 以及 warn_uncond().

被这些函数引用 HtmlEntityMapper().

◆ writeXMLSchema()

void HtmlEntityMapper::writeXMLSchema ( TextStream t)

在文件 htmlentity.cpp477 行定义.

478 {
479  for (int i=0;i<g_numHtmlEntities - g_numberHtmlMappedCmds;i++)
480  {
481  QCString bareName = g_htmlEntities[i].xml;
482  if (!bareName.isEmpty() && bareName.at(0)=='<' && bareName.right(2)=="/>")
483  {
484  bareName = bareName.mid(1,bareName.length()-3); // strip < and />
485  t << " <xsd:element name=\"" << bareName << "\" type=\"docEmptyType\" />\n";
486  }
487  }
488 }

引用了 QCString::at(), g_htmlEntities, g_numberHtmlMappedCmds, g_numHtmlEntities, QCString::isEmpty(), QCString::length(), QCString::mid(), QCString::right() , 以及 htmlEntityInfo::xml.

被这些函数引用 generateXML().

◆ xml()

const char * HtmlEntityMapper::xml ( DocSymbol::SymType  symb) const

Access routine to the XML code of the HTML entity

参数
symbCode of the requested HTML entity
返回
the XML code of the HTML entity, in case the XML code is unknown NULL is returned.

在文件 htmlentity.cpp404 行定义.

405 {
406  return g_htmlEntities[symb].xml;
407 }

引用了 g_htmlEntities , 以及 htmlEntityInfo::xml.

被这些函数引用 XmlDocVisitor::visit().

类成员变量说明

◆ m_name2sym

std::unordered_map<std::string,DocSymbol::SymType> HtmlEntityMapper::m_name2sym
private

在文件 htmlentity.h46 行定义.

被这些函数引用 HtmlEntityMapper() , 以及 name2sym().

◆ s_instance

HtmlEntityMapper * HtmlEntityMapper::s_instance = 0
staticprivate

在文件 htmlentity.h45 行定义.

被这些函数引用 deleteInstance() , 以及 instance().


该类的文档由以下文件生成:
g_numberHtmlMappedCmds
static const int g_numberHtmlMappedCmds
Number of doxygen commands mapped as if it were HTML entities
Definition: htmlentity.cpp:21
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
HtmlEntityMapper::HtmlEntityMapper
HtmlEntityMapper()
Definition: htmlentity.cpp:326
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
htmlEntityInfo::latex
const char * latex
Definition: htmlentity.cpp:35
DocSymbol::Sym_Percent
@ Sym_Percent
Definition: docparser.h:446
htmlEntityInfo::man
const char * man
Definition: htmlentity.cpp:36
QCString::str
std::string str() const
Definition: qcstring.h:442
g_numHtmlEntities
static const int g_numHtmlEntities
Definition: htmlentity.cpp:322
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
htmlEntityInfo::rtf
const char * rtf
Definition: htmlentity.cpp:37
htmlEntityInfo::html
const char * html
Definition: htmlentity.cpp:32
warn_uncond
void warn_uncond(const char *fmt,...)
Definition: message.cpp:194
g_htmlEntities
static struct htmlEntityInfo g_htmlEntities[]
DocSymbol::Sym_Unknown
@ Sym_Unknown
Definition: docparser.h:388
htmlEntityInfo::docbook
const char * docbook
Definition: htmlentity.cpp:34
htmlEntityInfo::UTF8
const char * UTF8
Definition: htmlentity.cpp:31
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
htmlEntityInfo::xml
const char * xml
Definition: htmlentity.cpp:33
HtmlEntityMapper::m_name2sym
std::unordered_map< std::string, DocSymbol::SymType > m_name2sym
Definition: htmlentity.h:46
HtmlEntityMapper::validate
void validate()
Routine to check if the entries of the html_entities are numbered correctly
Definition: htmlentity.cpp:493
htmlEntityInfo::perl
DocSymbol::PerlSymb perl
Definition: htmlentity.cpp:38
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108
HtmlEntityMapper::s_instance
static HtmlEntityMapper * s_instance
Definition: htmlentity.h:45