Doxygen
|
Singleton helper class to map html entities to other formats. More...
#include <src/htmlentity.h>
Classes | |
struct | PerlSymb |
Public Member Functions | |
SymType | name2sym (const QCString &symName) const |
Give code of the requested HTML entity name. | |
const char * | utf8 (SymType symb, bool useInPrintf=FALSE) const |
Access routine to the UTF8 code of the HTML entity. | |
const char * | html (SymType symb, bool useInPrintf=FALSE) const |
Access routine to the html code of the HTML entity. | |
const char * | xml (SymType symb) const |
Access routine to the XML code of the HTML entity. | |
const char * | docbook (SymType symb) const |
Access routine to the docbook code of the HTML entity. | |
const char * | latex (SymType symb) const |
Access routine to the LaTeX code of the HTML entity. | |
const char * | man (SymType symb) const |
Access routine to the man code of the HTML entity. | |
const char * | rtf (SymType symb) const |
Access routine to the RTF code of the HTML entity. | |
const PerlSymb * | perl (SymType symb) const |
Access routine to the perl struct with the perl code of the HTML entity. | |
void | writeXMLSchema (TextStream &t) |
Static Public Member Functions | |
static HtmlEntityMapper & | instance () |
Returns the one and only instance of the HTML entity mapper. | |
Private Member Functions | |
void | validate () |
Routine to check if the entries of the html_entities are numbered correctly. | |
HtmlEntityMapper () | |
~HtmlEntityMapper () | |
Private Attributes | |
std::unordered_map< std::string, SymType > | m_name2sym |
Static Private Attributes | |
static HtmlEntityMapper * | s_instance |
Singleton helper class to map html entities to other formats.
Definition at line 27 of file htmlentity.h.
Enumerator | |
---|---|
Perl_unknown | |
Perl_string | |
Perl_char | |
Perl_symbol | |
Perl_umlaut | |
Perl_acute | |
Perl_grave | |
Perl_circ | |
Perl_slash | |
Perl_tilde | |
Perl_cedilla | |
Perl_ring |
Definition at line 92 of file htmlentity.h.
Definition at line 30 of file htmlentity.h.
|
private |
Definition at line 325 of file htmlentity.cpp.
References g_htmlEntities, m_name2sym, and validate().
Referenced by instance().
|
private |
Definition at line 334 of file htmlentity.cpp.
const char * HtmlEntityMapper::docbook | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the docbook code of the HTML entity.
symb | Code of the requested HTML entity |
nullptr
is returned. Definition at line 402 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by DocbookDocVisitor::operator()().
const char * HtmlEntityMapper::html | ( | HtmlEntityMapper::SymType | symb, |
bool | useInPrintf = FALSE ) const |
Access routine to the html code of the HTML entity.
symb | Code of the requested HTML entity |
useInPrintf | If TRUE the result will be escaped such that it can be used in a printf string pattern |
nullptr
is returned. Definition at line 373 of file htmlentity.cpp.
References g_htmlEntities, and Sym_Percent.
Referenced by HtmlDocVisitor::operator()(), and TextDocVisitor::operator()().
|
static |
Returns the one and only instance of the HTML entity mapper.
Definition at line 339 of file htmlentity.cpp.
References HtmlEntityMapper().
Referenced by convertCharEntitiesToUTF8(), convertToDocBook(), DocSymbol::decodeSymbol(), filterLatexString(), generateXML(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), ManDocVisitor::operator()(), PerlModDocVisitor::operator()(), PrintDocVisitor::operator()(), RTFDocVisitor::operator()(), TextDocVisitor::operator()(), and XmlDocVisitor::operator()().
const char * HtmlEntityMapper::latex | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the LaTeX code of the HTML entity.
symb | Code of the requested HTML entity |
nullptr
is returned. Definition at line 413 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by filterLatexString(), and LatexDocVisitor::operator()().
const char * HtmlEntityMapper::man | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the man code of the HTML entity.
symb | Code of the requested HTML entity |
nullptr
is returned. Definition at line 424 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by ManDocVisitor::operator()().
HtmlEntityMapper::SymType HtmlEntityMapper::name2sym | ( | const QCString & | symName | ) | const |
Give code of the requested HTML entity name.
symName | HTML entity name without & and ; |
HtmlEntityMapper::Sym_unknown
is returned. Definition at line 458 of file htmlentity.cpp.
References m_name2sym, QCString::str(), and Sym_Unknown.
Referenced by convertCharEntitiesToUTF8(), convertToDocBook(), DocSymbol::decodeSymbol(), and filterLatexString().
const HtmlEntityMapper::PerlSymb * HtmlEntityMapper::perl | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the perl struct with the perl code of the HTML entity.
symb | Code of the requested HTML entity |
symb
field and in the HtmlEntityMapper::Perl_unknown
in the type
field. Definition at line 447 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by PerlModDocVisitor::operator()().
const char * HtmlEntityMapper::rtf | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the RTF code of the HTML entity.
symb | Code of the requested HTML entity |
nullptr
is returned. Definition at line 435 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by RTFDocVisitor::operator()().
const char * HtmlEntityMapper::utf8 | ( | HtmlEntityMapper::SymType | symb, |
bool | useInPrintf = FALSE ) const |
Access routine to the UTF8 code of the HTML entity.
symb | Code of the requested HTML entity |
useInPrintf | If TRUE the result will be escaped such that it can be used in a printf string pattern |
nullptr
is returned. Definition at line 353 of file htmlentity.cpp.
References g_htmlEntities, and Sym_Percent.
Referenced by PrintDocVisitor::operator()().
|
private |
Routine to check if the entries of the html_entities are numbered correctly.
in case of a mismatch a warning message is given.
Definition at line 480 of file htmlentity.cpp.
References g_htmlEntities, and warn_uncond.
Referenced by HtmlEntityMapper().
void HtmlEntityMapper::writeXMLSchema | ( | TextStream & | t | ) |
Definition at line 464 of file htmlentity.cpp.
References QCString::at(), QCString::endsWith(), g_htmlEntities, QCString::isEmpty(), QCString::length(), and QCString::mid().
Referenced by generateXML().
const char * HtmlEntityMapper::xml | ( | HtmlEntityMapper::SymType | symb | ) | const |
Access routine to the XML code of the HTML entity.
symb | Code of the requested HTML entity |
nullptr
is returned. Definition at line 391 of file htmlentity.cpp.
References g_htmlEntities.
Referenced by XmlDocVisitor::operator()().
|
private |
Definition at line 118 of file htmlentity.h.
Referenced by HtmlEntityMapper(), and name2sym().
|
staticprivate |
Definition at line 117 of file htmlentity.h.