Doxygen安装使用


Doxygen是一个 C++、C、Java、Objective-C、Python、IDL(CORBA和Microsoft flavors)、Fortran、VHDL、PHP、C#和D语言的文檔生成器。可以在大多数类Unix的系统上执行,以及Mac OS X操作系统和Microsoft Windows。初始版本的Doxygen使用了一些旧版本DOC++的源代码;随后,Doxygen源代码由Dimitri van Heesch重写。

Doxygen是一个编写软件参考文檔的工具。该文檔是直接写在源代码中,因此比较容易保持更新。Doxygen可以交叉引用文檔和源代码,使文件的读者可以很容易地引用实际的源代码。

KDE 使用Doxygen作为其部分文档且KDevelop具有内置的支持。 Doxygen的发布遵守GNU General Public License,并且是自由软件。

如同Javadoc,Doxygen提取文件从源文件的注解。除了Javadoc的语法,Doxygen支持Qt使用的文档标记,并可以输出成HTML、以及CHMRTFPDFLaTeXPostScript或man pages

注释文档一般用两个星号标志:

/**
 * 
 *
 * 
 * 
 *
 * @param  Description of method's or function's input parameter
 * @param  ...
 * @return Description of the return value
 */

但也能和HeaderDoc一样使用*!的标志。 例如:

/*!
 * 
 *
 * 
 * 
 *
 * @param  Description of method's or function's input parameter
 * @param  ...
 * @return Description of the return value
 */

 以下说明如何使C++的源文件产生文件。请确保参数EXTRACT_ALL在Doxyfile设置为YES。

/**
 * @file
 * @author  John Doe 
 * @version 1.0
 *
 * @section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or(at your option)any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @section DESCRIPTION
 *
 * The time class represents a moment of time.
 */
 
class Time {
 
    public:
 
       /**
        * Constructor that sets the time to a given value.
        *
        * @param timemillis Number of milliseconds
        *        passed since Jan 1, 1970.
        */
       Time(int timemillis){
           // the code
       }
 
       /**
        * Get the current time.
        *
        * @return A time object set to the current time.
        */
       static Time now () {
           // the code
       }
};

另一种方法是首选的一些参数的记录如下。这将产生同样的文件。

       /**
        * Constructor that sets the time to a given value.
        *
        */
       Time(int timemillis ///< Number of milliseconds passed since Jan 1, 1970.{
           // the code
       }

 安装配置:

说明:

Doxygen 工作目录(1:) 就是用来存放配置文件的目录,别无它用。

mode:

Wizard的Topics下的Mode,选择All Entities,可以输出相对完整的功能,是否包含源代码看你自身情况

http://blog.csdn.net/lostaway/article/details/6446786

http://blog.csdn.net/weiwangchao_/article/details/6831206

更多:

http://blog.sina.com.cn/s/blog_69e2b85e0101avq7.html

http://www.fmddlmyy.cn/text21.html

http://www.ibm.com/developerworks/cn/aix/library/au-learningdoxygen/

有用的设置

在expert->html->GENERATE TREEVIEW勾选

这会在添加一个侧边栏,并以树状结构显示包、类、接口等的关系。

在expert->source browser->勾选SOURCE BROWSER   

  这回把所有的源代码包含在其中