Doxygen使用
-
配置文件生成以及build
- doxygen -g dconfig
- doxygen dconfig
-
代码注释
-
每个文件前面
-
//*************************************************************************************** // //! \file main.c //! This is an simple example show developer how to use dev api to print int number. //! //! \author Cedar //! \version V1.0 //! \date 2014-03-23 //! \copyright GNU Public License V3.0 // //***************************************************************************************
-
对单独一行注释//!< The maxium number of print可放在代码左边或者放在代码上面
-
//! Simple device status. //! //! \warning This variable is designed for internal, user \b MUST \b NOT call it.
-
// Print debug information
-
函数注释,在.h文件
-
//*************************************************************************************** // //! \brief Print Int number to terimal device. //! //! \param [in] number is the data you want to print. //! \retval the number of print information, in bytes. return zero indicate print error !. //! //! \note //! * Be sure you have called \ref Dev_Init function before call this fuction. //! * Remember to check return value. // //***************************************************************************************
-
-
区分普通注释和特殊注释
-
Doxygen通过在这里增加
*
,/
,!
来作为特殊标记 -
/* * 正常注释 */
-
/*! * 要输出成文档的注释 */
-
// 正常注释
-
//! 要输出成文档的注释
-
前面都是对后面代码的注释
-
如果是对前面代码注释,要再增加一个<
-
//!< Simple device is power on.
-
-
区分特殊标记符和普通文本
- Doxygen采用
\
和@
作为特殊标记符 - \brief
- 检测紧跟单词是不是Doxygen事先规定好的,如果是,则将按照特定的规则来解释紧跟着的注释;如果不是呢,则将
\
和@
解释为普通文本
- Doxygen采用