Skip to content

Commit

Permalink
Provide information about enum type "strongness" in the XML output.
Browse files Browse the repository at this point in the history
There's a new boolean `strong` attribute on the `<memberdef>` element
that defines whether the enum is a classic or a strong one.

Tests were updated to verify both cases.
  • Loading branch information
mosra committed Nov 29, 2017
1 parent 17bceb8 commit 169cad8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/xmlgen.cpp
Expand Up @@ -668,6 +668,13 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De
t << "\"";
}

if (md->memberType() == MemberType_Enumeration)
{
t << " strong=\"";
if (md->isStrong()) t << "yes"; else t << "no";
t << "\"";
}

if (md->memberType() == MemberType_Variable)
{
//ArgumentList *al = md->argumentList();
Expand Down
1 change: 1 addition & 0 deletions templates/xml/compound.xsd
Expand Up @@ -146,6 +146,7 @@
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="prot" type="DoxProtectionKind" />
<xsd:attribute name="static" type="DoxBool" />
<xsd:attribute name="strong" type="DoxBool" use="optional"/>
<xsd:attribute name="const" type="DoxBool" use="optional"/>
<xsd:attribute name="explicit" type="DoxBool" use="optional"/>
<xsd:attribute name="inline" type="DoxBool" use="optional"/>
Expand Down
2 changes: 1 addition & 1 deletion testing/018/018__def_8c.xml
Expand Up @@ -17,7 +17,7 @@
</memberdef>
</sectiondef>
<sectiondef kind="enum">
<memberdef kind="enum" id="018__def_8c_1aa57b8491d1d8fc1014dd54bcf83b130a" prot="public" static="no">
<memberdef kind="enum" id="018__def_8c_1aa57b8491d1d8fc1014dd54bcf83b130a" prot="public" static="no" strong="no">
<type/>
<name>E</name>
<enumvalue id="018__def_8c_1aa57b8491d1d8fc1014dd54bcf83b130aab1710e6a49014ba389d57c8753c530f4" prot="public">
Expand Down
2 changes: 1 addition & 1 deletion testing/068/068__typed__enum_8cpp.xml
Expand Up @@ -3,7 +3,7 @@
<compounddef id="068__typed__enum_8cpp" kind="file" language="C++">
<compoundname>068_typed_enum.cpp</compoundname>
<sectiondef kind="enum">
<memberdef kind="enum" id="068__typed__enum_8cpp_1aa72902e6181db009a6a84502f81612c2" prot="public" static="no">
<memberdef kind="enum" id="068__typed__enum_8cpp_1aa72902e6181db009a6a84502f81612c2" prot="public" static="no" strong="yes">
<type>unsigned short</type>
<name>E</name>
<briefdescription>
Expand Down

0 comments on commit 169cad8

Please sign in to comment.