if not compounddef_child.attrib['prot'] == 'private' and id in state.compounds and state.compounds[id].has_details:
symbol = state.compounds[id]
+ # Strip parent if the base class has the same parent as
+ # this class. Can't just use symbol.leaf_name vs
+ # symbol.name because the <basecompoundref> can contain
+ # template information.
+ symbol_name = fix_type_spacing(html.escape(compounddef_child.text))
+ if state.compounds[compound.id].parent and symbol.parent and symbol.parent.startswith(state.compounds[compound.id].parent):
+ parent_name = state.compounds[symbol.parent].name + '::'
+ if symbol_name.startswith(parent_name):
+ symbol_name = symbol_name[len(parent_name):]
+
class_ = Empty()
class_.kind = symbol.kind
class_.url = symbol.url
- # Use only the leaf name if the base class has the same
- # parent as this class
- class_.name = symbol.leaf_name if state.compounds[compound.id].parent and symbol.parent and symbol.parent.startswith(state.compounds[compound.id].parent) else symbol.name
+ class_.name = symbol_name
class_.brief = symbol.brief
class_.templates = symbol.templates
class_.deprecated = symbol.deprecated
--- /dev/null
+INPUT = File.h
+QUIET = YES
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+XML_PROGRAMLISTING = NO
+CASE_SENSE_NAMES = YES
+
+##! M_PAGE_FINE_PRINT =
+##! M_THEME_COLOR =
+##! M_FAVICON =
+##! M_LINKS_NAVBAR1 =
+##! M_LINKS_NAVBAR2 =
+##! M_SEARCH_DISABLED = YES
--- /dev/null
+/** @file
+ * @brief A file
+ */
+
+/** @brief A namespace */
+namespace Namespace {
+
+/** @brief A base */
+template<class> struct Base {};
+
+/**
+@brief A class with two different template bases
+
+The @ref Namespace gets stripped from the references.
+*/
+struct MyClass: Base<int>, Base<Base<float>> {};
+
+}
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Namespace::MyClass struct | 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+documentation.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-8 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>
+ <span class="m-breadcrumb"><a href="namespaceNamespace.html">Namespace</a>::<wbr/></span>MyClass <span class="m-thin">struct</span>
+ <div class="m-doc-include m-code m-inverted m-text-right"><span class="cp">#include</span> <a class="cpf" href="File_8h.html"><File.h></a></div>
+ </h1>
+ <p>A class with two different template bases.</p>
+<p>The <a href="namespaceNamespace.html" class="m-doc">Namespace</a> gets stripped from the references.</p>
+ <section id="base-classes">
+ <h2><a href="#base-classes">Base classes</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <div class="m-doc-template">template<class></div>
+ struct <a href="structNamespace_1_1Base.html" class="m-doc">Base<int></a>
+ </dt>
+ <dd>A base.</dd>
+ <dt>
+ <div class="m-doc-template">template<class></div>
+ struct <a href="structNamespace_1_1Base.html" class="m-doc">Base<Base<float>></a>
+ </dt>
+ <dd>A base.</dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
def test(self):
self.run_doxygen(wildcard='*.xml')
self.assertEqual(*self.actual_expected_contents('File_8h.html'))
+
+class BaseTemplateClasses(IntegrationTestCase):
+ def test(self):
+ self.run_doxygen(wildcard='*.xml')
+ self.assertEqual(*self.actual_expected_contents('structNamespace_1_1MyClass.html'))