Doxygen块状注释规范
1.Doxygen块状注释规范
普通注释
一般普通注释中有详细注释和简要注释,简要注释有多种标识方法,推荐使用@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 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术