如何在 doxygen 中告诉函数参数应该是确定的定义指令
how in doxygen tell a function param should be certain define directive
我有一些遗留函数,在输入中只接受一些整数。如何正确记录它们并说明函数的输入只能是定义的项目之一?
#define API_TYPE1 0
#define API_TYPE2 1
/**
* @param[in] argument1 can be either @sa API_TYPE1 or @sa API_TYPE2
*/
int TestAPI(
int argument1,
string argument2
);
// usage should be like this
TestAPI(API_TYPE1, "http://someurl.com");
根据我对问题的评论提出的一些建议:
/// \file
/// the meaning
#define API_TYPE1 0
/// the meaning
#define API_TYPE2 1
// * @param[in] argument2 can be either @sa API_TYPE1 or @sa API_TYPE2
/**
* @param[in] argument1 can be either @ref API_TYPE1 or @ref API_TYPE2
* @param[in] argument2 can be either:
* - @ref API_TYPE1
* - @ref API_TYPE2
*/
int TestAPI(
int argument1,
int argument2
);
给予:
我有一些遗留函数,在输入中只接受一些整数。如何正确记录它们并说明函数的输入只能是定义的项目之一?
#define API_TYPE1 0
#define API_TYPE2 1
/**
* @param[in] argument1 can be either @sa API_TYPE1 or @sa API_TYPE2
*/
int TestAPI(
int argument1,
string argument2
);
// usage should be like this
TestAPI(API_TYPE1, "http://someurl.com");
根据我对问题的评论提出的一些建议:
/// \file
/// the meaning
#define API_TYPE1 0
/// the meaning
#define API_TYPE2 1
// * @param[in] argument2 can be either @sa API_TYPE1 or @sa API_TYPE2
/**
* @param[in] argument1 can be either @ref API_TYPE1 or @ref API_TYPE2
* @param[in] argument2 can be either:
* - @ref API_TYPE1
* - @ref API_TYPE2
*/
int TestAPI(
int argument1,
int argument2
);
给予: