How to Make Doxygen to Ignore Some Commands?

7 minutes read

To make Doxygen ignore certain commands, you can use the //IGNORE or \IGNORE commands directly above the command you want to ignore. This will prevent Doxygen from processing those specific commands and their documentation. This is useful if you have commands that you do not want to be included in the generated documentation, such as temporary code or experimental features. By adding the //IGNORE or \IGNORE commands, you can control which parts of your code are documented and which are not.

Best Software Developer Books of November 2024

1
Software Requirements (Developer Best Practices)

Rating is 5 out of 5

Software Requirements (Developer Best Practices)

2
Lean Software Systems Engineering for Developers: Managing Requirements, Complexity, Teams, and Change Like a Champ

Rating is 4.9 out of 5

Lean Software Systems Engineering for Developers: Managing Requirements, Complexity, Teams, and Change Like a Champ

3
The Software Developer's Career Handbook: A Guide to Navigating the Unpredictable

Rating is 4.8 out of 5

The Software Developer's Career Handbook: A Guide to Navigating the Unpredictable

4
Soft Skills: The Software Developer's Life Manual

Rating is 4.7 out of 5

Soft Skills: The Software Developer's Life Manual

5
Engineers Survival Guide: Advice, tactics, and tricks After a decade of working at Facebook, Snapchat, and Microsoft

Rating is 4.6 out of 5

Engineers Survival Guide: Advice, tactics, and tricks After a decade of working at Facebook, Snapchat, and Microsoft

6
The Complete Software Developer's Career Guide: How to Learn Programming Languages Quickly, Ace Your Programming Interview, and Land Your Software Developer Dream Job

Rating is 4.5 out of 5

The Complete Software Developer's Career Guide: How to Learn Programming Languages Quickly, Ace Your Programming Interview, and Land Your Software Developer Dream Job


How to ignore specific preprocessor directives in Doxygen comments?

To ignore specific preprocessor directives in Doxygen comments, you can use the cond command provided by Doxygen. The cond command allows you to specify a condition that must be met for the following block of comments to be included in the documentation.


For example, if you want to ignore a specific preprocessor directive like #ifdef DEBUG, you can use the cond command as follows:

1
2
3
4
5
/**
 * \cond DEBUG
 * This comment block will be ignored in the documentation
 * \endcond
 */


In this example, the comments between \cond DEBUG and \endcond will be ignored by Doxygen if the DEBUG preprocessor directive is defined. If the DEBUG directive is not defined, the comments will be included in the documentation.


You can also use the cond command in combination with logical operators to specify more complex conditions. For more information on the cond command and other conditional commands supported by Doxygen, you can refer to the official Doxygen documentation.


What is the option for hiding private methods in Doxygen output?

The option for hiding private methods in Doxygen output is EXTRACT_PRIVATE. By default, Doxygen will include private methods in the generated documentation, but setting this option to NO will exclude them. This can be configured in the Doxyfile by setting EXTRACT_PRIVATE to NO.


How to prevent Doxygen from documenting test functions?

To prevent Doxygen from documenting test functions, you can use the EXCLUDE option in the Doxyfile to specify the files or folders containing test functions that you want to exclude from the documentation. Here is how you can do it:

  1. Open your Doxyfile (Doxygen configuration file) in a text editor.
  2. Locate the EXCLUDE option in the configuration file.
  3. Add the file or folder containing the test functions that you want to exclude from the documentation. For example, if you have test functions in a folder named tests, you can add the following line to the EXCLUDE option:
1
EXCLUDE = tests


  1. Save the configuration file and run Doxygen to generate the documentation. Doxygen will skip documenting the test functions in the specified files or folders.


By using the EXCLUDE option in the Doxyfile, you can prevent Doxygen from documenting specific test functions in your codebase.


How to exclude specific folders from Doxygen scanning?

To exclude specific folders from Doxygen scanning, you can use the EXCLUDE and EXCLUDE_PATTERNS configuration options in the Doxyfile configuration file.

  1. Open your Doxyfile configuration file in a text editor.
  2. Locate the EXCLUDE option and add the folders you want to exclude from scanning. For example:
1
EXCLUDE = path/to/excluded_folder


  1. Additionally, you can use the EXCLUDE_PATTERNS option to specify a list of file patterns to exclude. For example:
1
EXCLUDE_PATTERNS = */folder_to_exclude/*


  1. Save the changes to the Doxyfile configuration file.
  2. Run Doxygen to generate the documentation. The specified folders and file patterns will be excluded from the scanning process.


By using the EXCLUDE and EXCLUDE_PATTERNS options in the Doxyfile configuration file, you can effectively exclude specific folders from being scanned by Doxygen.

Facebook Twitter LinkedIn Whatsapp Pocket

Related Posts:

To run a Doxygen makefile, you first need to have Doxygen installed on your system. Once you have Doxygen installed, navigate to the directory where your Doxygen makefile is located using the command line. Then, simply type "make" followed by the name ...
To set a favicon for Doxygen output, you need to include a link to the favicon in the HTML header of the Doxygen output files. First, create or obtain the favicon file in .ico format. Next, place the favicon file in the directory where the Doxygen output files...
To generate PDF documents from Doxygen, you need to first ensure that you have Doxygen installed on your computer. Once you have Doxygen installed, you can run the Doxygen command on your terminal or command prompt with the appropriate configuration file that ...