Doxygen
维基百科,自由的百科全书
| 開發者 | Dimitri van Heesch |
|---|---|
| 穩定版本 | 1.7.2/ 2010年11月8日 |
| 程式語言 | C++ |
| 作業系統 | 跨平台 |
| 類型 | 文檔生成器 |
| 許可協議 | GNU General Public License |
| 網站 | http://www.stack.nl/~dimitri/doxygen/index.html |
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、以及CHM、RTF、PDF、LaTeX、PostScript 或man pages。
[编辑] 範例代碼
注释文档一般用两个星号标志:
/**
* <A short one line description>
*
* <Longer description>
* <May span multiple lines or paragraphs as needed>
*
* @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 <jdoe@example.com> * @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
}
[编辑] 外部鏈接
- 官方网站
- SourceForge.net上的Doxygen
- Freshmeat上的Doxygen
- MediaWiki documentation in Doxygen
- Example of documentation automatically generated by Doxygen for Apache Harmony