如何评论 header 个文件?
How do I comment header files?
/* ----------------------------------------------------------
** functions used for converting between different data types
** ---------------------------------------------------------*/
#ifndef TYPECONVERTER_H_INCLUDED
#define TYPECONVERTER_H_INCLUDED
/**
converts binary to decimal
@return converted decimal number
*/
int toDecimal(bool binary[], int noOfNumbers);
/**
converts decimal to binary and stores it in a given array
*/
void toBinary(int origin[], bool binary[], int noOfNumbers);
#endif // TYPECONVERTER_H_INCLUDED
如何评论这个 header 的作用,以便 Doxygen 理解它?现在它只是将顶部评论分配给第一个函数。
Doxygen 有一个 \file
命令,可以将注释块标记为记录某个文件。当用作\file filename.ext
时,它会将其分配给文件filename.ext
。正如 \file
,它适用于它出现的文件。
示例:
/**
@file
functions used for converting between different data types
*/
/* ----------------------------------------------------------
** functions used for converting between different data types
** ---------------------------------------------------------*/
#ifndef TYPECONVERTER_H_INCLUDED
#define TYPECONVERTER_H_INCLUDED
/**
converts binary to decimal
@return converted decimal number
*/
int toDecimal(bool binary[], int noOfNumbers);
/**
converts decimal to binary and stores it in a given array
*/
void toBinary(int origin[], bool binary[], int noOfNumbers);
#endif // TYPECONVERTER_H_INCLUDED
如何评论这个 header 的作用,以便 Doxygen 理解它?现在它只是将顶部评论分配给第一个函数。
Doxygen 有一个 \file
命令,可以将注释块标记为记录某个文件。当用作\file filename.ext
时,它会将其分配给文件filename.ext
。正如 \file
,它适用于它出现的文件。
示例:
/**
@file
functions used for converting between different data types
*/