Doxygen
Loading...
Searching...
No Matches
htmlentity.h
Go to the documentation of this file.
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 "qcstring.h"
22#include "construct.h"
23
24class TextStream;
25
26/** @brief Singleton helper class to map html entities to other formats */
28{
29 public:
30 enum SymType { Sym_Unknown = -1,
82
83 /* doxygen extensions */
85
86 /* doxygen commands mapped */
90 };
94 };
95 static HtmlEntityMapper &instance();
96 SymType name2sym(const QCString &symName) const;
97 const char *utf8(SymType symb,bool useInPrintf=FALSE) const;
98 const char *html(SymType symb,bool useInPrintf=FALSE) const;
99 const char *xml(SymType symb) const;
100 const char *docbook(SymType symb) const;
101 const char *latex(SymType symb) const;
102 const char *man(SymType symb) const;
103 const char *rtf(SymType symb) const;
104 struct PerlSymb
105 {
106 const char *symb;
108 };
109 const PerlSymb *perl(SymType symb) const;
110 void writeXMLSchema(TextStream &t);
111 private:
112 void validate();
117 std::unordered_map<std::string,SymType> m_name2sym;
118};
119
120#endif
const char * latex(SymType symb) const
Access routine to the LaTeX 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.
const char * xml(SymType symb) const
Access routine to the XML code of the HTML entity.
void writeXMLSchema(TextStream &t)
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
std::unordered_map< std::string, SymType > m_name2sym
Definition htmlentity.h:117
const char * rtf(SymType symb) const
Access routine to the RTF code of the HTML entity.
void validate()
Routine to check if the entries of the html_entities are numbered correctly.
const char * docbook(SymType symb) const
Access routine to the docbook code of the HTML entity.
const char * utf8(SymType symb, bool useInPrintf=FALSE) const
Access routine to the UTF8 code of the HTML entity.
const char * man(SymType symb) const
Access routine to the man code of the HTML entity.
const char * html(SymType symb, bool useInPrintf=FALSE) const
Access routine to the html code of the HTML entity.
SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name.
static HtmlEntityMapper * s_instance
Definition htmlentity.h:116
Text streaming class that buffers data.
Definition textstream.h:36
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
#define FALSE
Definition qcstring.h:34