Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/cmdmapper.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 *
4 *
5 *
6 * Copyright (C) 1997-2011 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
24struct CommandMap
25{
26 const char *cmdName;
27 int cmdId;
28};
29
30const int SIMPLESECT_BIT = 0x1000;
31
32enum CommandType
33{
34 CMD_UNKNOWN = 0,
35 CMD_ADDINDEX = 1,
36 CMD_AMP = 2,
37 CMD_ANCHOR = 3,
38 CMD_AT = 4,
39 CMD_ATTENTION = 5 | SIMPLESECT_BIT,
40 CMD_AUTHOR = 6 | SIMPLESECT_BIT,
41 CMD_AUTHORS = 7 | SIMPLESECT_BIT,
42 CMD_BOLD = 8,
43 CMD_BSLASH = 9,
44 CMD_CODE = 10,
45 CMD_COPYDOC = 11,
46 CMD_DATE = 12 | SIMPLESECT_BIT,
47 CMD_DOLLAR = 13,
48 CMD_DONTINCLUDE = 14,
49 CMD_DOTFILE = 15,
50 CMD_EMPHASIS = 16,
51 CMD_ENDCODE = 17,
52 CMD_ENDHTMLONLY = 18,
53 CMD_ENDLATEXONLY = 19,
54 CMD_ENDLINK = 20,
55 CMD_ENDSECREFLIST= 21,
56 CMD_ENDVERBATIM = 22,
57 CMD_ENDXMLONLY = 23,
58 CMD_EXCEPTION = 24 | SIMPLESECT_BIT,
59 CMD_FORMULA = 25,
60 CMD_GREATER = 26,
61 CMD_HASH = 27,
62 CMD_HTMLINCLUDE = 28,
63 CMD_HTMLONLY = 29,
64 CMD_IMAGE = 30,
65 CMD_INCLUDE = 31,
66 CMD_INTERNAL = 32,
67 CMD_INTERNALREF = 33,
68 CMD_INVARIANT = 34 | SIMPLESECT_BIT ,
69 CMD_LATEXONLY = 35,
70 CMD_LESS = 36,
71 CMD_LI = 37,
72 CMD_LINE = 38,
73 CMD_LINEBREAK = 39,
74 CMD_LINK = 40,
75 CMD_NOTE = 41 | SIMPLESECT_BIT,
76 CMD_PAR = 42 | SIMPLESECT_BIT,
77 CMD_PARAM = 43 | SIMPLESECT_BIT,
78 CMD_PERCENT = 44,
79 CMD_POST = 45 | SIMPLESECT_BIT,
80 CMD_PRE = 46 | SIMPLESECT_BIT ,
81 CMD_REF = 47,
82 CMD_SECREFITEM = 48,
83 CMD_REMARK = 49 | SIMPLESECT_BIT ,
84 CMD_RETURN = 50 | SIMPLESECT_BIT ,
85 CMD_RETVAL = 51 | SIMPLESECT_BIT,
86 CMD_SA = 52 | SIMPLESECT_BIT ,
87 CMD_SECREFLIST = 53,
88 CMD_SECTION = 54,
89 CMD_SUBPAGE = 55,
90 CMD_SUBSECTION = 56,
91 CMD_SUBSUBSECTION= 57,
92 CMD_PARAGRAPH = 58,
93 CMD_SINCE = 59 | SIMPLESECT_BIT,
94 CMD_SKIP = 60,
95 CMD_SKIPLINE = 61,
96 CMD_STARTCODE = 62,
97 CMD_JAVALINK = 63,
98 CMD_UNTIL = 64,
99 CMD_VERBATIM = 65,
100 CMD_VERBINCLUDE = 66,
101 CMD_VERSION = 67 | SIMPLESECT_BIT,
102 CMD_WARNING = 68 | SIMPLESECT_BIT,
103 CMD_XREFITEM = 69 | SIMPLESECT_BIT,
104 CMD_XMLONLY = 70,
105 CMD_DOT = 71,
106 CMD_ENDDOT = 72,
107 CMD_MSC = 73,
108 CMD_ENDMSC = 74,
109 CMD_MANONLY = 75,
110 CMD_ENDMANONLY = 76,
111 CMD_INCWITHLINES = 77,
112 CMD_INHERITDOC = 78,
113 CMD_TPARAM = 79 | SIMPLESECT_BIT,
114 CMD_COPYBRIEF = 80,
115 CMD_COPYDETAILS = 81,
116 CMD_QUOTE = 82,
117 CMD_MSCFILE = 83,
118 CMD_DCOLON = 84
119};
120
121enum HtmlTagType
122{
123 HTML_UNKNOWN = 0,
124 HTML_CENTER = 1,
125 HTML_TABLE = 2,
126 HTML_CAPTION = 3,
127 HTML_SMALL = 4,
128 HTML_CODE = 5,
129 HTML_IMG = 6,
130 HTML_PRE = 7,
131 HTML_SUB = 8,
132 HTML_SUP = 9,
133 HTML_TR = 10,
134 HTML_TD = 11,
135 HTML_TH = 12,
136 HTML_OL = 13,
137 HTML_UL = 14,
138 HTML_LI = 15,
139 HTML_EMPHASIS = 16,
140 HTML_HR = 17,
141 HTML_DL = 18,
142 HTML_DT = 19,
143 HTML_DD = 20,
144 HTML_BR = 21,
145 HTML_A = 22,
146 HTML_BOLD = 23,
147 HTML_P = 24,
148 HTML_H1 = 25,
149 HTML_H2 = 26,
150 HTML_H3 = 27,
151 HTML_H4 = 28,
152 HTML_H5 = 29,
153 HTML_H6 = 30,
154 HTML_SPAN = 31,
155 HTML_DIV = 32,
156
157 XML_CmdMask = 0x100,
158
159 XML_C = XML_CmdMask + 0,
160 XML_CODE = XML_CmdMask + 1,
161 XML_DESCRIPTION = XML_CmdMask + 2,
162 XML_EXAMPLE = XML_CmdMask + 3,
163 XML_EXCEPTION = XML_CmdMask + 4,
164 XML_INCLUDE = XML_CmdMask + 5,
165 XML_ITEM = XML_CmdMask + 6,
166 XML_LIST = XML_CmdMask + 7,
167 XML_LISTHEADER = XML_CmdMask + 8,
168 XML_PARA = XML_CmdMask + 9,
169 XML_PARAM = XML_CmdMask + 10,
170 XML_PARAMREF = XML_CmdMask + 11,
171 XML_PERMISSION = XML_CmdMask + 12,
172 XML_REMARKS = XML_CmdMask + 13,
173 XML_RETURNS = XML_CmdMask + 14,
174 XML_SEE = XML_CmdMask + 15,
175 XML_SEEALSO = XML_CmdMask + 16,
176 XML_SUMMARY = XML_CmdMask + 17,
177 XML_TERM = XML_CmdMask + 18,
178 XML_TYPEPARAM = XML_CmdMask + 19,
179 XML_TYPEPARAMREF = XML_CmdMask + 20,
180 XML_VALUE = XML_CmdMask + 21
181};
182
183class Mapper
184{
185 public:
186 int map(const char *n)
187 {
188 QCString name=n;
189 if (!m_cs) name=name.lower();
190 int *result;
191 return !name.isEmpty() && (result=m_map.find(name)) ? *result: 0;
192 }
193
194 Mapper(const CommandMap *cm,bool caseSensitive) : m_map(89), m_cs(caseSensitive)
195 {
196 m_map.setAutoDelete(TRUE);
197 const CommandMap *p = cm;
198 while (p->cmdName)
199 {
200 m_map.insert(p->cmdName,new int(p->cmdId));
201 p++;
202 }
203 }
204 private:
205 QDict<int> m_map;
206 bool m_cs;
207};
208
209struct Mappers
210{
211 static void freeMappers();
212 static Mapper *cmdMapper;
213 static Mapper *htmlTagMapper;
214};
215
216
217#endif
218

Archive Download this file

Revision: 1322