compound.files = []
compound.namespaces = []
compound.classes = []
+ compound.base_classes = []
+ compound.derived_classes = []
compound.enums = []
compound.typedefs = []
compound.funcs = []
assert compound.kind in ['namespace', 'file']
compound.classes += [class_]
+ # Base class (if it links to anywhere)
+ elif compounddef_child.tag == 'basecompoundref':
+ assert compound.kind in ['class', 'struct', 'union']
+
+ if 'refid' in compounddef_child.attrib:
+ id = compounddef_child.attrib['refid']
+
+ # Add it only if it's not private and we have documentation for it
+ if not compounddef_child.attrib['prot'] == 'private' and id in state.compounds and state.compounds[id].has_details:
+ symbol = state.compounds[id]
+
+ class_ = Empty()
+ class_.kind = symbol.kind
+ class_.url = symbol.url
+ class_.name = symbol.leaf_name
+ class_.brief = symbol.brief
+ class_.templates = symbol.templates
+ class_.is_protected = compounddef_child.attrib['prot'] == 'protected'
+ class_.is_virtual = compounddef_child.attrib['virt'] == 'virtual'
+
+ compound.base_classes += [class_]
+
+ # Derived class (if it links to anywhere)
+ elif compounddef_child.tag == 'derivedcompoundref':
+ assert compound.kind in ['class', 'struct', 'union']
+
+ if 'refid' in compounddef_child.attrib:
+ id = compounddef_child.attrib['refid']
+
+ # Add it only if it's not private and we have documentation for it
+ if not compounddef_child.attrib['prot'] == 'private' and id in state.compounds and state.compounds[id].has_details:
+ symbol = state.compounds[id]
+
+ class_ = Empty()
+ class_.kind = symbol.kind
+ class_.url = symbol.url
+ class_.name = symbol.leaf_name
+ class_.brief = symbol.brief
+ class_.templates = symbol.templates
+
+ compound.derived_classes += [class_]
+
# Other, grouped in sections
elif compounddef_child.tag == 'sectiondef':
if compounddef_child.attrib['kind'] == 'enum':
<li>
Reference
<ul>
+ {% if compound.base_classes %}
+ <li><a href="#base-classes">Base classes</a></li>
+ {% endif %}
+ {% if compound.derived_classes %}
+ <li><a href="#derived-classes">Derived classes</a></li>
+ {% endif %}
{% if compound.public_types %}
<li><a href="#pub-types">Public types</a></li>
{% endif %}
{% endif %}
{% if compound.description %}
{{ compound.description }}
+ {% endif %}
+ {% if compound.base_classes %}
+ <section id="base-classes">
+ <h2><a href="#base-classes">Base classes</a></h3>
+ <dl class="m-dox">
+ {% for class in compound.base_classes %}
+{{ entry_class(class) }}
+ {% endfor %}
+ </dl>
+ </section>
+ {% endif %}
+ {% if compound.derived_classes %}
+ <section id="derived-classes">
+ <h2><a href="#derived-classes">Derived classes</a></h3>
+ <dl class="m-dox">
+ {% for class in compound.derived_classes %}
+{{ entry_class(class) }}
+ {% endfor %}
+ </dl>
+ </section>
{% endif %}
{% if compound.public_types %}
<section id="pub-types">
{% set j = joiner(', ') %}
<div class="m-dox-template">template<{% for t in class.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif %}{% endfor %}></div>
{% endif %}
- {{ class.kind }} <a href="{{ class.url }}" class="m-dox">{{ class.name }}</a>
+ {{ class.kind }} <a href="{{ class.url }}" class="m-dox">{{ class.name }}</a>{% if class.is_protected %} <span class="m-label m-flat m-warning">protected</span>{% endif %}{% if class.is_virtual %} <span class="m-label m-flat m-warning">virtual</span>{% endif %}
+
+ {# the empty line is above to fix spacing #}
</dt>
<dd>{{ class.brief }}</dd>
--- /dev/null
+INPUT = input.h
+AUTOLINK_SUPPORT = NO
+QUIET = YES
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+
+M_PAGE_FINE_PRINT =
+M_THEME_COLOR =
+M_LINKS_NAVBAR1 =
+M_LINKS_NAVBAR2 =
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>A class | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ A <span class="m-thin">class</span>
+ </h1>
+ <p>A class.</p>
+<p>Should list one protected base and one virtual base, one derived class.</p>
+ <section id="base-classes">
+ <h2><a href="#base-classes">Base classes</a></h3>
+ <dl class="m-dox">
+ <dt>
+ class <a href="classProtectedBase.html" class="m-dox">ProtectedBase</a> <span class="m-label m-flat m-warning">protected</span>
+ </dt>
+ <dd>Protected base, should list a derived, but w/o any label.</dd>
+ <dt>
+ class <a href="classVirtualBase.html" class="m-dox">VirtualBase</a> <span class="m-label m-flat m-warning">virtual</span>
+ </dt>
+ <dd>Virtual base, should list a derived, but w/o any label.</dd>
+ </dl>
+ </section>
+ <section id="derived-classes">
+ <h2><a href="#derived-classes">Derived classes</a></h3>
+ <dl class="m-dox">
+ <dt>
+ class <a href="classDerived.html" class="m-dox">Derived</a>
+ </dt>
+ <dd>A derived class.</dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>PrivateBase class | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ PrivateBase <span class="m-thin">class</span>
+ </h1>
+ <p>Private base class, should not list any derived.</p>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>ProtectedBase class | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ ProtectedBase <span class="m-thin">class</span>
+ </h1>
+ <p>Protected base, should list a derived, but w/o any label.</p>
+ <section id="derived-classes">
+ <h2><a href="#derived-classes">Derived classes</a></h3>
+ <dl class="m-dox">
+ <dt>
+ class <a href="classA.html" class="m-dox">A</a>
+ </dt>
+ <dd>A class.</dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>VirtualBase class | My Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">My Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ VirtualBase <span class="m-thin">class</span>
+ </h1>
+ <p>Virtual base, should list a derived, but w/o any label.</p>
+ <section id="derived-classes">
+ <h2><a href="#derived-classes">Derived classes</a></h3>
+ <dl class="m-dox">
+ <dt>
+ class <a href="classA.html" class="m-dox">A</a>
+ </dt>
+ <dd>A class.</dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
--- /dev/null
+/** @brief Private base class, should not list any derived */
+class PrivateBase {};
+
+/** @brief Protected base, should list a derived, but w/o any label */
+class ProtectedBase {};
+
+class UndocumentedBase {};
+
+/** @brief Virtual base, should list a derived, but w/o any label */
+class VirtualBase {};
+
+/**
+@brief A class
+
+Should list one protected base and one virtual base, one derived class.
+*/
+class A: PrivateBase, protected ProtectedBase, public UndocumentedBase, public virtual VirtualBase {};
+
+/** @brief A derived class */
+class Derived: public A {};
+
+struct UndocumentedDerived: A {};
self.run_dox2html5(wildcard='*.xml')
self.assertEqual(*self.actual_expected_contents('File_8h.html'))
self.assertEqual(*self.actual_expected_contents('structTemplate.html'))
+
+class Derived(IntegrationTestCase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(__file__, 'derived', *args, **kwargs)
+
+ def test(self):
+ self.run_dox2html5(wildcard='*.xml')
+ self.assertEqual(*self.actual_expected_contents('classA.html'))
+ self.assertEqual(*self.actual_expected_contents('classPrivateBase.html'))
+ self.assertEqual(*self.actual_expected_contents('classProtectedBase.html'))
+ self.assertEqual(*self.actual_expected_contents('classVirtualBase.html'))