How to exclude a method inside a class with doxygen?

Member

by lily , in category: Third Party Scripts , 22 days ago

How to exclude a method inside a class with doxygen?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , 22 days ago

@lily 

To exclude a specific method inside a class with Doxygen, you can use the @cond and @endcond commands.


Here's an example of how you can exclude a specific method called excludeMethod() inside a class with Doxygen:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * @class MyClass
 * @brief This is a class documentation.
 */
class MyClass {
public:
    /**
     * @brief This is a public method.
     */
    void publicMethod() {
        // Some code here
    }

    /**
     * @cond
     * @brief This method will be excluded from Doxygen documentation.
     */
    void excludeMethod() {
        // Some code here
    }
    /**
     * @endcond
     */
};


In the above example, the excludeMethod() method will be excluded from the Doxygen documentation. This can be useful when you want to exclude certain methods from being documented or displayed in the generated documentation.