doxygenfile Directive Example¶
Example¶
This should work:
.. doxygenfile:: nutshell.h
:project: nutshell
It produces this output:
An overly extended example of how to use breathe.
-
class
Nutshell
- #include <nutshell.h>
With a little bit of a elaboration, should you feel it necessary.
Public Types
-
enum
Tool
Our tool set.
The various tools we can opt to use to crack this particular nut
Values:
-
kHammer
= 0 What? It does the job.
-
kNutCrackers
Boring.
-
kNinjaThrowingStars
Stealthy.
-
Public Functions
-
void Nutshell
crack
(Tool tool) Crack that shell with specified tool
- Parameters
tool
: the tool with which to crack the nut
-
bool Nutshell
isCracked
() - Return
- Whether or not the nut is cracked
Private Members
-
bool Nutshell
m_isCracked
Our cracked state.
-
enum
Example with Nested Namespaces¶
This should work:
.. doxygenfile:: namespacefile.h
:project: namespace
It produces this output:
Functions
-
void
outerFunction
()¶ Function outside of the namespace.
-
class
OuterBar
¶ - #include <namespacefile.h>
This is outside the namespace.
Example for Multiple Files¶
When there are multiple files with the same name in the project, you need to be more specific with the filename you provide. For example, in a project with the following two files:
/some/long/project/path/parser/Util.h
/some/long/project/path/finder/Util.h
You should specify:
.. doxygenfile:: parser/Util.h
.. doxygenfile:: finder/Util.h
To uniquely identify them.
Failing Example¶
This intentionally fails:
.. doxygenfile:: made_up_file.h
:project: nutshell
It produces the following warning message:
Warning
Cannot find file “made_up_file.h” in doxygen xml output for project “nutshell” from directory: ../../examples/specific/nutshell/xml/