| 1 |
|
| 2 |
Domains |
| 3 |
======= |
| 4 |
|
| 5 |
Breathe has some limited support for Sphinx domains. It tries to output targets |
| 6 |
that the Sphinx domain references expect. This should allow you to use Sphinx |
| 7 |
domain roles like ``:c:func:`foo``` to link to output from Breathe. |
| 8 |
|
| 9 |
Class Example |
| 10 |
------------- |
| 11 |
|
| 12 |
.. cpp:namespace:: @ex_domains_class |
| 13 |
|
| 14 |
Given the following Breathe directives: |
| 15 |
|
| 16 |
.. code-block:: rst |
| 17 |
|
| 18 |
.. doxygenclass:: TestNamespaceClasses::NamespacedClassTest |
| 19 |
:path: ../../examples/specific/class/xml |
| 20 |
|
| 21 |
Which create formatted output like: |
| 22 |
|
| 23 |
.. doxygenclass:: TestNamespaceClasses::NamespacedClassTest |
| 24 |
:path: ../../examples/specific/class/xml |
| 25 |
|
| 26 |
We can refer to **NamespacedClassTest** using: |
| 27 |
|
| 28 |
.. code-block:: rst |
| 29 |
|
| 30 |
:cpp:class:`TestNamespaceClasses::NamespacedClassTest` |
| 31 |
|
| 32 |
which renders as :cpp:class:`TestNamespaceClasses::NamespacedClassTest`, or using: |
| 33 |
|
| 34 |
.. code-block:: rst |
| 35 |
|
| 36 |
:cpp:class:`another reference <TestNamespaceClasses::NamespacedClassTest>` |
| 37 |
|
| 38 |
which renders as: :cpp:class:`another reference <TestNamespaceClasses::NamespacedClassTest>`. |
| 39 |
|
| 40 |
Inner Class Example |
| 41 |
------------------- |
| 42 |
|
| 43 |
.. cpp:namespace:: @ex_domains_inner_class |
| 44 |
|
| 45 |
Given the following Breathe directive:: |
| 46 |
|
| 47 |
.. doxygenclass:: OuterClass |
| 48 |
:path: ../../examples/specific/class/xml |
| 49 |
:members: |
| 50 |
|
| 51 |
Which create formatted output like: |
| 52 |
|
| 53 |
.. doxygenclass:: OuterClass |
| 54 |
:path: ../../examples/specific/class/xml |
| 55 |
:members: |
| 56 |
|
| 57 |
We can refer to **OuterClass::InnerClass** using:: |
| 58 |
|
| 59 |
:cpp:class:`OuterClass::InnerClass` |
| 60 |
|
| 61 |
which renders as :cpp:class:`OuterClass::InnerClass`. |
| 62 |
|
| 63 |
Function Examples |
| 64 |
----------------- |
| 65 |
|
| 66 |
.. cpp:namespace:: @ex_domains_function |
| 67 |
|
| 68 |
Given the following Breathe directives: |
| 69 |
|
| 70 |
.. code-block:: rst |
| 71 |
|
| 72 |
.. doxygenfunction:: TestNamespaceClasses::NamespacedClassTest::function |
| 73 |
:path: ../../examples/specific/class/xml |
| 74 |
|
| 75 |
.. doxygenfunction:: frob_foos |
| 76 |
:path: ../../examples/specific/alias/xml |
| 77 |
|
| 78 |
Which create formatted output like: |
| 79 |
|
| 80 |
.. doxygenfunction:: TestNamespaceClasses::NamespacedClassTest::function |
| 81 |
:path: ../../examples/specific/class/xml |
| 82 |
|
| 83 |
.. doxygenfunction:: frob_foos |
| 84 |
:path: ../../examples/specific/alias/xml |
| 85 |
|
| 86 |
We can refer to **namespaceFunc** using: |
| 87 |
|
| 88 |
.. code-block:: rst |
| 89 |
|
| 90 |
:cpp:func:`TestNamespaceFunction::namespaceFunc()` |
| 91 |
|
| 92 |
which renders as :cpp:func:`TestNamespaceFunction::namespaceFunc()`, or using: |
| 93 |
|
| 94 |
.. code-block:: rst |
| 95 |
|
| 96 |
:cpp:func:`another reference <namespaceFunc()>` |
| 97 |
|
| 98 |
which renders as: :cpp:func:`another reference <TestNamespaceFunction::namespaceFunc()>`. |
| 99 |
Note the use of the **cpp** domain. |
| 100 |
|
| 101 |
And we can refer to **frob_foos** using: |
| 102 |
|
| 103 |
.. code-block:: rst |
| 104 |
|
| 105 |
:c:func:`frob_foos()` |
| 106 |
|
| 107 |
which renders as: :c:func:`frob_foos()`, or using: |
| 108 |
|
| 109 |
.. code-block:: rst |
| 110 |
|
| 111 |
:c:func:`another reference <frob_foos()>` |
| 112 |
|
| 113 |
which renders as: :c:func:`another reference <frob_foos()>`. Note the use of the **c** domain. |
| 114 |
|
| 115 |
Typedef Examples |
| 116 |
---------------- |
| 117 |
|
| 118 |
.. cpp:namespace:: @ex_domains_typedef |
| 119 |
|
| 120 |
Given the following Breathe directives: |
| 121 |
|
| 122 |
.. code-block:: rst |
| 123 |
|
| 124 |
.. doxygentypedef:: TestTypedef |
| 125 |
:path: ../../examples/specific/typedef/xml |
| 126 |
|
| 127 |
.. doxygennamespace:: TypeDefNamespace |
| 128 |
:path: ../../examples/specific/typedef/xml |
| 129 |
|
| 130 |
.. doxygenclass:: TestClass |
| 131 |
:path: ../../examples/specific/typedef/xml |
| 132 |
:members: |
| 133 |
|
| 134 |
which create formatted output like: |
| 135 |
|
| 136 |
.. doxygentypedef:: TestTypedef |
| 137 |
:path: ../../examples/specific/typedef/xml |
| 138 |
|
| 139 |
.. doxygennamespace:: TypeDefNamespace |
| 140 |
:path: ../../examples/specific/typedef/xml |
| 141 |
|
| 142 |
.. doxygenclass:: TestClass |
| 143 |
:path: ../../examples/specific/typedef/xml |
| 144 |
:members: |
| 145 |
|
| 146 |
We can refer to **TestTypedef** using: |
| 147 |
|
| 148 |
.. code-block:: rst |
| 149 |
|
| 150 |
:cpp:type:`TestTypedef` |
| 151 |
|
| 152 |
which renders as :cpp:type:`TestTypedef`, to **TypeDefNamespace::AnotherTypedef** using: |
| 153 |
|
| 154 |
.. code-block:: rst |
| 155 |
|
| 156 |
:cpp:type:`TypeDefNamespace::AnotherTypedef` |
| 157 |
|
| 158 |
which renders as :cpp:type:`TypeDefNamespace::AnotherTypedef` and to **TestClass::MemberTypedef** using: |
| 159 |
|
| 160 |
.. code-block:: rst |
| 161 |
|
| 162 |
:cpp:type:`TestClass::MemberTypedef` |
| 163 |
|
| 164 |
which renders as :cpp:type:`TestClass::MemberTypedef`. |
| 165 |
|
| 166 |
Enum Value Examples |
| 167 |
------------------- |
| 168 |
|
| 169 |
.. cpp:namespace:: @ex_domains_enum |
| 170 |
|
| 171 |
Given the following Breathe directives: |
| 172 |
|
| 173 |
.. code-block:: rst |
| 174 |
|
| 175 |
.. doxygenenumvalue:: VALUE |
| 176 |
:path: ../../examples/specific/enum/xml |
| 177 |
|
| 178 |
.. doxygenenumvalue:: TestEnumNamespace::FIRST |
| 179 |
:path: ../../examples/specific/enum/xml |
| 180 |
|
| 181 |
Which create formatted output like: |
| 182 |
|
| 183 |
.. doxygenenumvalue:: VALUE |
| 184 |
:path: ../../examples/specific/enum/xml |
| 185 |
|
| 186 |
.. doxygenenumvalue:: TestEnumNamespace::FIRST |
| 187 |
:path: ../../examples/specific/enum/xml |
| 188 |
|
| 189 |
We can refer to **VALUE** using: |
| 190 |
|
| 191 |
.. code-block:: rst |
| 192 |
|
| 193 |
:cpp:enumerator:`VALUE` |
| 194 |
|
| 195 |
which renders as :cpp:enumerator:`VALUE` and to **TestEnumNamespace::FIRST** using: |
| 196 |
|
| 197 |
.. code-block:: rst |
| 198 |
|
| 199 |
:cpp:enumerator:`TestEnumNamespace::FIRST` |
| 200 |
|
| 201 |
which renders as :cpp:enumerator:`TestEnumNamespace::FIRST`. |