User Tools

Site Tools


cpp:doxygen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
cpp:doxygen [2017/01/13 23:23] rlunarocpp:doxygen [2017/01/14 16:44] rlunaro
Line 13: Line 13:
  
 My objective is to generate the documentation in HTML. However, many kinds of output are available: chm, latex, eclipse help, math help, qt help.  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 =====
 +
 +<code>
 +# sudo apt-get install doxygen 
 +# sudo apt-get install graphviz
 +</code>
  
 ===== First round: empty document ===== ===== First round: empty document =====
Line 29: Line 36:
 PROJECT_BRIEF = "this is called PROJECT_BRIEF tag" PROJECT_BRIEF = "this is called PROJECT_BRIEF tag"
  
-PROJECT_LOGO = "images/hello.gif"+PROJECT_LOGO = "logo.png"
  
 # Errors, warnings  # Errors, warnings 
Line 38: Line 45:
 # navigation and behaviour # navigation and behaviour
 OUTPUT_DIRECTORY = "doc" OUTPUT_DIRECTORY = "doc"
-FILE_PATTERNS = "*.cpp*.h"+INPUT= .  
 +FILE_PATTERNS = *.cpp *.h
 RECURSIVE = yes RECURSIVE = yes
 EXCLUDE = "doc/" EXCLUDE = "doc/"
Line 44: Line 52:
 # output # output
 GENERATE_HTML = yes GENERATE_HTML = yes
 +GENERATE_LATEX = no
 HTML_OUTPUT = html HTML_OUTPUT = html
  
-OUTPUT_LANGUAGE = "English## Spanish+OUTPUT_LANGUAGE = English ## Spanish
  
 BRIEF_MEMBER_DESC = yes BRIEF_MEMBER_DESC = yes
Line 71: Line 80:
  
 <code> <code>
 +$ doxygen
 +</code>
  
 +And let's check out the result. These lines: 
 +
 +<code>
 +PROJECT_NAME = "Example for doxygen"
 +
 +PROJECT_NUMBER = "23.0.1.plus"
 +
 +PROJECT_BRIEF = "this is called PROJECT_BRIEF tag"
 +PROJECT_LOGO = "logo.png"
 </code> </code>
 +
 +are converted into this: 
 +
 +{{ :cpp:01.png?600 |}}
 +
 +===== Second round: Generating documentation =====
 +
 +For generating documentation, I've created three classes into my pet project: 
 +
 +{{ :cpp:02.png?600 |}}
 +
 +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();
 +};
 +</code>
 +
 +Generate this in the docummentation: 
 +
 +{{:cpp:04.png|}}
 +
 +And this: 
 +
 +<code c++>
 +/**
 + *
 + * This is the explanation of the square constructor.
 + *
 + */
 +Square::Square() {
 + // TODO Auto-generated constructor stub
 +
 +}
 +</code>
 +
 +Generates this:
 +
 +{{:cpp:05.png|}}
 +
 +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  */
 +</code>
 +
 +Yields this:
 +
 +{{:cpp:06.png|}}
 +
 +
 +
 +
 +
 +
  
cpp/doxygen.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1