11
11
12
12
#include " ../Gen/xml/CXXTags.hpp"
13
13
#include " TagfileWriter.hpp"
14
+ #include " lib/Gen/hbs/VisitorHelpers.hpp"
14
15
#include " lib/Lib/ConfigImpl.hpp"
15
16
#include " lib/Support/RawOstream.hpp"
16
17
92
93
TagfileWriter::
93
94
operator ()(T const & I)
94
95
{
96
+ if constexpr (std::derived_from<T, Info>)
97
+ {
98
+ if (!hbs::shouldGenerate (I))
99
+ {
100
+ return ;
101
+ }
102
+ }
103
+
95
104
if constexpr (T::isNamespace ())
96
105
{
97
106
// Namespaces are compound elements with members
@@ -119,12 +128,15 @@ writeNamespace(
119
128
bool onlyNamespaces = true ;
120
129
corpus_->traverse (I, [&](Info const & I)
121
130
{
131
+ if (!hbs::shouldGenerate (I))
132
+ {
133
+ return ;
134
+ }
135
+
122
136
if (I.Kind != InfoKind::Namespace)
123
137
{
124
138
onlyNamespaces = false ;
125
- return false ;
126
139
}
127
- return true ;
128
140
});
129
141
130
142
// Write the compound element for this namespace
@@ -138,8 +150,13 @@ writeNamespace(
138
150
tags_.write (" filename" , generateFilename (I));
139
151
140
152
// Write the class-like members of this namespace
141
- corpus_->traverse (I, [this ]<typename U>(U const & J)
153
+ corpus_->orderedTraverse (I, [this ]<typename U>(U const & J)
142
154
{
155
+ if (!hbs::shouldGenerate (J))
156
+ {
157
+ return ;
158
+ }
159
+
143
160
if (!U::isNamespace () && !U::isFunction ())
144
161
{
145
162
tags_.write (
@@ -150,7 +167,7 @@ writeNamespace(
150
167
});
151
168
152
169
// Write the function-like members of this namespace
153
- corpus_->traverse (I, [this ]<typename U>(U const & J)
170
+ corpus_->orderedTraverse (I, [this ]<typename U>(U const & J)
154
171
{
155
172
if constexpr (U::isFunction ())
156
173
{
@@ -162,7 +179,7 @@ writeNamespace(
162
179
}
163
180
164
181
// Write compound elements for the members of this namespace
165
- corpus_->traverse (I, [this ]<typename U>(U const & J)
182
+ corpus_->orderedTraverse (I, [this ]<typename U>(U const & J)
166
183
{
167
184
this ->operator ()(J);
168
185
});
@@ -183,7 +200,7 @@ writeClassLike(
183
200
if constexpr (T::isRecord ())
184
201
{
185
202
// Write the function-like members of this record
186
- corpus_->traverse (I, [this ]<typename U>(U const & J)
203
+ corpus_->orderedTraverse (I, [this ]<typename U>(U const & J)
187
204
{
188
205
if constexpr (U::isFunction ())
189
206
{
0 commit comments