cpp:doxygen
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| cpp:doxygen [2017/01/13 15:34] – created rlunaro | cpp:doxygen [2022/12/02 21:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| These examples are made with doxygen version 1.8.11 for Linux. | These examples are made with doxygen version 1.8.11 for Linux. | ||
| + | |||
| + | The project I am documenting is an example project with three classes. The project is written in C++ and has a makefile to compile: my idea is to create a rule in makefile so that '' | ||
| + | the documentation. | ||
| + | |||
| + | My objective is to generate the documentation in HTML. However, many kinds of output are available: chm, latex, eclipse help, math help, qt help. | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | < | ||
| + | # sudo apt-get install doxygen | ||
| + | # sudo apt-get install graphviz | ||
| + | </ | ||
| + | |||
| + | ===== First round: empty document ===== | ||
| + | |||
| + | I've created a simple config file called '' | ||
| + | |||
| + | < | ||
| + | # | ||
| + | # Doxyfile - configuration for doxygen | ||
| + | # | ||
| + | |||
| + | PROJECT_NAME = " | ||
| + | |||
| + | PROJECT_NUMBER = " | ||
| + | |||
| + | PROJECT_BRIEF = "this is called PROJECT_BRIEF tag" | ||
| + | |||
| + | PROJECT_LOGO = " | ||
| + | |||
| + | # Errors, warnings | ||
| + | QUIET = no | ||
| + | WARNINGS = yes | ||
| + | WARN_IF_UNDOCUMENTED = yes | ||
| + | |||
| + | # navigation and behaviour | ||
| + | OUTPUT_DIRECTORY = " | ||
| + | INPUT= . | ||
| + | FILE_PATTERNS = *.cpp *.h | ||
| + | RECURSIVE = yes | ||
| + | EXCLUDE = " | ||
| + | |||
| + | # output | ||
| + | GENERATE_HTML = yes | ||
| + | GENERATE_LATEX = no | ||
| + | HTML_OUTPUT = html | ||
| + | |||
| + | OUTPUT_LANGUAGE = English ## Spanish | ||
| + | |||
| + | BRIEF_MEMBER_DESC = yes | ||
| + | |||
| + | FULL_PATH_NAMES = no | ||
| + | |||
| + | INHERIT_DOCS = yes | ||
| + | |||
| + | TAB_SIZE = 4 | ||
| + | |||
| + | MARKDOWN_SUPPORT = yes | ||
| + | |||
| + | AUTOLINK_SUPPORT = yes | ||
| + | |||
| + | GENERATE_BUGLIST = yes | ||
| + | |||
| + | GENERATE_DEPRECATEDLIST = yes | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | And I've generated my first documentation with the project almost empty: | ||
| + | |||
| + | < | ||
| + | $ doxygen | ||
| + | </ | ||
| + | |||
| + | And let's check out the result. These lines: | ||
| + | |||
| + | < | ||
| + | PROJECT_NAME = " | ||
| + | |||
| + | PROJECT_NUMBER = " | ||
| + | |||
| + | PROJECT_BRIEF = "this is called PROJECT_BRIEF tag" | ||
| + | PROJECT_LOGO = " | ||
| + | </ | ||
| + | |||
| + | are converted into this: | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ===== Second round: Generating documentation ===== | ||
| + | |||
| + | For generating documentation, | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | What are the results. | ||
| + | |||
| + | This comments: | ||
| + | |||
| + | <code c++> | ||
| + | /** | ||
| + | * Brief explanation of the class Square. | ||
| + | * | ||
| + | * A more long, detailed explanation of the Square | ||
| + | * class, that represents the squares in the classs. | ||
| + | * | ||
| + | */ | ||
| + | class Square: public Figure { | ||
| + | public: | ||
| + | Square(); | ||
| + | ~Square(); | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | Generate this in the docummentation: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | And this: | ||
| + | |||
| + | <code c++> | ||
| + | /** | ||
| + | * | ||
| + | * This is the explanation of the square constructor. | ||
| + | * | ||
| + | */ | ||
| + | Square:: | ||
| + | // TODO Auto-generated constructor stub | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | |||
| + | Generates this: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The comments on public properties: | ||
| + | |||
| + | <code c++> | ||
| + | class Square: public Figure { | ||
| + | double side; /*!< comment on a private value */ | ||
| + | public: | ||
| + | double something; /*!< comment on a public property | ||
| + | </ | ||
| + | |||
| + | Yields this: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
cpp/doxygen.1484321644.txt.gz · Last modified: 2022/12/02 21:02 (external edit)
