| 1 |
|
| 2 |
.. _file-example: |
| 3 |
|
| 4 |
doxygenfile Directive |
| 5 |
===================== |
| 6 |
|
| 7 |
This directive generates the appropriate output for a single source file. It |
| 8 |
takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options |
| 9 |
and additionally the ``sections`` options. |
| 10 |
|
| 11 |
For the standard option refer to the documentation on the main directives page. |
| 12 |
The directive-specific options are documented below. |
| 13 |
|
| 14 |
``sections`` |
| 15 |
Limit the sections to render for the given source file to the given list. |
| 16 |
Many of the names come from Doxygen and Breathe internals and may not make |
| 17 |
sense from an external point of view. Nevertheless it is hoped this table is |
| 18 |
useful. |
| 19 |
|
| 20 |
.. csv-table:: Section types |
| 21 |
:header: "Type", "Description" |
| 22 |
|
| 23 |
"briefdescription", "Brief description" |
| 24 |
"dcop-func", "DCOP Function" |
| 25 |
"define", "Define" |
| 26 |
"derivedcompoundref", "Derived compound reference" |
| 27 |
"detaileddescription", "Detailed description" |
| 28 |
"enum", "Enumerator" |
| 29 |
"event", "Events" |
| 30 |
"friend", "Friend" |
| 31 |
"func", "Function" |
| 32 |
"innerclass", "**Must be given to show sections inside a class**" |
| 33 |
"innernamespace", "**Must be given to show sections inside a namespace**" |
| 34 |
"package-attrib", "Package attribute" |
| 35 |
"package-func", "Package function" |
| 36 |
"package-static-attrib", "Package static attribute" |
| 37 |
"package-static-func", "Package static function" |
| 38 |
"package-type", "Package type" |
| 39 |
"private-attrib", "Private attribute" |
| 40 |
"private-func", "Private function" |
| 41 |
"private-slot", "Private slot" |
| 42 |
"private-static-attrib", "Private static attribute" |
| 43 |
"private-static-func", "Private static function" |
| 44 |
"private-type", "Private type" |
| 45 |
"property", "Properties" |
| 46 |
"protected-attrib", "Protected attribute" |
| 47 |
"protected-func", "Protected function" |
| 48 |
"protected-slot", "Protected slot" |
| 49 |
"protected-static-attrib", "Protected static attribute" |
| 50 |
"protected-static-func", "Protected static function" |
| 51 |
"protected-type", "Protected type" |
| 52 |
"prototype", "Prototype" |
| 53 |
"public-attrib", "Public attribute" |
| 54 |
"public-func", "Public function" |
| 55 |
"public-slot", "Public slot" |
| 56 |
"public-static-attrib", "Public static attribute" |
| 57 |
"public-static-func", "Public static function" |
| 58 |
"public-type", "Public type" |
| 59 |
"related", "Related" |
| 60 |
"signal", "Signal" |
| 61 |
"typedef", "Type definition" |
| 62 |
"user-defined", "User defined" |
| 63 |
"var", "Variable" |
| 64 |
|
| 65 |
|
| 66 |
Example |
| 67 |
------- |
| 68 |
|
| 69 |
.. cpp:namespace:: @ex_file_example |
| 70 |
|
| 71 |
This should work: |
| 72 |
|
| 73 |
.. code-block:: rst |
| 74 |
|
| 75 |
.. doxygenfile:: nutshell.h |
| 76 |
:project: nutshell |
| 77 |
|
| 78 |
It produces this output: |
| 79 |
|
| 80 |
---- |
| 81 |
|
| 82 |
.. doxygenfile:: nutshell.h |
| 83 |
:project: nutshell |
| 84 |
|
| 85 |
Example with Selected and Ordered Sections |
| 86 |
------------------------------------------ |
| 87 |
|
| 88 |
.. cpp:namespace:: @ex_file_section |
| 89 |
|
| 90 |
The following will only show the **briefdescription** and **public-type** |
| 91 |
sections, in that order: |
| 92 |
|
| 93 |
.. code-block:: rst |
| 94 |
|
| 95 |
.. doxygenfile:: nutshell.h |
| 96 |
:project: nutshell |
| 97 |
:sections: briefdescription innerclass public-type |
| 98 |
|
| 99 |
It produces this output: |
| 100 |
|
| 101 |
---- |
| 102 |
|
| 103 |
.. doxygenfile:: nutshell.h |
| 104 |
:project: nutshell |
| 105 |
:sections: briefdescription innerclass public-type |
| 106 |
:no-link: |
| 107 |
|
| 108 |
Example with Nested Namespaces |
| 109 |
------------------------------ |
| 110 |
|
| 111 |
.. cpp:namespace:: @ex_file_namespace |
| 112 |
|
| 113 |
This should work: |
| 114 |
|
| 115 |
.. code-block:: rst |
| 116 |
|
| 117 |
.. doxygenfile:: namespacefile.h |
| 118 |
:project: namespace |
| 119 |
|
| 120 |
It produces this output: |
| 121 |
|
| 122 |
---- |
| 123 |
|
| 124 |
.. doxygenfile:: namespacefile.h |
| 125 |
:project: namespace |
| 126 |
|
| 127 |
|
| 128 |
Example for Multiple Files |
| 129 |
-------------------------- |
| 130 |
|
| 131 |
.. cpp:namespace:: @ex_file_multiple_files |
| 132 |
|
| 133 |
When there are multiple files with the same name in the project, you need to be |
| 134 |
more specific with the filename you provide. For example, in a project with the |
| 135 |
following two files: |
| 136 |
|
| 137 |
.. code-block:: text |
| 138 |
|
| 139 |
/some/long/project/path/parser/Util.h |
| 140 |
/some/long/project/path/finder/Util.h |
| 141 |
|
| 142 |
You should specify: |
| 143 |
|
| 144 |
.. code-block:: rst |
| 145 |
|
| 146 |
.. doxygenfile:: parser/Util.h |
| 147 |
|
| 148 |
.. doxygenfile:: finder/Util.h |
| 149 |
|
| 150 |
To uniquely identify them. |
| 151 |
|
| 152 |
Failing Example |
| 153 |
--------------- |
| 154 |
|
| 155 |
.. cpp:namespace:: @ex_file_failing |
| 156 |
|
| 157 |
This intentionally fails: |
| 158 |
|
| 159 |
.. code-block:: rst |
| 160 |
|
| 161 |
.. doxygenfile:: made_up_file.h |
| 162 |
:project: nutshell |
| 163 |
|
| 164 |
It produces the following warning message: |
| 165 |
|
| 166 |
.. warning:: |
| 167 |
Cannot find file "made_up_file.h" in doxygen xml output for project "nutshell" from directory: ../../examples/specific/nutshell/xml/ |