Skip to content

Commit

Permalink
Info Attribute lists
Browse files Browse the repository at this point in the history
#feat
  • Loading branch information
alandefreitas committed Jan 2, 2025
1 parent f0adca7 commit d92629d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/mrdocs/Metadata/Field.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
// Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
// Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com)
// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com)
//
// Official repository: https://github.com/cppalliance/mrdocs
//
Expand Down Expand Up @@ -58,6 +59,8 @@ struct FieldInfo

bool HasNoUniqueAddress = false;

std::vector<std::string> Attributes;

//--------------------------------------------

explicit FieldInfo(SymbolID ID) noexcept
Expand Down
3 changes: 3 additions & 0 deletions include/mrdocs/Metadata/Function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
// Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
// Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com)
// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com)
//
// Official repository: https://github.com/cppalliance/mrdocs
//
Expand Down Expand Up @@ -166,6 +167,8 @@ struct FunctionInfo
StorageClassKind StorageClass = StorageClassKind::None;
ReferenceKind RefQualifier = ReferenceKind::None;

std::vector<std::string> Attributes;

//--------------------------------------------

explicit FunctionInfo(SymbolID ID) noexcept
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{#if attributes}}[{{join ", " attributes}}]
{{/if}}
{{#if isMutable}}mutable
{{/if~}}
{{>type/declarator-prefix type}} {{>symbol/name symbol~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{{/if~}}
{{#if isFriend}}friend
{{/if~}}
{{#if attributes}}{{#unless isFriend}}[{{join ", " attributes}}]
{{/unless}}{{/if~}}
{{#if constexprKind}}{{constexprKind}}
{{/if~}}
{{#if storageClass}}{{storageClass}}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/Metadata/Info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ tag_invoke(
{
io.map("requires", I.Requires.Written);
}
io.map("attributes", dom::LazyArray(I.Attributes));
}
if constexpr (T::isTypedef())
{
Expand Down Expand Up @@ -222,6 +223,7 @@ tag_invoke(
{
io.map("bitfieldWidth", I.BitfieldWidth.Written);
}
io.map("attributes", dom::LazyArray(I.Attributes));
}
if constexpr (T::isSpecialization())
{}
Expand Down

0 comments on commit d92629d

Please # to comment.