From: Vladimír Vondruš Date: Fri, 22 Feb 2019 23:38:34 +0000 (+0100) Subject: doxygen: show the final label of a class also in the class tree. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=9a3c8f66f47d51ba2525bb47bab182c94a80b44c;p=blog.git doxygen: show the final label of a class also in the class tree. --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index cd707bf7..6c4315fe 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -2089,6 +2089,8 @@ Property Description :py:`i.url` URL of the file with detailed documentation :py:`i.brief` Brief documentation :py:`i.is_deprecated` Whether the entry is deprecated. [7]_ +:py:`i.is_final` Whether the class is :cpp:`final`. Set only for + classes. :py:`i.has_nestable_children` If the list has nestable children (i.e., dirs or namespaces) :py:`i.children` Recursive list of child entries diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 20917dd8..573d3e24 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -3163,6 +3163,8 @@ def parse_index_xml(state: State, xml): entry.children = [] entry.is_deprecated = compound.is_deprecated entry.has_nestable_children = False + if compound.kind in ['class', 'struct', 'union']: + entry.is_final = compound.is_final # If a top-level thing, put it directly into the list if not compound.parent: diff --git a/doxygen/templates/annotated.html b/doxygen/templates/annotated.html index c1e156ec..1bca2afb 100644 --- a/doxygen/templates/annotated.html +++ b/doxygen/templates/annotated.html @@ -13,7 +13,7 @@ {% else %} -
  • {{ i.kind }} {{ i.name }}{% if i.is_deprecated %} deprecated{% endif %} {{ i.brief }}
  • +
  • {{ i.kind }} {{ i.name }}{% if i.is_final %} final{% endif %}{% if i.is_deprecated %} deprecated{% endif %} {{ i.brief }}
  • {% endif %} {% endfor %} diff --git a/doxygen/test/cpp_derived/annotated.html b/doxygen/test/cpp_derived/annotated.html new file mode 100644 index 00000000..447a946a --- /dev/null +++ b/doxygen/test/cpp_derived/annotated.html @@ -0,0 +1,55 @@ + + + + + My Project + + + + + +
    +
    +
    +
    +
    +

    Classes

    + + +
    +
    +
    +
    + + diff --git a/doxygen/test/cpp_derived/input.h b/doxygen/test/cpp_derived/input.h index 66795a20..0dc2bad2 100644 --- a/doxygen/test/cpp_derived/input.h +++ b/doxygen/test/cpp_derived/input.h @@ -29,6 +29,7 @@ class A: PrivateBase, protected Another::ProtectedBase, public UndocumentedBase, } +/** @brief Another namespace */ namespace Another { /** @brief A derived class */ diff --git a/doxygen/test/test_cpp.py b/doxygen/test/test_cpp.py index a764dd1e..179d98b0 100644 --- a/doxygen/test/test_cpp.py +++ b/doxygen/test/test_cpp.py @@ -62,6 +62,8 @@ class Derived(IntegrationTestCase): self.assertEqual(*self.actual_expected_contents('classBaseOutsideANamespace.html')) self.assertEqual(*self.actual_expected_contents('classDerivedOutsideANamespace.html')) self.assertEqual(*self.actual_expected_contents('structAnother_1_1Final.html')) + # For the final label in the tree + self.assertEqual(*self.actual_expected_contents('annotated.html')) class Friends(IntegrationTestCase): def __init__(self, *args, **kwargs):