Doxygen
Loading...
Searching...
No Matches
types.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
16#ifndef TYPES_H
17#define TYPES_H
18
19#include "qcstring.h"
20
21/** @file
22 * @brief This file contains a number of basic enums and types.
23 */
24
25/** Protection level of members */
26#define PROTECTION_SPECIFICATIONS \
27 PROTSPEC(Public,public,public) \
28 PROTSPEC(Protected,protected,protected) \
29 PROTSPEC(Private,private,private) \
30 PROTSPEC(Package,package,protected)
31
32enum class Protection {
33#define PROTSPEC(x,y,z) x,
35#undef PROTSPEC
36};
37
38[[maybe_unused]] static const char *to_string(Protection prot)
39{
40 const char *result = "ERROR";
41 switch (prot)
42 {
43#define PROTSPEC(x,y,z) case Protection::x: result = #x; break;
45#undef PROTSPEC
46 }
47 return result;
48}
49
50[[maybe_unused]] static const char *to_string_lower(Protection prot)
51{
52 const char *result = "error";
53 switch (prot)
54 {
55#define PROTSPEC(x,y,z) case Protection::x: result = #y; break;
57#undef PROTSPEC
58 }
59 return result;
60}
61
62[[maybe_unused]] static const char *to_string_lower_class(Protection prot)
63{
64 const char *result = "error";
65 switch (prot)
66 {
67#define PROTSPEC(x,y,z) case Protection::x: result = #z; break;
69#undef PROTSPEC
70 }
71 return result;
72}
73
74/** Virtualness of a member. */
75#define SPECIFIER_SPECIFICATIONS \
76 SPECSPEC(Normal,non-virtual) \
77 SPECSPEC(Virtual,virtual) \
78 SPECSPEC(Pure,pure-virtual)
79
80enum class Specifier {
81#define SPECSPEC(x,y) x,
83#undef SPECSPEC
84};
85
86[[maybe_unused]] static const char *to_string(Specifier spec)
87{
88 const char *result = "ERROR";
89 switch (spec)
90 {
91#define SPECSPEC(x,y) case Specifier::x: result = #x; break;
93#undef SPECSPEC
94 }
95 return result;
96}
97
98[[maybe_unused]] static const char *to_string_lower(Specifier spec)
99{
100 const char *result = "error";
101 switch (spec)
102 {
103#define SPECSPEC(x,y) case Specifier::x: result = #y; break;
105#undef SPECSPEC
106 }
107 return result;
108}
109
110/** Kind of method */
111#define METHODTYPE_SPECIFICATIONS \
112 MTSPEC(Method) \
113 MTSPEC(Signal) \
114 MTSPEC(Slot) \
115 MTSPEC(DCOP) \
116 MTSPEC(Property) \
117 MTSPEC(Event)
118
119enum class MethodTypes {
120#define MTSPEC(x) x,
122#undef MTSPEC
123};
124
125[[maybe_unused]] static const char *to_string(MethodTypes mt)
126{
127 const char *result = "ERROR";
128 switch (mt)
129 {
130#define MTSPEC(x) case MethodTypes::x: result = #x; break;
132#undef MTSPEC
133 }
134 return result;
135}
136
137/** Type of member relation */
138#define RELATESTYPE_SPECIFICATIONS \
139 RTSPEC(Simple) \
140 RTSPEC(Duplicate) \
141 RTSPEC(MemberOf)
142
143enum class RelatesType {
144#define RTSPEC(x) x,
146#undef RTSPEC
147};
148
149[[maybe_unused]] static const char *to_string(RelatesType rt)
150{
151 const char *result = "ERROR";
152 switch (rt)
153 {
154#define RTSPEC(x) case RelatesType::x: result = #x; break;
156#undef RTSPEC
157 }
158 return result;
159}
160
161/** Kind of member relationship */
162#define RELATIONSHIP_SPECIFICATIONS \
163 RSSPEC(Member) \
164 RSSPEC(Related) \
165 RSSPEC(Foreign)
166
167enum class Relationship {
168#define RSSPEC(x) x,
170#undef RSSPEC
171};
172
173[[maybe_unused]] static const char *to_string(Relationship rs)
174{
175 const char *result = "ERROR";
176 switch (rs)
177 {
178#define RSSPEC(x) case Relationship::x: result = #x; break;
180#undef RSSPEC
181 }
182 return result;
183}
184
185/** Language as given by extension */
186#define SRCLANGEXT_SPECIFICATIONS \
187 SRCLANGEXT(Unknown , 0x00000, Unknown) \
188 SRCLANGEXT(IDL , 0x00008, IDL) \
189 SRCLANGEXT(Java , 0x00010, Java) \
190 SRCLANGEXT(CSharp , 0x00020, C#) \
191 SRCLANGEXT(D , 0x00040, D) \
192 SRCLANGEXT(PHP , 0x00080, PHP) \
193 SRCLANGEXT(ObjC , 0x00100, Objective-C) \
194 SRCLANGEXT(Cpp , 0x00200, C++) \
195 SRCLANGEXT(JS , 0x00400, Javascript) \
196 SRCLANGEXT(Python , 0x00800, Python) \
197 SRCLANGEXT(Fortran , 0x01000, Fortran) \
198 SRCLANGEXT(VHDL , 0x02000, VHDL) \
199 SRCLANGEXT(XML , 0x04000, XML) \
200 SRCLANGEXT(Markdown , 0x10000, Markdown) \
201 SRCLANGEXT(SQL , 0x20000, SQL) \
202 SRCLANGEXT(Slice , 0x40000, Slice) \
203 SRCLANGEXT(Lex , 0x80000, Lex)
204
205 /* SRCLANGEXT(Tcl , 0x08000, Tcl ) // no longer supported */
206
207enum class SrcLangExt {
208#define SRCLANGEXT(x, v, z) x = v,
210#undef SRCLANGEXT
211};
212
213[[maybe_unused]] static const char *to_string(SrcLangExt sle)
214{
215 const char *result = "ERROR";
216 switch (sle)
217 {
218#define SRCLANGEXT(x,v,z) case SrcLangExt::x: result = #z; break;
220#undef SRCLANGEXT
221 }
222 return result;
223}
224
225/** Grouping info */
227{
228 /** Grouping priority */
230 {
232 GROUPING_AUTO_WEAK = GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup
233 GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group
234 GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup
236 GROUPING_INGROUP, //!< membership in group was defined by \@ingroup
238 };
239
240 static const char *getGroupPriName( GroupPri_t priority )
241 {
242 switch( priority )
243 {
245 return "@weakgroup";
247 return "@addtogroup";
249 return "@defgroup";
250 case GROUPING_INGROUP:
251 return "@ingroup";
252 }
253 return "???";
254 }
255
256 Grouping( const QCString &gn, GroupPri_t p ) : groupname(gn), pri(p) {}
257 QCString groupname; //!< name of the group
258 GroupPri_t pri; //!< priority of this definition
259
260};
261
262// enum name category to-public to-protected html-label xml-label
263#define ML_TYPES \
264 ML_TYPE(PubMethods, Public, Invalid, Invalid, "pub-methods", "public-func" ) \
265 ML_TYPE(ProMethods, Protected, PubMethods, Invalid, "pro-methods", "protected-func" ) \
266 ML_TYPE(PacMethods, Package, Invalid, Invalid, "pac-methods", "package-func" ) \
267 ML_TYPE(PriMethods, Private, PubMethods, ProMethods, "pri-methods", "private-func" ) \
268 ML_TYPE(PubStaticMethods, Public, Invalid, Invalid, "pub-static-methods", "public-static-func" ) \
269 ML_TYPE(ProStaticMethods, Protected, PubStaticMethods, Invalid, "pro-static-methods", "protected-static-func" ) \
270 ML_TYPE(PacStaticMethods, Package, Invalid, Invalid, "pac-static-methods", "package-static-func" ) \
271 ML_TYPE(PriStaticMethods, Private, PubStaticMethods, ProStaticMethods, "pri-static-methods", "private-static-func" ) \
272 ML_TYPE(PubSlots, Public, Invalid, Invalid, "pub-slots", "public-slot" ) \
273 ML_TYPE(ProSlots, Protected, PubSlots, Invalid, "pro-slots", "protected-slot" ) \
274 ML_TYPE(PriSlots, Private, PubSlots, ProSlots, "pri-slots", "private-slot" ) \
275 ML_TYPE(PubAttribs, Public, Invalid, Invalid, "pub-attribs", "public-attrib" ) \
276 ML_TYPE(ProAttribs, Protected, PubAttribs, Invalid, "pro-attribs", "protected-attrib" ) \
277 ML_TYPE(PacAttribs, Package, Invalid, Invalid, "pac-attribs", "package-attrib" ) \
278 ML_TYPE(PriAttribs, Private, PubAttribs, ProAttribs, "pri-attribs", "private-attrib" ) \
279 ML_TYPE(PubStaticAttribs, Public, Invalid, Invalid, "pub-static-attribs", "public-static-attrib" ) \
280 ML_TYPE(ProStaticAttribs, Protected, PubStaticAttribs, Invalid, "pro-static-attribs", "protected-static-attrib" ) \
281 ML_TYPE(PacStaticAttribs, Package, Invalid, Invalid, "pac-static-attribs", "package-static-attrib" ) \
282 ML_TYPE(PriStaticAttribs, Private, PubStaticAttribs, ProStaticAttribs, "pri-static-attribs", "private-static-attrib" ) \
283 ML_TYPE(PubTypes, Public, Invalid, Invalid, "pub-types", "public-type" ) \
284 ML_TYPE(ProTypes, Protected, PubTypes, Invalid, "pro-types", "protected-type" ) \
285 ML_TYPE(PacTypes, Package, Invalid, Invalid, "pac-types", "package-type" ) \
286 ML_TYPE(PriTypes, Private, PubTypes, ProTypes, "pri-types", "private-type" ) \
287 ML_TYPE(Related, OnlyPublic, Invalid, Invalid, "related", "related" ) \
288 ML_TYPE(Signals, OnlyPublic, Invalid, Invalid, "signals", "signal" ) \
289 ML_TYPE(Friends, OnlyPublic, Invalid, Invalid, "friends", "friend" ) \
290 ML_TYPE(DcopMethods, OnlyPublic, Invalid, Invalid, "dcop-methods", "dcop-func" ) \
291 ML_TYPE(Properties, OnlyPublic, Invalid, Invalid, "properties", "property" ) \
292 ML_TYPE(Events, OnlyPublic, Invalid, Invalid, "events", "event" ) \
293 ML_TYPE(AllMembersList, OnlyPublic, Invalid, Invalid, "", "" ) \
294 ML_TYPE(EnumFields, OnlyPublic, Invalid, Invalid, "enum-fields", "" ) \
295 ML_TYPE(MemberGroup, OnlyPublic, Invalid, Invalid, "", "" ) \
296 ML_TYPE(Interfaces, OnlyPublic, Invalid, Invalid, "interfaces", "interfaces" ) \
297 ML_TYPE(Services, OnlyPublic, Invalid, Invalid, "services", "services" ) \
298 ML_TYPE(DecDefineMembers, Declaration, Invalid, Invalid, "define-members", "define" ) \
299 ML_TYPE(DecProtoMembers, Declaration, Invalid, Invalid, "proto-members", "prototype" ) \
300 ML_TYPE(DecTypedefMembers, Declaration, Invalid, Invalid, "typedef-members", "typedef" ) \
301 ML_TYPE(DecEnumMembers, Declaration, Invalid, Invalid, "enum-members", "enum" ) \
302 ML_TYPE(DecFuncMembers, Declaration, Invalid, Invalid, "func-members", "func" ) \
303 ML_TYPE(DecVarMembers, Declaration, Invalid, Invalid, "var-members", "var" ) \
304 ML_TYPE(DecEnumValMembers, Declaration, Invalid, Invalid, "enumval-members", "" ) \
305 ML_TYPE(DecPubSlotMembers, Declaration, Invalid, Invalid, "pub-slot-members", "" ) \
306 ML_TYPE(DecProSlotMembers, Declaration, Invalid, Invalid, "pro-slot-members", "" ) \
307 ML_TYPE(DecPriSlotMembers, Declaration, Invalid, Invalid, "pri-slot-members", "" ) \
308 ML_TYPE(DecSignalMembers, Declaration, Invalid, Invalid, "signal-members", "" ) \
309 ML_TYPE(DecEventMembers, Declaration, Invalid, Invalid, "event-members", "" ) \
310 ML_TYPE(DecFriendMembers, Declaration, Invalid, Invalid, "friend-members", "" ) \
311 ML_TYPE(DecPropMembers, Declaration, Invalid, Invalid, "prop-members", "" ) \
312 ML_TYPE(DecSequenceMembers, Declaration, Invalid, Invalid, "sequence-members", "sequence" ) \
313 ML_TYPE(DecDictionaryMembers,Declaration, Invalid, Invalid, "dictionary-members", "dictionary" ) \
314 ML_TYPE(TypedefMembers, Detailed, Invalid, Invalid, "", "" ) \
315 ML_TYPE(EnumMembers, Detailed, Invalid, Invalid, "", "" ) \
316 ML_TYPE(EnumValMembers, Detailed, Invalid, Invalid, "", "" ) \
317 ML_TYPE(FunctionMembers, Detailed, Invalid, Invalid, "", "" ) \
318 ML_TYPE(RelatedMembers, Detailed, Invalid, Invalid, "", "" ) \
319 ML_TYPE(VariableMembers, Detailed, Invalid, Invalid, "", "" ) \
320 ML_TYPE(PropertyMembers, Detailed, Invalid, Invalid, "", "" ) \
321 ML_TYPE(EventMembers, Detailed, Invalid, Invalid, "", "" ) \
322 ML_TYPE(Constructors, Detailed, Invalid, Invalid, "", "" ) \
323 ML_TYPE(InterfaceMembers, Detailed, Invalid, Invalid, "interface-members", "" ) \
324 ML_TYPE(ServiceMembers, Detailed, Invalid, Invalid, "service-members", "" ) \
325 ML_TYPE(DocDefineMembers, Documentation,Invalid, Invalid, "", "" ) \
326 ML_TYPE(DocProtoMembers, Documentation,Invalid, Invalid, "", "" ) \
327 ML_TYPE(DocTypedefMembers, Documentation,Invalid, Invalid, "", "" ) \
328 ML_TYPE(DocEnumMembers, Documentation,Invalid, Invalid, "", "" ) \
329 ML_TYPE(DocFuncMembers, Documentation,Invalid, Invalid, "", "" ) \
330 ML_TYPE(DocVarMembers, Documentation,Invalid, Invalid, "", "" ) \
331 ML_TYPE(DocEnumValMembers, Documentation,Invalid, Invalid, "", "" ) \
332 ML_TYPE(DocPubSlotMembers, Documentation,Invalid, Invalid, "", "" ) \
333 ML_TYPE(DocProSlotMembers, Documentation,Invalid, Invalid, "", "" ) \
334 ML_TYPE(DocPriSlotMembers, Documentation,Invalid, Invalid, "", "" ) \
335 ML_TYPE(DocSignalMembers, Documentation,Invalid, Invalid, "", "" ) \
336 ML_TYPE(DocEventMembers, Documentation,Invalid, Invalid, "", "" ) \
337 ML_TYPE(DocFriendMembers, Documentation,Invalid, Invalid, "", "" ) \
338 ML_TYPE(DocPropMembers, Documentation,Invalid, Invalid, "", "" ) \
339 ML_TYPE(DocSequenceMembers, Documentation,Invalid, Invalid, "", "" ) \
340 ML_TYPE(DocDictionaryMembers,Documentation,Invalid, Invalid, "", "" ) \
341
342/** Wrapper class for the MemberListType type. Can be set only during construction.
343 * Packs the type together with category flags.
344 */
346{
348 {
349 Public = (1<<16),
350 Protected = (1<<17),
351 Package = (1<<18),
352 Private = (1<<19),
353 OnlyPublic = (1<<20),
354 Detailed = (1<<21),
355 Declaration = (1<<22),
356 Documentation = (1<<23),
357 TypeMask = 0x0000FFFF,
358 CategoryMask = 0xFFFF0000
359 };
360
362 {
364#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
365 x##_,
367#undef ML_TYPE
368 };
369
370 public:
372 constexpr bool isInvalid() const { return m_type==Invalid_; }
373#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
374 static MemberListType x() { return MemberListType(static_cast<int>(x##_)|static_cast<int>(bits)); } \
375 bool is##x() const { return (m_type&TypeMask)==x##_; }
377#undef ML_TYPE
378 constexpr bool isPublic() const { return (m_type & Public)!=0; }
379 constexpr bool isOnlyPublic() const { return (m_type & OnlyPublic)!=0; }
380 constexpr bool isProtected() const { return (m_type & Protected)!=0; }
381 constexpr bool isPackage() const { return (m_type & Package)!=0; }
382 constexpr bool isPrivate() const { return (m_type & Private)!=0; }
383 constexpr bool isDetailed() const { return (m_type & Detailed)!=0; }
384 constexpr bool isDeclaration() const { return (m_type & Declaration)!=0; }
385 constexpr bool isDocumentation() const { return (m_type & Documentation)!=0; }
386 std::string to_string() const
387 {
388 switch (type())
389 {
390 case Invalid_: return "[Invalid]";
391#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
392 case x##_ : return "["+std::string(#x)+bits_to_string()+"]";
394#undef ML_TYPE
395 }
396 return "[unknown]";
397 }
398 int to_int() const
399 {
400 return m_type!=Invalid_ ? m_type&TypeMask : -1;
401 }
402 constexpr const char *toLabel() const
403 {
404 switch (type())
405 {
406 case Invalid_: return "";
407#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
408 case x##_ : return label;
410#undef ML_TYPE
411 }
412 return "";
413 }
414 constexpr const char *toXML() const
415 {
416 switch (type())
417 {
418 case Invalid_: return "";
419#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
420 case x##_ : return xml_str;
422#undef ML_TYPE
423 }
424 return "";
425 }
427 {
428 switch (type())
429 {
430 case Invalid_: return Invalid();
431#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
432 case x##_ : return to_pub();
434#undef ML_TYPE
435 }
436 return Invalid();
437 }
439 {
440 switch (type())
441 {
442 case Invalid_: return Invalid();
443#define ML_TYPE(x,bits,to_pub,to_prot,label,xml_str) \
444 case x##_ : return to_prot();
446#undef ML_TYPE
447 }
448 return Invalid();
449 }
450 friend inline bool operator==(const MemberListType &t1,const MemberListType &t2) { return t1.m_type==t2.m_type; }
451 friend inline bool operator!=(const MemberListType &t1,const MemberListType &t2) { return !(operator==(t1,t2)); }
452
453 private:
454 explicit MemberListType(int t) : m_type(t) {}
455 std::string bits_to_string() const
456 {
457 std::string result;
458 if (m_type&Public) result+=",Public";
459 if (m_type&Protected) result+=",Protected";
460 if (m_type&Package) result+=",Package";
461 if (m_type&Private) result+=",Private";
462 if (m_type&OnlyPublic) result+=",OnlyPublic";
463 if (m_type&Detailed) result+=",Detailed";
464 if (m_type&Documentation) result+=",Documentation";
465 return result;
466 }
467 constexpr TypeName type() const { return static_cast<TypeName>(m_type & TypeMask); }
468 int m_type = static_cast<int>(Invalid_);
469};
470
479
514
515constexpr const char *codeSymbolType2Str(CodeSymbolType type)
516{
517 switch (type)
518 {
519 case CodeSymbolType::Class: return "class";
520 case CodeSymbolType::Struct: return "struct";
521 case CodeSymbolType::Union: return "union";
522 case CodeSymbolType::Interface: return "interface";
523 case CodeSymbolType::Protocol: return "protocol";
524 case CodeSymbolType::Category: return "category";
525 case CodeSymbolType::Exception: return "exception";
526 case CodeSymbolType::Service: return "service";
527 case CodeSymbolType::Singleton: return "singleton";
528 case CodeSymbolType::Concept: return "concept";
529 case CodeSymbolType::Namespace: return "namespace";
530 case CodeSymbolType::Package: return "package";
531 case CodeSymbolType::Define: return "define";
532 case CodeSymbolType::Function: return "function";
533 case CodeSymbolType::Variable: return "variable";
534 case CodeSymbolType::Typedef: return "typedef";
535 case CodeSymbolType::EnumValue: return "enumvalue";
536 case CodeSymbolType::Enumeration: return "enumeration";
537 case CodeSymbolType::Signal: return "signal";
538 case CodeSymbolType::Slot: return "slot";
539 case CodeSymbolType::Friend: return "friend";
540 case CodeSymbolType::DCOP: return "dcop";
541 case CodeSymbolType::Property: return "property";
542 case CodeSymbolType::Event: return "event";
543 case CodeSymbolType::Sequence: return "sequence";
544 case CodeSymbolType::Dictionary: return "dictionary";
545 default:
546 return nullptr;
547 }
548}
549
550
570
577
578
580{
581 public:
582 enum Type {
583 None = 0, // initial value
584 Html = 0, // index / also to be used as bit position in mask (1 << Html)
585 Latex = 1, // ...
586 Xml = 2, // ...
587 Docbook = 3, // ...
588 numTocTypes = 4 // number of enum values
589 };
590 LocalToc() : m_mask(None) { memset(m_level,0,sizeof(m_level)); }
591
592 // setters
593 void enableHtml(int level)
594 {
595 m_mask|=(1<<Html);
596 m_level[Html]=level;
597 }
598 void enableLatex(int level)
599 {
600 m_mask|=(1<<Latex);
601 m_level[Latex]=level;
602 }
603 void enableXml(int level)
604 {
605 m_mask|=(1<<Xml);
606 m_level[Xml]=level;
607 }
608 void enableDocbook(int level)
609 {
610 m_mask|=(1<<Docbook);
611 m_level[Docbook]=level;
612 }
613
614 // getters
615 bool isHtmlEnabled() const { return (m_mask & (1<<Html))!=0; }
616 bool isLatexEnabled() const { return (m_mask & (1<<Latex))!=0; }
617 bool isXmlEnabled() const { return (m_mask & (1<<Xml))!=0; }
618 bool isDocbookEnabled() const { return (m_mask & (1<<Docbook))!=0; }
619 bool nothingEnabled() const { return m_mask == None; }
620 int htmlLevel() const { return m_level[Html]; }
621 int latexLevel() const { return m_level[Latex]; }
622 int xmlLevel() const { return m_level[Xml]; }
623 int docbookLevel() const { return m_level[Docbook]; }
624 int mask() const { return m_mask; }
625
626 private:
629};
630
631//---------------------------------------------------------------------------------------
632
633
634#define TYPE_SPECIFIERS \
635/* 0 */ TSPEC(Template) TSPEC(Generic) TSPEC(Ref) TSPEC(Value) TSPEC(Interface) \
636/* 5 */ TSPEC(Struct) TSPEC(Union) TSPEC(Exception) TSPEC(Protocol) TSPEC(Category) \
637/* 10 */ TSPEC(SealedClass) TSPEC(AbstractClass) TSPEC(Enum) TSPEC(Service) TSPEC(Singleton) \
638/* 15 */ TSPEC(ForwardDecl) TSPEC(Local) TSPEC(EnumStruct) TSPEC(ConstExpr) TSPEC(PrivateGettable) \
639/* 20 */ TSPEC(ProtectedGettable) TSPEC(PrivateSettable) TSPEC(ProtectedSettable) TSPEC(Inline) TSPEC(Explicit) \
640/* 25 */ TSPEC(Mutable) TSPEC(Settable) TSPEC(Gettable) TSPEC(Readable) TSPEC(Writable) \
641/* 30 */ TSPEC(Final) TSPEC(Abstract) TSPEC(Addable) TSPEC(Removable) TSPEC(Raisable) \
642/* 35 */ TSPEC(Override) TSPEC(New) TSPEC(Sealed) TSPEC(Initonly) TSPEC(Optional) \
643/* 40 */ TSPEC(Required) TSPEC(NonAtomic) TSPEC(Copy) TSPEC(Retain) TSPEC(Assign) \
644/* 45 */ TSPEC(Strong) TSPEC(Weak) TSPEC(Unretained) TSPEC(Alias) TSPEC(ConstExp) \
645/* 50 */ TSPEC(Default) TSPEC(Delete) TSPEC(NoExcept) TSPEC(Attribute) TSPEC(Property) \
646/* 55 */ TSPEC(Readonly) TSPEC(Bound) TSPEC(Constrained) TSPEC(Transient) TSPEC(MaybeVoid) \
647/* 60 */ TSPEC(MaybeDefault) TSPEC(MaybeAmbiguous) TSPEC(Published) TSPEC(ConstEval) TSPEC(ConstInit) \
648/* 65 */ TSPEC(NoDiscard)
649
650/** Wrapper class for a number of boolean properties.
651 * The properties are packed together, and initialized to false.
652 */
654{
655 public:
657
658 void reset() { std::memset(this, 0, sizeof(*this)); }
659
660 void merge(const TypeSpecifier &other)
661 {
662#define TSPEC(x) m_is##x = m_is##x || other.is##x();
664#undef TSPEC
665 }
666
667 friend inline bool operator==(const TypeSpecifier &t1,const TypeSpecifier &t2)
668 {
669 bool eq = true;
670#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
672#undef TSPEC
673 return eq;
674 }
675
676 friend inline bool operator!=(const TypeSpecifier &t1,const TypeSpecifier &t2)
677 {
678 return !(operator==(t1,t2));
679 }
680
681
682 std::string to_string() const
683 {
684 std::string result="[";
685 bool first=true;
686#define TSPEC(x) \
687 if (m_is##x) { \
688 if (!first) result+=","; \
689 result+=#x; first=false; \
690 }
692#undef TSPEC
693 result+="]";
694 return result;
695 }
696
697 // generate getter and setter for each property
698#define TSPEC(x) \
699 public: \
700 TypeSpecifier &set##x(bool b) { m_is##x = b; return *this; } \
701 bool is##x() const { return m_is##x; } \
702 private: \
703 bool m_is##x : 1;
705#undef TSPEC
706
707};
708
740
741
742// Type Categories (or'ed)
743#define ENTRY_TYPES \
744 ETYPE(Empty, None) \
745 ETYPE(Class, Compound|Scope) \
746 ETYPE(Namespace, Scope) \
747 ETYPE(Concept, None) \
748 ETYPE(ClassDoc, CompoundDoc|Doc) \
749 ETYPE(StructDoc, CompoundDoc|Doc) \
750 ETYPE(UnionDoc, CompoundDoc|Doc) \
751 ETYPE(ExceptionDoc, CompoundDoc|Doc) \
752 ETYPE(InterfaceDoc, CompoundDoc|Doc) \
753 ETYPE(ProtocolDoc, CompoundDoc|Doc) \
754 ETYPE(CategoryDoc, CompoundDoc|Doc) \
755 ETYPE(ServiceDoc, CompoundDoc|Doc) \
756 ETYPE(SingletonDoc, CompoundDoc|Doc) \
757 ETYPE(Source, File) \
758 ETYPE(Header, File) \
759 ETYPE(ModuleDoc, Doc) \
760 ETYPE(ConceptDoc, Doc) \
761 ETYPE(NamespaceDoc, Doc) \
762 ETYPE(EnumDoc, Doc) \
763 ETYPE(PageDoc, Doc) \
764 ETYPE(MemberDoc, Doc) \
765 ETYPE(OverloadDoc, Doc) \
766 ETYPE(Example, Doc) \
767 ETYPE(VariableDoc, Doc) \
768 ETYPE(FileDoc, Doc) \
769 ETYPE(DefineDoc, Doc) \
770 ETYPE(GroupDoc, Doc) \
771 ETYPE(MainpageDoc, Doc) \
772 ETYPE(MemberGrp, Doc) \
773 ETYPE(PackageDoc, Doc) \
774 ETYPE(DirDoc, Doc) \
775 ETYPE(Variable, None) \
776 ETYPE(Function, None) \
777 ETYPE(Typedef, None) \
778 ETYPE(Include, None) \
779 ETYPE(Enum, None) \
780 ETYPE(Define, None) \
781 ETYPE(UsingDir, None) \
782 ETYPE(UsingDecl, None) \
783 ETYPE(Package, None) \
784 ETYPE(ObjcImpl, None) \
785 ETYPE(ExportedInterface, None) \
786 ETYPE(IncludedService, None) \
787 ETYPE(ExampleLineno, None) \
788
789/** Wrapper class for the Entry type. Can be set only during construction.
790 * Packs the type together with category flags.
791 */
793{
794 public:
795#define ETYPE(x,bits) \
796 static EntryType make##x() { return EntryType(static_cast<int>(x)|static_cast<int>(bits)); } \
797 bool is##x() const { return (m_type&TypeMask)==x; }
799#undef ETYPE
800 bool isCompound() const { return (m_type & Compound)!=0; }
801 bool isScope() const { return (m_type & Scope)!=0; }
802 bool isFile() const { return (m_type & File)!=0; }
803 bool isCompoundDoc() const { return (m_type & CompoundDoc)!=0; }
804 bool isDoc() const { return (m_type & Doc)!=0; }
805 std::string to_string() const
806 {
807 switch (type())
808 {
809#define ETYPE(x,bits) \
810 case x : return "["+std::string(#x)+bits_to_string()+"]";
812#undef ETYPE
813 }
814 return "[unknown]";
815 }
816 friend inline bool operator==(const EntryType &t1,const EntryType &t2) { return t1.m_type==t2.m_type; }
817 friend inline bool operator!=(const EntryType &t1,const EntryType &t2) { return !(operator==(t1,t2)); }
818
819 private:
821 {
822#define ETYPE(x,bits) \
823 x,
825#undef ETYPE
826 };
827
829 {
830 None = 0,
831 Compound = (1<<16),
832 Scope = (1<<17),
833 File = (1<<18),
834 CompoundDoc = (1<<19),
835 Doc = (1<<20),
836 TypeMask = 0x0000FFFF,
837 CategoryMask = 0xFFFF0000
838 };
839 explicit EntryType(int t) : m_type(t) {}
840 std::string bits_to_string() const
841 {
842 std::string result;
843 if (m_type&Compound) result+=",Compound";
844 if (m_type&Scope) result+=",Scope";
845 if (m_type&File) result+=",File";
846 if (m_type&CompoundDoc) result+=",CompoundDoc";
847 return result;
848 }
849 TypeName type() const { return static_cast<TypeName>(m_type & TypeMask); }
850 unsigned int m_type = Empty;
851};
852
853
854#endif
A class representing a macro definition.
Definition define.h:31
bool isDoc() const
Definition types.h:804
unsigned int m_type
Definition types.h:850
ENTRY_TYPES bool isCompound() const
Definition types.h:800
TypeName
Definition types.h:821
@ ENTRY_TYPES
Definition types.h:824
EntryType(int t)
Definition types.h:839
bool isFile() const
Definition types.h:802
std::string to_string() const
Definition types.h:805
friend bool operator!=(const EntryType &t1, const EntryType &t2)
Definition types.h:817
TypeName type() const
Definition types.h:849
CategoryBits
Definition types.h:829
@ None
Definition types.h:830
@ Scope
Definition types.h:832
@ File
Definition types.h:833
@ CategoryMask
Definition types.h:837
@ Compound
Definition types.h:831
@ TypeMask
Definition types.h:836
@ Doc
Definition types.h:835
@ CompoundDoc
Definition types.h:834
friend bool operator==(const EntryType &t1, const EntryType &t2)
Definition types.h:816
std::string bits_to_string() const
Definition types.h:840
bool isScope() const
Definition types.h:801
bool isCompoundDoc() const
Definition types.h:803
bool isHtmlEnabled() const
Definition types.h:615
void enableXml(int level)
Definition types.h:603
bool isXmlEnabled() const
Definition types.h:617
int mask() const
Definition types.h:624
int docbookLevel() const
Definition types.h:623
@ Xml
Definition types.h:586
@ None
Definition types.h:583
@ Html
Definition types.h:584
@ Docbook
Definition types.h:587
@ Latex
Definition types.h:585
@ numTocTypes
Definition types.h:588
void enableLatex(int level)
Definition types.h:598
int latexLevel() const
Definition types.h:621
int m_level[numTocTypes]
Definition types.h:628
LocalToc()
Definition types.h:590
int htmlLevel() const
Definition types.h:620
int m_mask
Definition types.h:627
void enableDocbook(int level)
Definition types.h:608
int xmlLevel() const
Definition types.h:622
void enableHtml(int level)
Definition types.h:593
bool nothingEnabled() const
Definition types.h:619
bool isDocbookEnabled() const
Definition types.h:618
bool isLatexEnabled() const
Definition types.h:616
constexpr bool isProtected() const
Definition types.h:380
constexpr bool isOnlyPublic() const
Definition types.h:379
int to_int() const
Definition types.h:398
MemberListType toProtected() const
Definition types.h:438
constexpr bool isDetailed() const
Definition types.h:383
MemberListType toPublic() const
Definition types.h:426
static MemberListType Invalid()
Definition types.h:371
friend bool operator==(const MemberListType &t1, const MemberListType &t2)
Definition types.h:450
constexpr const char * toXML() const
Definition types.h:414
friend bool operator!=(const MemberListType &t1, const MemberListType &t2)
Definition types.h:451
constexpr const char * toLabel() const
Definition types.h:402
MemberListType(int t)
Definition types.h:454
constexpr bool isPrivate() const
Definition types.h:382
ML_TYPES constexpr bool isPublic() const
Definition types.h:378
constexpr bool isPackage() const
Definition types.h:381
constexpr bool isInvalid() const
Definition types.h:372
std::string to_string() const
Definition types.h:386
constexpr bool isDocumentation() const
Definition types.h:385
constexpr bool isDeclaration() const
Definition types.h:384
std::string bits_to_string() const
Definition types.h:455
constexpr TypeName type() const
Definition types.h:467
This is an alternative implementation of QCString.
Definition qcstring.h:101
std::string to_string() const
Definition types.h:682
TypeSpecifier()
Definition types.h:656
friend bool operator==(const TypeSpecifier &t1, const TypeSpecifier &t2)
Definition types.h:667
friend bool operator!=(const TypeSpecifier &t1, const TypeSpecifier &t2)
Definition types.h:676
void merge(const TypeSpecifier &other)
Definition types.h:660
void reset()
Definition types.h:658
QCString groupname
name of the group
Definition types.h:257
GroupPri_t
Grouping priority.
Definition types.h:230
@ GROUPING_LOWEST
Definition types.h:231
@ GROUPING_AUTO_ADD
membership in group was defined via @add[to]group
Definition types.h:233
@ GROUPING_INGROUP
membership in group was defined by @ingroup
Definition types.h:236
@ GROUPING_AUTO_WEAK
membership in group was defined via @weakgroup
Definition types.h:232
@ GROUPING_AUTO_HIGHEST
Definition types.h:235
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition types.h:234
@ GROUPING_HIGHEST
Definition types.h:237
Grouping(const QCString &gn, GroupPri_t p)
Definition types.h:256
static const char * getGroupPriName(GroupPri_t priority)
Definition types.h:240
GroupPri_t pri
priority of this definition
Definition types.h:258
MethodTypes
Definition types.h:119
#define ML_TYPES
Definition types.h:263
#define PROTECTION_SPECIFICATIONS
Protection level of members.
Definition types.h:26
constexpr const char * codeSymbolType2Str(CodeSymbolType type)
Definition types.h:515
#define SRCLANGEXT_SPECIFICATIONS
Language as given by extension.
Definition types.h:186
#define TYPE_SPECIFIERS
Definition types.h:634
#define RELATIONSHIP_SPECIFICATIONS
Kind of member relationship.
Definition types.h:162
CodeSymbolType
Definition types.h:481
static const char * to_string_lower_class(Protection prot)
Definition types.h:62
MemberType
Definition types.h:552
MemberListContainer
Definition types.h:472
static const char * to_string(Protection prot)
Definition types.h:38
#define ENTRY_TYPES
Definition types.h:743
Protection
Definition types.h:32
SrcLangExt
Definition types.h:207
Relationship
Definition types.h:167
RelatesType
Definition types.h:143
#define METHODTYPE_SPECIFICATIONS
Kind of method.
Definition types.h:111
Specifier
Definition types.h:80
VhdlSpecifier
Definition types.h:710
@ INSTANTIATION
Definition types.h:731
@ MISCELLANEOUS
Definition types.h:737
@ SHAREDVARIABLE
Definition types.h:734
FortranFormat
Definition types.h:572
#define SPECIFIER_SPECIFICATIONS
Virtualness of a member.
Definition types.h:75
static const char * to_string_lower(Protection prot)
Definition types.h:50
#define RELATESTYPE_SPECIFICATIONS
Type of member relation.
Definition types.h:138