Doxygen
htmlentity.h
浏览该文件的文档.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 #ifndef HTMLENTITY_H
16 #define HTMLENTITY_H
17 
18 #include <unordered_map>
19 #include <string>
20 
21 #include "docparser.h"
22 
23 class TextStream;
24 
25 /** @brief Singleton helper class to map html entities to other formats */
27 {
28  public:
29  static HtmlEntityMapper *instance();
30  static void deleteInstance();
31  DocSymbol::SymType name2sym(const QCString &symName) const;
32  const char *utf8(DocSymbol::SymType symb,bool useInPrintf=FALSE) const;
33  const char *html(DocSymbol::SymType symb,bool useInPrintf=FALSE) const;
34  const char *xml(DocSymbol::SymType symb) const;
35  const char *docbook(DocSymbol::SymType symb) const;
36  const char *latex(DocSymbol::SymType symb) const;
37  const char *man(DocSymbol::SymType symb) const;
38  const char *rtf(DocSymbol::SymType symb) const;
39  const DocSymbol::PerlSymb *perl(DocSymbol::SymType symb) const;
40  void writeXMLSchema(TextStream &t);
41  private:
42  void validate();
46  std::unordered_map<std::string,DocSymbol::SymType> m_name2sym;
47 };
48 
49 #endif
HtmlEntityMapper::latex
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity
Definition: htmlentity.cpp:426
HtmlEntityMapper::name2sym
DocSymbol::SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name
Definition: htmlentity.cpp:471
HtmlEntityMapper::writeXMLSchema
void writeXMLSchema(TextStream &t)
Definition: htmlentity.cpp:477
DocSymbol::SymType
SymType
Definition: docparser.h:388
HtmlEntityMapper::xml
const char * xml(DocSymbol::SymType symb) const
Access routine to the XML code of the HTML entity
Definition: htmlentity.cpp:404
HtmlEntityMapper::HtmlEntityMapper
HtmlEntityMapper()
Definition: htmlentity.cpp:326
HtmlEntityMapper::deleteInstance
static void deleteInstance()
Deletes the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:351
HtmlEntityMapper::perl
const DocSymbol::PerlSymb * perl(DocSymbol::SymType symb) const
Access routine to the perl struct with the perl code of the HTML entity
Definition: htmlentity.cpp:460
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
HtmlEntityMapper::instance
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:341
HtmlEntityMapper
Singleton helper class to map html entities to other formats
Definition: htmlentity.h:26
HtmlEntityMapper::man
const char * man(DocSymbol::SymType symb) const
Access routine to the man code of the HTML entity
Definition: htmlentity.cpp:437
docparser.h
HtmlEntityMapper::~HtmlEntityMapper
~HtmlEntityMapper()
Definition: htmlentity.cpp:336
HtmlEntityMapper::docbook
const char * docbook(DocSymbol::SymType symb) const
Access routine to the docbook code of the HTML entity
Definition: htmlentity.cpp:415
HtmlEntityMapper::m_name2sym
std::unordered_map< std::string, DocSymbol::SymType > m_name2sym
Definition: htmlentity.h:46
HtmlEntityMapper::html
const char * html(DocSymbol::SymType symb, bool useInPrintf=FALSE) const
Access routine to the html code of the HTML entity
Definition: htmlentity.cpp:386
HtmlEntityMapper::rtf
const char * rtf(DocSymbol::SymType symb) const
Access routine to the RTF code of the HTML entity
Definition: htmlentity.cpp:448
HtmlEntityMapper::validate
void validate()
Routine to check if the entries of the html_entities are numbered correctly
Definition: htmlentity.cpp:493
DocSymbol::PerlSymb
Definition: docparser.h:453
FALSE
#define FALSE
Definition: qcstring.h:33
HtmlEntityMapper::utf8
const char * utf8(DocSymbol::SymType symb, bool useInPrintf=FALSE) const
Access routine to the UTF8 code of the HTML entity
Definition: htmlentity.cpp:366
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108
HtmlEntityMapper::s_instance
static HtmlEntityMapper * s_instance
Definition: htmlentity.h:45