The HtmlEntityMapper
Class Reference
Singleton helper class to map html entities to other formats. More...
Declaration
Included Headers
Enumerations Index
enum | SymType { ... } |
enum | PerlType { ... } |
Private Constructors Index
HtmlEntityMapper () | |
Private Destructor Index
~HtmlEntityMapper () | |
Public Member Functions Index
SymType | name2sym (const QCString &symName) const |
Give code of the requested HTML entity name. More... | |
const char * | utf8 (SymType symb, bool useInPrintf=FALSE) const |
Access routine to the UTF8 code of the HTML entity. More... | |
const char * | html (SymType symb, bool useInPrintf=FALSE) const |
Access routine to the html code of the HTML entity. More... | |
const char * | xml (SymType symb) const |
Access routine to the XML code of the HTML entity. More... | |
const char * | docbook (SymType symb) const |
Access routine to the docbook code of the HTML entity. More... | |
const char * | latex (SymType symb) const |
Access routine to the LaTeX code of the HTML entity. More... | |
const char * | man (SymType symb) const |
Access routine to the man code of the HTML entity. More... | |
const char * | rtf (SymType symb) const |
Access routine to the RTF code of the HTML entity. More... | |
const PerlSymb * | perl (SymType symb) const |
Access routine to the perl struct with the perl code of the HTML entity. More... | |
void | writeXMLSchema (TextStream &t) |
Private Member Functions Index
void | validate () |
Routine to check if the entries of the html_entities are numbered correctly. More... | |
Private Member Attributes Index
std::unordered_map< std::string, SymType > | m_name2sym |
Public Static Functions Index
static HtmlEntityMapper & | instance () |
Returns the one and only instance of the HTML entity mapper. More... | |
Private Static Attributes Index
static HtmlEntityMapper * | s_instance |
Description
Singleton helper class to map html entities to other formats.
Definition at line 27 of file htmlentity.h.
Enumerations
PerlType
|
- Enumeration values
-
Perl_unknown (= 0) 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.
SymType
|
- Enumeration values
Definition at line 30 of file htmlentity.h.
Private Constructors
HtmlEntityMapper()
|
Declaration at line 114 of file htmlentity.h, definition at line 325 of file htmlentity.cpp.
References g_htmlEntities, m_name2sym and validate.
Referenced by instance.
Private Destructor
~HtmlEntityMapper()
|
Declaration at line 115 of file htmlentity.h, definition at line 334 of file htmlentity.cpp.
Public Member Functions
docbook()
|
Access routine to the docbook code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the docbook code of the HTML entity, in case the docbook code is unknown nullptr is returned.
Declaration at line 101 of file htmlentity.h, definition at line 402 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by DocbookDocVisitor::operator().
html()
Access routine to the html code of the HTML entity.
- Parameters
-
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
- Returns
the html representation of the HTML entity, in case the html code is unknown nullptr is returned.
Declaration at line 99 of file htmlentity.h, definition at line 373 of file htmlentity.cpp.
References g_htmlEntities and Sym_Percent.
Referenced by HtmlDocVisitor::operator() and TextDocVisitor::operator().
latex()
|
Access routine to the LaTeX code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the LaTeX code of the HTML entity, in case the LaTeX code is unknown nullptr is returned.
Declaration at line 102 of file htmlentity.h, definition at line 413 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by filterLatexString and LatexDocVisitor::operator().
man()
|
Access routine to the man code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the man of the HTML entity, in case the man code is unknown nullptr is returned.
Declaration at line 103 of file htmlentity.h, definition at line 424 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by ManDocVisitor::operator().
name2sym()
|
Give code of the requested HTML entity name.
- Parameters
-
symName HTML entity name without & and ;
- Returns
the code for the requested HTML entity name, in case the requested HTML item does not exist HtmlEntityMapper::Sym_unknown is returned.
Declaration at line 97 of file htmlentity.h, definition at line 458 of file htmlentity.cpp.
References m_name2sym, QCString::str and Sym_Unknown.
Referenced by convertCharEntitiesToUTF8, convertToDocBook, DocSymbol::decodeSymbol and filterLatexString.
perl()
|
Access routine to the perl struct with the perl code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the pointer to perl struct with the perl code of the HTML entity, in case the perl code does not exists the nullptr pointer is entered in the symb field and in the HtmlEntityMapper::Perl_unknown in the type field.
Declaration at line 110 of file htmlentity.h, definition at line 447 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by PerlModDocVisitor::operator().
rtf()
|
Access routine to the RTF code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the RTF of the HTML entity, in case the RTF code is unknown nullptr is returned.
Declaration at line 104 of file htmlentity.h, definition at line 435 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by RTFDocVisitor::operator().
utf8()
Access routine to the UTF8 code of the HTML entity.
- Parameters
-
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
- Returns
the UTF8 code of the HTML entity, in case the UTF code is unknown nullptr is returned.
Declaration at line 98 of file htmlentity.h, definition at line 353 of file htmlentity.cpp.
References g_htmlEntities and Sym_Percent.
Referenced by PrintDocVisitor::operator().
writeXMLSchema()
|
Declaration at line 111 of file htmlentity.h, 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.
xml()
|
Access routine to the XML code of the HTML entity.
- Parameters
-
symb Code of the requested HTML entity
- Returns
the XML code of the HTML entity, in case the XML code is unknown nullptr is returned.
Declaration at line 100 of file htmlentity.h, definition at line 391 of file htmlentity.cpp.
Reference g_htmlEntities.
Referenced by XmlDocVisitor::operator().
Private Member Functions
validate()
|
Routine to check if the entries of the html_entities are numbered correctly.
in case of a mismatch a warning message is given.
Declaration at line 113 of file htmlentity.h, definition at line 480 of file htmlentity.cpp.
References g_htmlEntities and warn_uncond.
Referenced by HtmlEntityMapper.
Private Member Attributes
m_name2sym
|
Definition at line 118 of file htmlentity.h.
Referenced by HtmlEntityMapper and name2sym.
Public Static Functions
instance()
| static |
Returns the one and only instance of the HTML entity mapper.
Declaration at line 96 of file htmlentity.h, definition at line 339 of file htmlentity.cpp.
Reference 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().
Private Static Attributes
s_instance
| static |
Definition at line 117 of file htmlentity.h.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus by Doxygen 1.14.0.