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 */
91 };
95 };
96 static HtmlEntityMapper &instance();
97 SymType name2sym(const QCString &symName) const;
98 const char *utf8(SymType symb,bool useInPrintf=FALSE) const;
99 const char *html(SymType symb,bool useInPrintf=FALSE) const;
100 const char *xml(SymType symb) const;
101 const char *docbook(SymType symb) const;
102 const char *latex(SymType symb) const;
103 const char *man(SymType symb) const;
104 const char *rtf(SymType symb) const;
105 struct PerlSymb
106 {
107 const char *symb;
109 };
110 const PerlSymb *perl(SymType symb) const;
111 void writeXMLSchema(TextStream &t);
112 private:
113 void validate();
118 std::unordered_map<std::string,SymType> m_name2sym;
119};
120
121#endif
Singleton helper class to map html entities to other formats.
Definition htmlentity.h:28
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:118
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:117
This is an alternative implementation of QCString.
Definition qcstring.h:101
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