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.
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:
- Open your Doxyfile (Doxygen configuration file) in a text editor.
- Locate the EXCLUDE option in the configuration file.
- 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
|
- 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.
- Open your Doxyfile configuration file in a text editor.
- Locate the EXCLUDE option and add the folders you want to exclude from scanning. For example:
1
|
EXCLUDE = path/to/excluded_folder
|
- 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/*
|
- Save the changes to the Doxyfile configuration file.
- 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.