Вы находитесь на странице: 1из 21

Doxygen

Presented by

Sweatha Viswanathan

Doxygen (pronounced as Docs-ee-gen)

It is a Documentation generator Free software released under the terms of the GNU General Public License Developed by Dimitri van Heesch (First version borrowed code from DOC++) Initial release in the year of 1997 Latest release 1.7.5.1 (August 2011)

(This and the next 2 slides are prepared using the information in the wiki page listed Under References)
2

Operating systems supported: Unix , Linux, MAC OS, Windows (XP/ Vista/ 7) Some common languages/scripting technologies not supported : VB, Perl, Ruby, Javascript, Tcl

Input & Output


Input format
C, C++, C#, Java, Objective-C, Python, Fortran, VHDL, PHP

Output format

Doxygen

HTML, Latex, RTF, XML, PostScript, PDF, MAN pages

Install Doxygen from http://www.stack.nl/~dimitri/doxygen/

Straight forward installation

Doxywizard
GUI front end for configuring and running Doxygen.
[http://www.stack.nl/~dimitri/doxygen/doxywizard_usage.html]

Commands

Comment Java Code : /* This. */ For Doxygen, enclose commands within: /** This.. */ or /*! This.. */ Few simple Commands: @brief @param @return @enum <name of Enum> @mainpage @todo

Find more commands in the folowing link http://www.stack.nl/~dimitri/doxygen/commands.html#cmdreturns

Demo Windows 7/Java/HTML (OS/Input format/Output format)

Sample code snippets with Doxygen commands


package personal.trydoxygen; /**@mainpage Welcome * Home page in Doxygen documentation\n * ...\n * ...\n * ...\n * ...\n * ...\n * */ public class MainClass{ public static void main(String[] args) { Mymathfunctions mathObj = new Mymathfunctions(); StringFunctions strObj = new StringFunctions(); } }

10

11

/*! * This method returns the sum of two integers. * @param a It is the first integer to be added. * @param b It is the second integer to be added. * @return The value returned is the sum of 2 arguments. * */ public int sumInteger(int a,int b) { return a+b; }
12

13

Did you know?


Question 1: If I use @mainpage in more than 1 class(file), will the individual contents be joined in the documentation?
Answer: No

C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/MainClass.java:12: warning: Compound personal::trydoxygen::MainClass is not documented. C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mymathfunctions.jav a:3: warning: found more than one \mainpage comment block! Skipping this block.

14

Question 2: If instead of @param, I mistype it as @params, what happens?


public class Mymathfunctions { /*! * This method returns the sum of two integers. * @params a It is the first integer to be added. * @param b It is the second integer to be added. * @return The value returned is the sum of 2 arguments. * */ public int sumInteger(int a,int b) { return a+b; } }
15

Question 2 contd
Answer: That argument does not get documented.
C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mym athfunctions.java:11: warning: Found unknown command `\params' C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mym athfunctions.java:10: warning: The following parameters of personal::trydoxygen::Mymathfunctions::sumInteger(int a, int b) are not documented: parameter 'a'

16

Can you spot any error?


/** * This method returns the value on dividing one number with other number. * @param a It is the first argument of this method. * @param b It is the second argument of this method. * @return The value returned is the value obtained on dividing c by d. * */ public double divideIntegers(int c,int d) { double result; if(d!=0) result=c/d; else result=1000000.50;

return result; }

17

No copy paste Errors We need to be careful when we write


18

Why did I choose this tool?

Not because I have used it extensively for the past X years But because, 1. It is used in software industry 2. The first time I used this tool, I felt nice to have known about it. I felt that it is a good piece of information to share with you all. Hope you guys liked it!!!
19

References
1) http://www.stack.nl/~dimitri/doxygen/ 2) http://en.wikipedia.org/wiki/Doxygen

20

Thank you.

21

Вам также может понравиться