-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patharguments.h
117 lines (95 loc) · 3.44 KB
/
arguments.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/************************************************************************
*
* Copyright (c) 2014-2025 Barbara Geller & Ansel Sermersheim
*
* Copyright (c) 1997-2014 Dimitri van Heesch
*
* DoxyPress is free software. You can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* DoxyPress is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Documents produced by DoxyPress are derivative works derived from the
* input used in their production; they are not affected by this license.
*
* https://www.gnu.org/licenses/
*
*************************************************************************/
#ifndef ARGUMENTS_H
#define ARGUMENTS_H
#include <QString>
#include <QVector>
#include <types.h>
// class contains the information about the argument of a function or template
struct Argument {
Argument() {}
// copy constructor
Argument(const Argument &a) {
attrib = a.attrib;
type = a.type;
name = a.name;
defval = a.defval;
docs = a.docs;
array = a.array;
typeConstraint = a.typeConstraint;
}
// Assignment operator
Argument &operator=(const Argument &a) {
if (this != &a) {
attrib = a.attrib;
type = a.type;
name = a.name;
defval = a.defval;
docs = a.docs;
array = a.array;
typeConstraint = a.typeConstraint;
}
return *this;
}
// return true if this argument is documentation and the argument has a non empty name
bool hasDocumentation() const {
return ! name.isEmpty() && ! docs.isEmpty();
}
QString attrib; /*!< Argument's attribute (IDL only) */
QString type; /*!< Argument's type */
mutable QString canType; /*!< Cached value of canonical type (after type resolution). Empty initially. */
QString name; /*!< Argument's name (may be empty) */
QString array; /*!< Argument's array specifier (may be empty) */
QString defval; /*!< Argument's default value (may be empty) */
QString docs; /*!< Argument's documentation (may be empty) */
QString typeConstraint; /*!< Used for Java generics: <T extends C> */
};
// stores information about a member which is typically found after the argument list,
// such as whether the member is const, volatile or pure virtual.
class ArgumentList : public QVector<Argument>
{
public:
// Creates an empty argument list
ArgumentList() : constSpecifier(false), volatileSpecifier(false), pureSpecifier(false),
refSpecifier(RefType::NoRef), isDeleted(false)
{
}
~ArgumentList() {}
// Does any argument of this list have documentation?
bool hasDocumentation() const;
bool isEmpty() const = delete;
bool listEmpty() const {
return QVector<Argument>::isEmpty();
}
// Does the member modify the state of the class? default: false.
bool constSpecifier;
// Is the member volatile? default: false.
bool volatileSpecifier;
// Is this a pure virtual member? default: false
bool pureSpecifier;
RefType refSpecifier;
// trailing return type
QString trailingReturnType;
// parsing a method with = delete
bool isDeleted;
};
using ArgumentListIterator = QVectorIterator<Argument>;
#endif