您的位置:首页 > 运维架构 > Linux

了解doxygen的注释规范

2014-05-20 17:54 148 查看
了解了下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);

};

还需进一步了解。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  注释 doxygen linux
相关文章推荐