Domains

Breathe has some limited support for Sphinx domains. It tries to output targets that the Sphinx domain references expect. This should allow you to use Sphinx domain roles like :c:func:`foo` to link to output from Breathe.

The following targets are supported:

Class Example

Given the following Breathe directives:

.. doxygenclass:: testnamespace::NamespacedClassTest
   :path: ../../examples/specific/class/xml

Which create formatted output like:

class NamespacedClassTest

first class inside of namespace

We can refer to NamespacedClassTest using:

:cpp:class:`testnamespace::NamespacedClassTest`

which renders as testnamespace::NamespacedClassTest, or using:

:cpp:class:`another reference <testnamespace::NamespacedClassTest>`

which renders as: another reference.

Inner Class Example

Given the following Breathe directive:

.. doxygenclass:: OuterClass
   :path: ../../examples/specific/class/xml
   :members:

Which create formatted output like:

class OuterClass

class outside of namespace

class InnerClass

inner class

We can refer to OuterClass::InnerClass using:

:cpp:class:`OuterClass::InnerClass`

which renders as OuterClass::InnerClass.

Function Examples

Given the following Breathe directives:

.. doxygenfunction:: testnamespace::NamespacedClassTest::function
   :path: ../../examples/specific/class/xml

.. doxygenfunction:: frob_foos
   :path: ../../examples/specific/alias/xml

Which create formatted output like:

virtual void testnamespace::NamespacedClassTest::function() const = 0

namespaced class function

void frob_foos(void *Frobs)

Foo frob routine.

bob this something else

Side Effects\n Frobs any foos.

bob this something else

Side Effects\n Frobs any foos.

Parameters
  • Frobs – any foos.

Returns

Frobs any foos.

We can refer to function using:

:cpp:func:`testnamespace::NamespacedClassTest::function()`

which renders as testnamespace::NamespacedClassTest::function(), or using:

:cpp:func:`another reference <testnamespace::NamespacedClassTest::function()>`

which renders as: another reference. Note the use of the cpp domain.

And we can refer to frob_foos using:

:c:func:`frob_foos()`

which renders as: frob_foos(), or using:

:c:func:`another reference <frob_foos()>`

which renders as: another reference. Note the use of the c domain.

Typedef Examples

Given the following Breathe directives:

.. doxygentypedef:: TestTypedef
   :path: ../../examples/specific/typedef/xml

.. doxygentypedef:: testnamespace::AnotherTypedef
   :path: ../../examples/specific/typedef/xml

.. doxygenclass:: TestClass
   :path: ../../examples/specific/typedef/xml
   :members:

which create formatted output like:

typedef int TestTypedef
typedef char *testnamespace::AnotherTypedef
class TestClass

Public Types

typedef void *MemberTypedef

A typedef defined in a class.

We can refer to TestTypedef using:

:cpp:type:`TestTypedef`

which renders as TestTypedef, to testnamespace::AnotherTypedef using:

:cpp:type:`testnamespace::AnotherTypedef`

which renders as testnamespace::AnotherTypedef and to TestClass::MemberTypedef using:

:cpp:type:`TestClass::MemberTypedef`

which renders as TestClass::MemberTypedef.

Enum Value Examples

Given the following Breathe directives:

.. doxygenenumvalue:: VALUE
   :path: ../../examples/specific/enum/xml

.. doxygenenumvalue:: testnamespace::FIRST
   :path: ../../examples/specific/enum/xml

Which create formatted output like:

enumerator VALUE

enum value

enumerator FIRST

namespaced enum value

We can refer to VALUE using:

:cpp:enumerator:`VALUE`

which renders as VALUE and to testnamespace::FIRST using

:cpp:enumerator:`testnamespace::FIRST`

which renders as testnamespace::FIRST.