Skip to content

Commit d92629d

Browse files
committed
Info Attribute lists
#feat
1 parent f0adca7 commit d92629d

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

include/mrdocs/Metadata/Field.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
// Copyright (c) 2023 Vinnie Falco ([email protected])
88
// Copyright (c) 2023 Krystian Stasiowski ([email protected])
9+
// Copyright (c) 2024 Alan de Freitas ([email protected])
910
//
1011
// Official repository: https://github.com/cppalliance/mrdocs
1112
//
@@ -58,6 +59,8 @@ struct FieldInfo
5859

5960
bool HasNoUniqueAddress = false;
6061

62+
std::vector<std::string> Attributes;
63+
6164
//--------------------------------------------
6265

6366
explicit FieldInfo(SymbolID ID) noexcept

include/mrdocs/Metadata/Function.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
// Copyright (c) 2023 Vinnie Falco ([email protected])
88
// Copyright (c) 2023 Krystian Stasiowski ([email protected])
9+
// Copyright (c) 2024 Alan de Freitas ([email protected])
910
//
1011
// Official repository: https://github.com/cppalliance/mrdocs
1112
//
@@ -166,6 +167,8 @@ struct FunctionInfo
166167
StorageClassKind StorageClass = StorageClassKind::None;
167168
ReferenceKind RefQualifier = ReferenceKind::None;
168169

170+
std::vector<std::string> Attributes;
171+
169172
//--------------------------------------------
170173

171174
explicit FunctionInfo(SymbolID ID) noexcept

share/mrdocs/addons/generator/common/partials/symbol/signature/field.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{#if attributes}}[{{join ", " attributes}}]
2+
{{/if}}
13
{{#if isMutable}}mutable
24
{{/if~}}
35
{{>type/declarator-prefix type}} {{>symbol/name symbol~}}

share/mrdocs/addons/generator/common/partials/symbol/signature/function.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{{/if~}}
33
{{#if isFriend}}friend
44
{{/if~}}
5+
{{#if attributes}}{{#unless isFriend}}[{{join ", " attributes}}]
6+
{{/unless}}{{/if~}}
57
{{#if constexprKind}}{{constexprKind}}
68
{{/if~}}
79
{{#if storageClass}}{{storageClass}}

src/lib/Metadata/Info.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ tag_invoke(
179179
{
180180
io.map("requires", I.Requires.Written);
181181
}
182+
io.map("attributes", dom::LazyArray(I.Attributes));
182183
}
183184
if constexpr (T::isTypedef())
184185
{
@@ -222,6 +223,7 @@ tag_invoke(
222223
{
223224
io.map("bitfieldWidth", I.BitfieldWidth.Written);
224225
}
226+
io.map("attributes", dom::LazyArray(I.Attributes));
225227
}
226228
if constexpr (T::isSpecialization())
227229
{}

0 commit comments

Comments
 (0)