From 17bceb8f4580535de52d19e8cadf0d088f972bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 29 Nov 2017 18:38:13 +0100 Subject: Expose underlying enum type in the XML output. The element (used for function return type and variable type) is now reused also for underlying enum type. C++03-style enum types that don't have the underlying type specified have the tag as well, but empty to indicate that the underlying type is unspecified. Added a new test case for this. --- src/xmlgen.cpp | 7 +++++++ testing/018/018__def_8c.xml | 1 + testing/068/068__typed__enum_8cpp.xml | 25 +++++++++++++++++++++++++ testing/068_typed_enum.cpp | 7 +++++++ 4 files changed, 40 insertions(+) create mode 100644 testing/068/068__typed__enum_8cpp.xml create mode 100644 testing/068_typed_enum.cpp diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 1b03c3b..3b81408 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -802,6 +802,13 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De t << " " << convertToXML(md->argsString()) << "" << endl; } + if (md->memberType() == MemberType_Enumeration) + { + t << " "; + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->enumBaseType()); + t << "" << endl; + } + t << " " << convertToXML(md->name()) << "" << endl; if (md->memberType() == MemberType_Property) diff --git a/testing/018/018__def_8c.xml b/testing/018/018__def_8c.xml index 8518666..8bc5c09 100644 --- a/testing/018/018__def_8c.xml +++ b/testing/018/018__def_8c.xml @@ -18,6 +18,7 @@ + E E1 diff --git a/testing/068/068__typed__enum_8cpp.xml b/testing/068/068__typed__enum_8cpp.xml new file mode 100644 index 0000000..d6f1058 --- /dev/null +++ b/testing/068/068__typed__enum_8cpp.xml @@ -0,0 +1,25 @@ + + + + 068_typed_enum.cpp + + + unsigned short + E + + A strongly-typed enum. + + + + + + + + + + + + + + + diff --git a/testing/068_typed_enum.cpp b/testing/068_typed_enum.cpp new file mode 100644 index 0000000..44c4123 --- /dev/null +++ b/testing/068_typed_enum.cpp @@ -0,0 +1,7 @@ +// objective: test underlying type and strongness for an enum +// check: 068__typed__enum_8cpp.xml + +/** \file */ + +/** @brief A strongly-typed enum */ +enum class E: unsigned short {}; -- cgit v0.12