了解doxygen的注释规范

了解了下doxygen这个神器, 怎么安装就不说了,用的是1.8.7版,还是主要在于怎么使用,刚接触也不怎么懂,看了主页http://www.stack.nl/~dimitri/doxygen/上的一些说明,头都大了,基本上都知道是这样生成文档的:

1、生成一个默认的配置文件:doxygen -g xtank.cfg.

2、按需求自定义修改这个默认生成的xtank.cfg.

3、根据配置文件生成文档: doxygen xtank.cfg

当然,前提是需要按照器规定的方法在代码中写好特定风格的注释。


这里摘抄了doxygen_manual-1.8.7.pdf中的一个比较容易理解的例子,其使用JavaDoc风格的, 有删减,

注意要在配置文件中设置JAVADOC_AUTOBRIEF项为YES.

/**
 * A test class.
 * A more elabore class description
 */
class Test
{
public:

/** 
* An enum.
* More detailed enum description.
*/
enum TEnum
{
Tval1; /**< enum value Tval1. */
Tval2; /**< enum value Tval2. */
Tval3; /**< enum value Tval3. */
}
*enumPtr, /**< enum poniter. details. */
enumVal; /**< enum variable. details. */

/** 
* A constructor.
* A more elaborate details of the constructor here.
*/
Test(void);

/**
*  A deconstructor.
*  A more details of deconstructor here
*/
~Test(void);

/**
* a normal member taking two arguments and returning an integer value
* @param a an integer argument.
* @param s a constant character pointer.
* @return The test result
*/
int testMe(int a, const char *s);

/**
* A pure virural member.
* @param c1 the first argument.
* @param c2 the second argument.
*/
virtual void testMeToo(char c1, char c2) = 0;

/**
* A public variable
* details here.
*/
int publicVal;

/** 
* a function variable.
* Details.
*/
int (*handler)(int a, int b);
};

还需进一步了解。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值