您的位置:首页 > 其它

程序开发文档生成利器

2005-02-01 17:45 309 查看
2005年2月1日 编写开发文档的利器
  

这两天我同事“黎叔”介绍了一个用于编写代码文档的好工具Doxygen,这个软件是个开源的项目,虽然界面写得比较难看一些不过还是相当实用的工具。有了这个工具可以很方便的生成程序开发文档,无论从版式还是从组织都可以说是一流,我花了一个小时的时间研究了一下还真是不错呢。

 
(一)基本设置

  首先从网上下一个Doxygen的工具然后安装到你的机器上,然后尽量不要改工具的设置,只需要修改几个地方就可以了

打开wizard对话框然后点expert按钮在projectd页下做以下几个设置你会发现写程序文档还是比较爽的

不选:FULL_PATH_NAMES

选:JAVADOC_AUTOBRIEF选这个选项后可以按java文档的格式生成文档,第一句是简要描述,我比较喜欢这种风格,它的例子大部份是QT格式的文档,不好看不美观所以建议不使用。

点开build页

不选:SHOW_DIRECTORIES除非你想要显示你代码的路径名和文件名

(二)注释风格

呵呵说到注释风格,因为我以前一直按照java文档的注释风格来写的,所以改动不是很大,主要风格如下

类的声名

/** IChart IChart.h "inc/IChart.h".

* this is base abstract class for chart

*

* IChart is abstract class for all type of chart

*/

主要的代码风格比较像java的代码注释风格,是类c的注释风格,主是注意"/**"的下一句一般会被认为是简要描述,记住一定要在简要描述的后面加上结束的符号"."否则就会被认为是一行。

类成员函数的声名

/**

* initialize the chart.

* @param char* title - [in] chart title name

* @param char* category - [in] chart category name

* @param char* value - [in] chart value name

* @param IDataSet* data - [in] chart data

* @param bool bRow - [in,default] use row data or use column data

*/
virtual void
; init( char* title , char* category , char* value , IDataSet*
data , IColors* colors , bool bRow = true ) = 0

/**

* the chart color table used to display chart plot.

* @param IColors* colors - [in] the color table

* @return a character pointer.

*/
virtual void set_colortable( IColors* colors
) = 0;

这里其它部份就不用说了说明是这里有几个关键字"@param"表示的是参数,写了这个关键字就可以在文档中生成函数的参数部份的文档了还有一个关键字是"@return"这个是返回值关键字,有了这个就可生成返回值部份的文档了,只要有这几个基本就可生成比较好看的程序文档了,代码写完文档也就写好了,真的是不错的东东啊。强烈建议大家都用这个工具生成项目文档。其它关键字就等用的时候去看了......

(三)生成的文档示例

 

 

Main Page | Class Hierarchy | Class List | Class Members

IChart Class Reference

IChart IChart.h "inc/IChart.h" this is base abstract class for chart.
More...

#include <IChart.h>


List of all members.

Public Member Functions

virtual IColors * get_colortable ()=0
 the chart color table used to display chart plot.
virtual void set_colortable (IColors *colors)=0
 the chart color table used to display chart plot.
virtual char * get_title ()=0
 the chart title property
virtual void init (char *title, char *category, char *value, IDataSet *data, IColors *colors, bool bRow=true)=0
 initialize the chart.

Detailed Description

IChart IChart.h "inc/IChart.h" this is base abstract class for chart.

 IChart is abstract class for all type of chart

Member Function Documentation

virtual IColors* IChart::get_colortable  ) 
[pure virtual]
 

the chart color table used to display chart plot.

return a character pointer.
virtual void IChart::init char * title,
char * category,
char * value,
IDataSet * data,
IColors * colors,
bool bRow =
true
[pure virtual]
 

initialize the chart.

Parameters:
char* title - [in] chart title name
char* category - [in] chart category name
char* value - [in] chart value name
IDataSet* data - [in] chart data
bool bRow - [in,default] use row data or use column data
virtual void IChart::set_colortable IColors * colors  ) 
[pure virtual]
 

the chart color table used to display chart plot.

Parameters:
IColors* colors - [in] the color table
Returns:a character pointer.
The documentation for this class was generated from the following file:IChart.h
Generated on Tue Feb 1 16:18:45 2005 for chart by 


1.4.1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息