cmdmapper.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef _CMDMAPPER_H
20 #define _CMDMAPPER_H
21 
22 #include <qdict.h>
23 
24 struct CommandMap;
25 
26 const int SIMPLESECT_BIT = 0x1000;
27 
29 {
32  CMD_AMP = 2,
33  CMD_ANCHOR = 3,
34  CMD_AT = 4,
38  CMD_BOLD = 8,
40  CMD_CODE = 10,
41  CMD_COPYDOC = 11,
43  CMD_DOLLAR = 13,
45  CMD_DOTFILE = 15,
47  CMD_ENDCODE = 17,
50  CMD_ENDLINK = 20,
57  CMD_HASH = 27,
60  CMD_IMAGE = 30,
62  CMD_INTERNAL = 32,
66  CMD_LESS = 36,
67  CMD_LI = 37,
68  CMD_LINE = 38,
70  CMD_LINK = 40,
74  CMD_PERCENT = 44,
77  CMD_REF = 47,
90  CMD_SKIP = 60,
94  CMD_UNTIL = 64,
101  CMD_DOT = 71,
103  CMD_MSC = 73,
112  CMD_QUOTE = 82,
116  CMD_CITE = 86,
118  CMD_RTFONLY = 88,
120  CMD_PIPE = 90,
129  CMD_NDASH = 99,
130  CMD_MDASH = 100,
132  CMD_ENDUML = 102,
134  CMD_PUNT = 104,
135  CMD_PLUS = 105,
136  CMD_MINUS = 106
137 };
138 
140 {
147  HTML_IMG = 6,
148  HTML_PRE = 7,
149  HTML_SUB = 8,
150  HTML_SUP = 9,
151  HTML_TR = 10,
152  HTML_TD = 11,
153  HTML_TH = 12,
154  HTML_OL = 13,
155  HTML_UL = 14,
156  HTML_LI = 15,
158  HTML_HR = 17,
159  HTML_DL = 18,
160  HTML_DT = 19,
161  HTML_DD = 20,
162  HTML_BR = 21,
163  HTML_A = 22,
164  HTML_BOLD = 23,
165  HTML_P = 24,
166  HTML_H1 = 25,
167  HTML_H2 = 26,
168  HTML_H3 = 27,
169  HTML_H4 = 28,
170  HTML_H5 = 29,
171  HTML_H6 = 30,
172  HTML_SPAN = 31,
173  HTML_DIV = 32,
175 
176  XML_CmdMask = 0x100,
177 
201 };
202 
203 /** Class representing a mapping from command names to command IDs. */
204 class Mapper
205 {
206  public:
207  int map(const char *n);
208  QString find(const int n);
209  Mapper(const CommandMap *cm,bool caseSensitive);
210  private:
211  QDict<int> m_map;
212  bool m_cs;
213 };
214 
215 /** Class representing a namespace for the doxygen and HTML command mappers. */
216 struct Mappers
217 {
218  static void freeMappers();
219  static Mapper *cmdMapper;
221 };
222 
223 
224 #endif
static constexpr double cm
Definition: Units.h:68
CommandType
Definition: cmdmapper.h:28
Mapper(const CommandMap *cm, bool caseSensitive)
Definition: cmdmapper.cpp:243
static Mapper * htmlTagMapper
Definition: cmdmapper.h:220
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
bool m_cs
Definition: cmdmapper.h:212
const int SIMPLESECT_BIT
Definition: cmdmapper.h:26
QDict< int > m_map
Definition: cmdmapper.h:211
QString find(const int n)
Definition: cmdmapper.cpp:233
std::void_t< T > n
int map(const char *n)
Definition: cmdmapper.cpp:225
static Mapper * cmdMapper
Definition: cmdmapper.h:219
HtmlTagType
Definition: cmdmapper.h:139