define.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #ifndef DEFINE_H
19 #define DEFINE_H
20 
21 #include <qdict.h>
22 #include <qlist.h>
23 
24 class FileDef;
25 
26 /** A class representing a macro definition. */
27 class Define
28 {
29  public:
30  Define();
31  Define(const Define &d);
32  ~Define();
33  bool hasDocumentation();
42  int lineNr;
43  int columnNr;
44  int nargs;
45  bool undef;
46  bool varArgs;
49 };
50 
51 /** A list of Define objects. */
52 class DefineList : public QList<Define>
53 {
54  public:
57  private:
58  int compareValues(const Define *d1,const Define *d2) const
59  {
60  return qstricmp(d1->name,d2->name);
61  }
62 };
63 
64 /** A list of Define objects associated with a specific name. */
65 class DefineName : public QList<Define>
66 {
67  public:
68  DefineName(const char *n) : QList<Define>() { name=n; }
70  const char *nameString() const { return name; }
71 
72  private:
73  int compareValues(const Define *d1,const Define *d2) const
74  {
75  return qstricmp(d1->name,d2->name);
76  }
78 };
79 
80 /** A list of DefineName objects. */
81 class DefineNameList : public QList<DefineName>
82 {
83  public:
86  private:
87  int compareValues(const DefineName *n1,const DefineName *n2) const
88  {
89  return qstricmp(n1->nameString(),n2->nameString());
90  }
91 };
92 
93 /** An unsorted dictionary of Define objects. */
94 typedef QDict<Define> DefineDict;
95 
96 /** A sorted dictionary of DefineName object. */
97 typedef QDict<DefineName> DefineNameDict;
98 
99 #endif
int lineNr
Definition: define.h:42
QCString doc
Definition: define.h:37
DefineList()
Definition: define.h:55
int columnNr
Definition: define.h:43
bool nonRecursive
Definition: define.h:48
QCString name
Definition: define.h:77
bool isPredefined
Definition: define.h:47
~DefineName()
Definition: define.h:69
Define()
Definition: define.cpp:21
int compareValues(const Define *d1, const Define *d2) const
Definition: define.h:73
QDict< DefineName > DefineNameDict
Definition: define.h:97
QCString args
Definition: define.h:39
DefineNameList()
Definition: define.h:84
~Define()
Definition: define.cpp:47
int compareValues(const Define *d1, const Define *d2) const
Definition: define.h:58
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
Definition: define.h:27
std::void_t< T > n
int compareValues(const DefineName *n1, const DefineName *n2) const
Definition: define.h:87
const char * nameString() const
Definition: define.h:70
bool varArgs
Definition: define.h:46
QCString anchor
Definition: define.h:40
QCString fileName
Definition: define.h:36
bool hasDocumentation()
Definition: define.cpp:51
QCString brief
Definition: define.h:38
~DefineNameList()
Definition: define.h:85
FileDef * fileDef
Definition: define.h:41
QDict< Define > DefineDict
Definition: define.h:94
bool undef
Definition: define.h:45
DefineName(const char *n)
Definition: define.h:68
QCString definition
Definition: define.h:35
~DefineList()
Definition: define.h:56
Definition: qlist.h:54
int nargs
Definition: define.h:44
QCString name
Definition: define.h:34