| 1 |
|
| 2 |
.. _function-example: |
| 3 |
|
| 4 |
doxygenfunction Directive Example |
| 5 |
================================= |
| 6 |
|
| 7 |
This directive generates the appropriate output for a single function. The |
| 8 |
function name, including namespace, is required to be unique in the project. |
| 9 |
|
| 10 |
For functions which have a declaration and definition in separate files, doxygen |
| 11 |
generates two entries for the function and Breathe can get confused when faced |
| 12 |
with this. As a result Breathe ignores what it considers to be the |
| 13 |
implementation files when searching for the XML for the function documentation. |
| 14 |
In order to do this, it ignores any entries in files which have filename |
| 15 |
extensions listed in the :ref:`breathe_implementation_filename_extensions |
| 16 |
<breathe-implementation-filename-extensions>` config variable. |
| 17 |
|
| 18 |
Working Example |
| 19 |
--------------- |
| 20 |
|
| 21 |
.. cpp:namespace:: @ex_function_example |
| 22 |
|
| 23 |
This should work: |
| 24 |
|
| 25 |
.. code-block:: rst |
| 26 |
|
| 27 |
.. doxygenfunction:: open |
| 28 |
:project: structcmd |
| 29 |
|
| 30 |
It produces this output: |
| 31 |
|
| 32 |
.. doxygenfunction:: open |
| 33 |
:project: structcmd |
| 34 |
|
| 35 |
Separated Declaration & Implementation Example |
| 36 |
---------------------------------------------- |
| 37 |
|
| 38 |
.. cpp:namespace:: @ex_function_separated |
| 39 |
|
| 40 |
This should work: |
| 41 |
|
| 42 |
.. code-block:: rst |
| 43 |
|
| 44 |
.. doxygenfunction:: open_di |
| 45 |
:project: decl_impl |
| 46 |
|
| 47 |
It produces this output: |
| 48 |
|
| 49 |
.. doxygenfunction:: open_di |
| 50 |
:project: decl_impl |
| 51 |
|
| 52 |
Failing Example |
| 53 |
--------------- |
| 54 |
|
| 55 |
.. cpp:namespace:: @ex_function_failing |
| 56 |
|
| 57 |
This intentionally fails: |
| 58 |
|
| 59 |
.. code-block:: rst |
| 60 |
|
| 61 |
.. doxygenfunction:: made_up_function |
| 62 |
:project: structcmd |
| 63 |
|
| 64 |
It produces the following warning message: |
| 65 |
|
| 66 |
.. warning:: |
| 67 |
doxygenfunction: Cannot find function "made_up_function" in doxygen xml output |