To exclude a method inside a class with Doxygen, you can use the \cond and \endcond commands. These commands are used to toggle the inclusion of specific parts of the code in the generated documentation. Simply wrap the method you want to exclude between these commands, and it will not be documented when you generate the output. This can be useful if you have certain methods that are private or internal and do not need to be included in the documentation.
What is the syntax for excluding a method in doxygen?
To exclude a specific method from being documented in Doxygen, you can use the \cond
and \endcond
commands to surround the method that you want to exclude. The syntax is as follows:
1 2 3 4 5 6 7 8 9 10 |
/** * This method will not be documented by Doxygen. * \cond */ void excludedMethod() { // Code for excluded method } /** * \endcond */ |
By wrapping the method with \cond
and \endcond
, Doxygen will ignore the method and not include it in the generated documentation.
How to exclude a constructor or destructor method in a class with doxygen?
To exclude a constructor or destructor method in a class with Doxygen, you can use the \cond
and \endcond
commands to surround the code that you want to exclude.
For example, if you have a constructor or destructor method in your class that you want to exclude from the Doxygen documentation, you can do the following:
1 2 3 4 5 6 7 8 9 10 11 12 |
class MyClass { public: /// \cond HIDE_CONSTRUCTOR MyClass(); ///< Constructor /// \endcond /// \cond HIDE_DESTRUCTOR ~MyClass(); ///< Destructor /// \endcond void someMethod(); ///< A public method }; |
By using the \cond
and \endcond
commands, you are essentially telling Doxygen to ignore the constructor and destructor methods when generating the documentation. This way, the constructor and destructor methods will not appear in the generated documentation.
You can also use these commands to exclude other specific parts of your code from the Doxygen documentation, such as private methods or helper functions that are not meant to be documented.
How to exclude a virtual method in a class with doxygen?
To exclude a virtual method in a class from the Doxygen documentation, you can use the ignore
command in the comments of the method that you want to exclude. Here's an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class MyClass { public: /** * This is a normal method that will be documented */ void normalMethod(); /** * \ignore * This is a virtual method that will be excluded from documentation */ virtual void virtualMethod(); }; |
By adding the \ignore
command in the comments of the virtual method, Doxygen will skip documenting that particular method. This way, the virtual method will be excluded from the generated documentation.
How to exclude a method from being cross-referenced in doxygen?
To exclude a specific method from being cross-referenced in Doxygen, you can use the \cond and \endcond commands to define a conditional section that will be excluded from the generated documentation. Here's how you can do it:
1 2 3 4 5 |
/// \cond SKIP_METHOD void excludedMethod() { // This method will be excluded from cross-referencing } /// \endcond |
By using \cond SKIP_METHOD and \endcond, you are telling Doxygen to ignore the content inside this conditional section when generating the documentation. This way, the excludedMethod will not be cross-referenced in the generated output.