Doxygen
cmdmapper.h
浏览该文件的文档.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2021 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 
16 #ifndef CMDMAPPER_H
17 #define CMDMAPPER_H
18 
19 #include <map>
20 #include <string>
21 #include "qcstring.h"
22 
23 struct CommandMap;
24 
25 const int SIMPLESECT_BIT = 0x1000;
26 
28 {
31  CMD_AMP = 2,
33  CMD_AT = 4,
37  CMD_BOLD = 8,
39  CMD_CODE = 10,
42  CMD_DOLLAR = 13,
56  CMD_HASH = 27,
59  CMD_IMAGE = 30,
65  CMD_LESS = 36,
66  CMD_LI = 37,
67  CMD_LINE = 38,
69  CMD_LINK = 40,
76  CMD_REF = 47,
89  CMD_SKIP = 60,
93  CMD_UNTIL = 64,
100  CMD_DOT = 71,
102  CMD_MSC = 73,
111  CMD_QUOTE = 82,
115  CMD_CITE = 86,
119  CMD_PIPE = 90,
128  CMD_NDASH = 99,
129  CMD_MDASH = 100,
131  CMD_ENDUML = 102,
133  CMD_PUNT = 104,
134  CMD_PLUS = 105,
135  CMD_MINUS = 106,
139  CMD_EMOJI = 110,
140  CMD_EQUAL = 111,
145  CMD_ILINE = 116,
146 };
147 
149 {
156  HTML_IMG = 6,
157  HTML_PRE = 7,
158  HTML_SUB = 8,
159  HTML_SUP = 9,
160  HTML_TR = 10,
161  HTML_TD = 11,
162  HTML_TH = 12,
163  HTML_OL = 13,
164  HTML_UL = 14,
165  HTML_LI = 15,
167  HTML_HR = 17,
168  HTML_DL = 18,
169  HTML_DT = 19,
170  HTML_DD = 20,
171  HTML_BR = 21,
172  HTML_A = 22,
173  HTML_BOLD = 23,
174  HTML_P = 24,
175  HTML_H1 = 25,
176  HTML_H2 = 26,
177  HTML_H3 = 27,
178  HTML_H4 = 28,
179  HTML_H5 = 29,
180  HTML_H6 = 30,
181  HTML_SPAN = 31,
182  HTML_DIV = 32,
186  HTML_INS = 36,
187  HTML_DEL = 37,
188  HTML_S = 38,
189 
190  XML_CmdMask = 0x100,
191 
215 };
216 
217 
218 /** Class representing a mapping from command names to command IDs. */
219 class Mapper
220 {
221  public:
222  int map(const QCString &n);
223  QCString find(const int n);
224  Mapper(const CommandMap *cm,bool caseSensitive);
225  private:
226  std::map<std::string,int> m_map;
227  bool m_cs;
228 };
229 
230 /** Class representing a namespace for the doxygen and HTML command mappers. */
231 struct Mappers
232 {
233  static void freeMappers();
234  static Mapper *cmdMapper;
236 };
237 
238 
239 #endif
CMD_DOLLAR
@ CMD_DOLLAR
Definition: cmdmapper.h:42
CMD_ENDRTFONLY
@ CMD_ENDRTFONLY
Definition: cmdmapper.h:118
CMD_SUBSECTION
@ CMD_SUBSECTION
Definition: cmdmapper.h:85
HTML_UNDERLINE
@ HTML_UNDERLINE
Definition: cmdmapper.h:185
CMD_ENDMANONLY
@ CMD_ENDMANONLY
Definition: cmdmapper.h:105
CMD_ENDVERBATIM
@ CMD_ENDVERBATIM
Definition: cmdmapper.h:51
CMD_BSLASH
@ CMD_BSLASH
Definition: cmdmapper.h:38
HTML_H5
@ HTML_H5
Definition: cmdmapper.h:179
Mapper::find
QCString find(const int n)
Definition: cmdmapper.cpp:246
CMD_ENDXMLONLY
@ CMD_ENDXMLONLY
Definition: cmdmapper.h:52
CMD_FORMULA
@ CMD_FORMULA
Definition: cmdmapper.h:54
CMD_EMPHASIS
@ CMD_EMPHASIS
Definition: cmdmapper.h:45
CMD_LESS
@ CMD_LESS
Definition: cmdmapper.h:65
CMD_STARTCODE
@ CMD_STARTCODE
Definition: cmdmapper.h:91
CMD_POST
@ CMD_POST
Definition: cmdmapper.h:74
CMD_ENDCODE
@ CMD_ENDCODE
Definition: cmdmapper.h:46
XML_SEE
@ XML_SEE
Definition: cmdmapper.h:207
CMD_AT
@ CMD_AT
Definition: cmdmapper.h:33
XML_PARA
@ XML_PARA
Definition: cmdmapper.h:201
CMD_SECTION
@ CMD_SECTION
Definition: cmdmapper.h:83
CMD_SETSCOPE
@ CMD_SETSCOPE
Definition: cmdmapper.h:132
XML_SUMMARY
@ XML_SUMMARY
Definition: cmdmapper.h:209
CMD_BOLD
@ CMD_BOLD
Definition: cmdmapper.h:37
CMD_COPYDOC
@ CMD_COPYDOC
Definition: cmdmapper.h:40
HTML_LI
@ HTML_LI
Definition: cmdmapper.h:165
CMD_INTERNAL
@ CMD_INTERNAL
Definition: cmdmapper.h:61
CMD_ENDDOT
@ CMD_ENDDOT
Definition: cmdmapper.h:101
CMD_LINK
@ CMD_LINK
Definition: cmdmapper.h:69
Mappers
Class representing a namespace for the doxygen and HTML command mappers.
Definition: cmdmapper.h:231
CMD_VERSION
@ CMD_VERSION
Definition: cmdmapper.h:96
CMD_AUTHORS
@ CMD_AUTHORS
Definition: cmdmapper.h:36
XML_VALUE
@ XML_VALUE
Definition: cmdmapper.h:213
HTML_CODE
@ HTML_CODE
Definition: cmdmapper.h:155
HTML_SMALL
@ HTML_SMALL
Definition: cmdmapper.h:154
XML_REMARKS
@ XML_REMARKS
Definition: cmdmapper.h:205
CMD_CITE
@ CMD_CITE
Definition: cmdmapper.h:115
HTML_PRE
@ HTML_PRE
Definition: cmdmapper.h:157
CMD_PRE
@ CMD_PRE
Definition: cmdmapper.h:75
CMD_LI
@ CMD_LI
Definition: cmdmapper.h:66
HTML_H4
@ HTML_H4
Definition: cmdmapper.h:178
CMD_ENDDBONLY
@ CMD_ENDDBONLY
Definition: cmdmapper.h:122
CMD_LATEXONLY
@ CMD_LATEXONLY
Definition: cmdmapper.h:64
CMD_UNKNOWN
@ CMD_UNKNOWN
Definition: cmdmapper.h:29
CMD_ENDMSC
@ CMD_ENDMSC
Definition: cmdmapper.h:103
XML_RETURNS
@ XML_RETURNS
Definition: cmdmapper.h:206
CMD_COPYRIGHT
@ CMD_COPYRIGHT
Definition: cmdmapper.h:114
CMD_SNIPPET
@ CMD_SNIPPET
Definition: cmdmapper.h:116
CMD_SNIPPETDOC
@ CMD_SNIPPETDOC
Definition: cmdmapper.h:137
XML_EXAMPLE
@ XML_EXAMPLE
Definition: cmdmapper.h:195
CMD_ANCHOR
@ CMD_ANCHOR
Definition: cmdmapper.h:32
CMD_PAR
@ CMD_PAR
Definition: cmdmapper.h:71
CMD_INCWITHLINES
@ CMD_INCWITHLINES
Definition: cmdmapper.h:106
HTML_H6
@ HTML_H6
Definition: cmdmapper.h:180
qcstring.h
CMD_LINE
@ CMD_LINE
Definition: cmdmapper.h:67
CMD_MSC
@ CMD_MSC
Definition: cmdmapper.h:102
CMD_INVARIANT
@ CMD_INVARIANT
Definition: cmdmapper.h:63
HTML_SUP
@ HTML_SUP
Definition: cmdmapper.h:159
HTML_CAPTION
@ HTML_CAPTION
Definition: cmdmapper.h:153
CMD_ENDSECREFLIST
@ CMD_ENDSECREFLIST
Definition: cmdmapper.h:50
Mapper::Mapper
Mapper(const CommandMap *cm, bool caseSensitive)
Definition: cmdmapper.cpp:256
CMD_DIAFILE
@ CMD_DIAFILE
Definition: cmdmapper.h:126
XML_TERM
@ XML_TERM
Definition: cmdmapper.h:210
HTML_SUB
@ HTML_SUB
Definition: cmdmapper.h:158
CMD_SA
@ CMD_SA
Definition: cmdmapper.h:81
XML_PARAMREF
@ XML_PARAMREF
Definition: cmdmapper.h:203
CMD_WARNING
@ CMD_WARNING
Definition: cmdmapper.h:97
CMD_COPYDETAILS
@ CMD_COPYDETAILS
Definition: cmdmapper.h:110
CMD_REMARK
@ CMD_REMARK
Definition: cmdmapper.h:78
Mapper
Class representing a mapping from command names to command IDs.
Definition: cmdmapper.h:219
CMD_SNIPWITHLINES
@ CMD_SNIPWITHLINES
Definition: cmdmapper.h:138
HTML_IMG
@ HTML_IMG
Definition: cmdmapper.h:156
HTML_P
@ HTML_P
Definition: cmdmapper.h:174
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
HTML_DL
@ HTML_DL
Definition: cmdmapper.h:168
CMD_HASH
@ CMD_HASH
Definition: cmdmapper.h:56
CMD_MANONLY
@ CMD_MANONLY
Definition: cmdmapper.h:104
CommandMap
Call representing a mapping from a command name to a command ID.
Definition: cmdmapper.cpp:19
XML_TYPEPARAMREF
@ XML_TYPEPARAMREF
Definition: cmdmapper.h:212
XML_CmdMask
@ XML_CmdMask
Definition: cmdmapper.h:190
CMD_PIPE
@ CMD_PIPE
Definition: cmdmapper.h:119
CMD_ATTENTION
@ CMD_ATTENTION
Definition: cmdmapper.h:34
HTML_S
@ HTML_S
Definition: cmdmapper.h:188
CMD_PARAM
@ CMD_PARAM
Definition: cmdmapper.h:72
CMD_INCLUDEDOC
@ CMD_INCLUDEDOC
Definition: cmdmapper.h:136
CMD_INHERITDOC
@ CMD_INHERITDOC
Definition: cmdmapper.h:107
CMD_STARTUML
@ CMD_STARTUML
Definition: cmdmapper.h:130
CMD_VERBINCLUDE
@ CMD_VERBINCLUDE
Definition: cmdmapper.h:95
HTML_STRIKE
@ HTML_STRIKE
Definition: cmdmapper.h:184
XML_INHERITDOC
@ XML_INHERITDOC
Definition: cmdmapper.h:214
CMD_GREATER
@ CMD_GREATER
Definition: cmdmapper.h:55
CMD_RETVAL
@ CMD_RETVAL
Definition: cmdmapper.h:80
Mapper::m_cs
bool m_cs
Definition: cmdmapper.h:227
CMD_HTMLONLY
@ CMD_HTMLONLY
Definition: cmdmapper.h:58
HTML_DD
@ HTML_DD
Definition: cmdmapper.h:170
SIMPLESECT_BIT
const int SIMPLESECT_BIT
Definition: cmdmapper.h:25
CMD_XMLINCLUDE
@ CMD_XMLINCLUDE
Definition: cmdmapper.h:144
CMD_DATE
@ CMD_DATE
Definition: cmdmapper.h:41
CMD_AUTHOR
@ CMD_AUTHOR
Definition: cmdmapper.h:35
CMD_IMAGE
@ CMD_IMAGE
Definition: cmdmapper.h:59
HTML_DT
@ HTML_DT
Definition: cmdmapper.h:169
CMD_CODE
@ CMD_CODE
Definition: cmdmapper.h:39
CMD_SINCE
@ CMD_SINCE
Definition: cmdmapper.h:88
HTML_BLOCKQUOTE
@ HTML_BLOCKQUOTE
Definition: cmdmapper.h:183
CMD_ILINE
@ CMD_ILINE
Definition: cmdmapper.h:145
CMD_ENDPARBLOCK
@ CMD_ENDPARBLOCK
Definition: cmdmapper.h:125
HTML_TD
@ HTML_TD
Definition: cmdmapper.h:161
CMD_HTMLINCLUDE
@ CMD_HTMLINCLUDE
Definition: cmdmapper.h:57
CMD_INTERNALREF
@ CMD_INTERNALREF
Definition: cmdmapper.h:62
HTML_OL
@ HTML_OL
Definition: cmdmapper.h:163
XML_LIST
@ XML_LIST
Definition: cmdmapper.h:199
HTML_CENTER
@ HTML_CENTER
Definition: cmdmapper.h:151
CMD_REF
@ CMD_REF
Definition: cmdmapper.h:76
CMD_MDASH
@ CMD_MDASH
Definition: cmdmapper.h:129
CMD_MSCFILE
@ CMD_MSCFILE
Definition: cmdmapper.h:112
HTML_H1
@ HTML_H1
Definition: cmdmapper.h:175
CMD_DOTFILE
@ CMD_DOTFILE
Definition: cmdmapper.h:44
CMD_UNTIL
@ CMD_UNTIL
Definition: cmdmapper.h:93
CMD_ENDHTMLONLY
@ CMD_ENDHTMLONLY
Definition: cmdmapper.h:47
CMD_PARBLOCK
@ CMD_PARBLOCK
Definition: cmdmapper.h:124
CMD_ADDINDEX
@ CMD_ADDINDEX
Definition: cmdmapper.h:30
CMD_SECREFLIST
@ CMD_SECREFLIST
Definition: cmdmapper.h:82
CMD_XMLONLY
@ CMD_XMLONLY
Definition: cmdmapper.h:99
CMD_PERCENT
@ CMD_PERCENT
Definition: cmdmapper.h:73
HTML_DEL
@ HTML_DEL
Definition: cmdmapper.h:187
Mappers::freeMappers
static void freeMappers()
Definition: cmdmapper.cpp:266
CMD_PUNT
@ CMD_PUNT
Definition: cmdmapper.h:133
CMD_LINEBREAK
@ CMD_LINEBREAK
Definition: cmdmapper.h:68
CMD_JAVALINK
@ CMD_JAVALINK
Definition: cmdmapper.h:92
XML_CODE
@ XML_CODE
Definition: cmdmapper.h:193
HTML_TABLE
@ HTML_TABLE
Definition: cmdmapper.h:152
XML_ITEM
@ XML_ITEM
Definition: cmdmapper.h:198
CMD_QUOTE
@ CMD_QUOTE
Definition: cmdmapper.h:111
CMD_SUBPAGE
@ CMD_SUBPAGE
Definition: cmdmapper.h:84
HTML_EMPHASIS
@ HTML_EMPHASIS
Definition: cmdmapper.h:166
XML_LISTHEADER
@ XML_LISTHEADER
Definition: cmdmapper.h:200
HTML_UL
@ HTML_UL
Definition: cmdmapper.h:164
HTML_A
@ HTML_A
Definition: cmdmapper.h:172
XML_TYPEPARAM
@ XML_TYPEPARAM
Definition: cmdmapper.h:211
CMD_PLUS
@ CMD_PLUS
Definition: cmdmapper.h:134
CMD_MANINCLUDE
@ CMD_MANINCLUDE
Definition: cmdmapper.h:143
CMD_AMP
@ CMD_AMP
Definition: cmdmapper.h:31
CMD_SECREFITEM
@ CMD_SECREFITEM
Definition: cmdmapper.h:77
CMD_NOTE
@ CMD_NOTE
Definition: cmdmapper.h:70
XML_DESCRIPTION
@ XML_DESCRIPTION
Definition: cmdmapper.h:194
HTML_HR
@ HTML_HR
Definition: cmdmapper.h:167
HTML_DIV
@ HTML_DIV
Definition: cmdmapper.h:182
CMD_PARAGRAPH
@ CMD_PARAGRAPH
Definition: cmdmapper.h:87
CMD_DOT
@ CMD_DOT
Definition: cmdmapper.h:100
CMD_DBONLY
@ CMD_DBONLY
Definition: cmdmapper.h:121
XML_PARAM
@ XML_PARAM
Definition: cmdmapper.h:202
CMD_DCOLON
@ CMD_DCOLON
Definition: cmdmapper.h:113
CMD_ENDINTERNAL
@ CMD_ENDINTERNAL
Definition: cmdmapper.h:123
CMD_SKIPLINE
@ CMD_SKIPLINE
Definition: cmdmapper.h:90
CommandType
CommandType
Definition: cmdmapper.h:27
CMD_EMOJI
@ CMD_EMOJI
Definition: cmdmapper.h:139
HTML_TR
@ HTML_TR
Definition: cmdmapper.h:160
CMD_MINUS
@ CMD_MINUS
Definition: cmdmapper.h:135
Mappers::cmdMapper
static Mapper * cmdMapper
Definition: cmdmapper.h:234
CMD_ENDLATEXONLY
@ CMD_ENDLATEXONLY
Definition: cmdmapper.h:48
CMD_ENDUML
@ CMD_ENDUML
Definition: cmdmapper.h:131
CMD_RETURN
@ CMD_RETURN
Definition: cmdmapper.h:79
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
CMD_RTFONLY
@ CMD_RTFONLY
Definition: cmdmapper.h:117
HtmlTagType
HtmlTagType
Definition: cmdmapper.h:148
CMD_VHDLFLOW
@ CMD_VHDLFLOW
Definition: cmdmapper.h:120
HTML_H3
@ HTML_H3
Definition: cmdmapper.h:177
HTML_BOLD
@ HTML_BOLD
Definition: cmdmapper.h:173
XML_C
@ XML_C
Definition: cmdmapper.h:192
XML_INCLUDE
@ XML_INCLUDE
Definition: cmdmapper.h:197
CMD_EXCEPTION
@ CMD_EXCEPTION
Definition: cmdmapper.h:53
HTML_INS
@ HTML_INS
Definition: cmdmapper.h:186
CMD_COPYBRIEF
@ CMD_COPYBRIEF
Definition: cmdmapper.h:109
CMD_LATEXINCLUDE
@ CMD_LATEXINCLUDE
Definition: cmdmapper.h:127
CMD_NDASH
@ CMD_NDASH
Definition: cmdmapper.h:128
CMD_VERBATIM
@ CMD_VERBATIM
Definition: cmdmapper.h:94
CMD_SKIP
@ CMD_SKIP
Definition: cmdmapper.h:89
HTML_UNKNOWN
@ HTML_UNKNOWN
Definition: cmdmapper.h:150
CMD_SUBSUBSECTION
@ CMD_SUBSUBSECTION
Definition: cmdmapper.h:86
CMD_RTFINCLUDE
@ CMD_RTFINCLUDE
Definition: cmdmapper.h:141
XML_EXCEPTION
@ XML_EXCEPTION
Definition: cmdmapper.h:196
HTML_H2
@ HTML_H2
Definition: cmdmapper.h:176
HTML_SPAN
@ HTML_SPAN
Definition: cmdmapper.h:181
XML_SEEALSO
@ XML_SEEALSO
Definition: cmdmapper.h:208
CMD_DOCBOOKINCLUDE
@ CMD_DOCBOOKINCLUDE
Definition: cmdmapper.h:142
Mapper::m_map
std::map< std::string, int > m_map
Definition: cmdmapper.h:226
CMD_ENDLINK
@ CMD_ENDLINK
Definition: cmdmapper.h:49
HTML_TH
@ HTML_TH
Definition: cmdmapper.h:162
CMD_TPARAM
@ CMD_TPARAM
Definition: cmdmapper.h:108
CMD_XREFITEM
@ CMD_XREFITEM
Definition: cmdmapper.h:98
HTML_BR
@ HTML_BR
Definition: cmdmapper.h:171
XML_PERMISSION
@ XML_PERMISSION
Definition: cmdmapper.h:204
CMD_DONTINCLUDE
@ CMD_DONTINCLUDE
Definition: cmdmapper.h:43
CMD_INCLUDE
@ CMD_INCLUDE
Definition: cmdmapper.h:60
CMD_EQUAL
@ CMD_EQUAL
Definition: cmdmapper.h:140
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108