@@ -35,19 +35,23 @@ struct FieldInfo;
35
35
struct TypedefInfo ;
36
36
struct VariableInfo ;
37
37
struct SpecializationInfo ;
38
+ struct FriendInfo ;
39
+ struct EnumeratorInfo ;
38
40
39
41
/* * Info variant discriminator
40
42
*/
41
43
enum class InfoKind
42
44
{
43
- Namespace = 0 ,
45
+ Namespace = 1 , // for bitstream
44
46
Record,
45
47
Function,
46
48
Enum,
47
49
Typedef,
48
50
Variable,
49
51
Field,
50
- Specialization
52
+ Specialization,
53
+ Friend,
54
+ Enumerator
51
55
};
52
56
53
57
MRDOCS_DECL dom::String toString (InfoKind kind) noexcept ;
@@ -59,7 +63,7 @@ struct MRDOCS_VISIBLE
59
63
{
60
64
/* * The unique identifier for this symbol.
61
65
*/
62
- SymbolID id = SymbolID::invalid ;
66
+ SymbolID id;
63
67
64
68
/* * The unqualified name.
65
69
*/
@@ -91,7 +95,7 @@ struct MRDOCS_VISIBLE
91
95
conditions for extraction, but was extracted due to it being used
92
96
by a primary `Info`.
93
97
*/
94
- bool Implicit = true ;
98
+ bool Implicit = false ;
95
99
96
100
/* * In-order List of parent namespaces.
97
101
*/
@@ -110,20 +114,12 @@ struct MRDOCS_VISIBLE
110
114
explicit
111
115
Info (
112
116
InfoKind kind,
113
- SymbolID ID = SymbolID::invalid ) noexcept
117
+ SymbolID ID) noexcept
114
118
: id(ID)
115
119
, Kind(kind)
116
120
{
117
121
}
118
122
119
- //
120
- // Observers
121
- //
122
-
123
- MRDOCS_DECL
124
- std::string
125
- extractName () const ;
126
-
127
123
constexpr bool isNamespace () const noexcept { return Kind == InfoKind::Namespace; }
128
124
constexpr bool isRecord () const noexcept { return Kind == InfoKind::Record; }
129
125
constexpr bool isFunction () const noexcept { return Kind == InfoKind::Function; }
@@ -132,6 +128,8 @@ struct MRDOCS_VISIBLE
132
128
constexpr bool isVariable () const noexcept { return Kind == InfoKind::Variable; }
133
129
constexpr bool isField () const noexcept { return Kind == InfoKind::Field; }
134
130
constexpr bool isSpecialization () const noexcept { return Kind == InfoKind::Specialization; }
131
+ constexpr bool isFriend () const noexcept { return Kind == InfoKind::Friend; }
132
+ constexpr bool isEnumerator () const noexcept { return Kind == InfoKind::Enumerator; }
135
133
};
136
134
137
135
// ------------------------------------------------
@@ -157,13 +155,10 @@ struct IsInfo : Info
157
155
static constexpr bool isVariable () noexcept { return K == InfoKind::Variable; }
158
156
static constexpr bool isField () noexcept { return K == InfoKind::Field; }
159
157
static constexpr bool isSpecialization () noexcept { return K == InfoKind::Specialization; }
158
+ static constexpr bool isFriend () noexcept { return K == InfoKind::Friend; }
159
+ static constexpr bool isEnumerator () noexcept { return K == InfoKind::Enumerator; }
160
160
161
161
protected:
162
- constexpr IsInfo ()
163
- : Info(K)
164
- {
165
- }
166
-
167
162
constexpr explicit IsInfo (SymbolID ID)
168
163
: Info(K, ID)
169
164
{
@@ -204,6 +199,10 @@ visit(
204
199
return visitor.template visit <FieldInfo>();
205
200
case InfoKind::Specialization:
206
201
return visitor.template visit <SpecializationInfo>();
202
+ case InfoKind::Friend:
203
+ return visitor.template visit <FriendInfo>();
204
+ case InfoKind::Enumerator:
205
+ return visitor.template visit <EnumeratorInfo>();
207
206
default :
208
207
MRDOCS_UNREACHABLE ();
209
208
}
0 commit comments