Doxygen块状注释规范

发布时间 2023-08-25 15:33:59作者: takohubuki

普通注释

 

一般普通注释中有详细注释和简要注释,简要注释有多种标识方法,推荐使用@brief命令强制说明

/**
* @brief 简要注释. 详细注释
* 详细注释
*/

简要注释结束的标志是一个点号,或一个空行。

文件头注释

/** 
* @file [file-name]
* @brief brief description for the file.
* @author <list of authors>
* @email <email>
* @date <date>
* @license <license>
* @version <version number>
*
* detailed description for the file.
*/

类和成员注释

/**
* @class <class‐name> [header‐file] [<header‐name]
* @brief brief description
* @author <list of authors>
* @note
* detailed description
*/

int var; /**< Detailed description after the member */

函数注释

/**
* @brief		can send the message
* @param[in]	canx : The Number of CAN
* @param[in]	id : the can id	
* @param[in]	p : the data will be sent
* @param[in]	size : the data size
* @param[in]	is_check_send_time : is need check out the time out
* @note	Notice that the size of the size is smaller than the size of the buffer.		
* @return		
*	+1 Send successfully \n
*	-1 input parameter error \n
*	-2 canx initialize error \n
*	-3 canx time out error \n
* @par Sample
* @code
*	u8 p[8] = {0};
*	res_ res = 0; 
* 	res = can_send_msg(CAN1,1,p,0x11,8,1);
* @endcode
*/							
extern s32 can_send_msg(const CAN_TypeDef * canx,
			const u32 id,
			const u8 *p,
			const u8 size,
			const u8 is_check_send_time);

其他还有枚举注释、模块注释等,在此不一一列举,下面贴一下Doxygen中的特殊命令表

命令 字段名 语法
@file 文件名 file [< name >]
@brief 简介 brief
@author 作者 author
@mainpage 主页信息 mainpage [(title)]
@date 年-月-日 date
@author 版本号 version
@copyright 版权 copyright
@param 参数 param [(dir)] < parameter-name>
@return 返回 return
@retval 返回值 retval
@bug 漏洞 bug
@details 细节 details
@pre 前提条件 pre
@see 参考 see
@link 连接(与@see类库,{@link http://www.google.com}) link < link-object>
@throw 异常描述 throw < exception-object>
@todo 待处理 todo
@warning 警告信息 warning
@deprecated 弃用说明。可用于描述替代方案,预期寿命等 deprecated
@example 弃用说明。可用于描述替代方案,预期寿命等 deprecated