我想使用@overload特殊命令并将WARN_NO_PARAMDOC Doxyfile参数设置为YES,但是当我尝试时,我会收到来自所有重载函数的警告,表明参数未记录。 @overload标记的工作方式与生成的文档中所宣传的一样,只是带有警告。我误解了@overload命令的意图吗?
具体而言,导致问题的代码段似乎是
class ExampleClass {
public:
/// Test Function
/// @details Details on the test function API
/// @param[out] output Output parameter, by pointer
/// @param[out] optionalOutput
/// Output parameter, by pointer, nullptr if not there
/// @param[in,out] mixed Mixed use parameter, by pointer
/// @param[in] input Input parameter, by reference
/// @param[in] defaultParam Default input parameter
/// @returns Return new value
int testFunction(ExampleClass* output, ExampleClass* optionalOutput,
ExampleClass* mixed,
const ExampleClass& input, int defaultParam=1);
/// @overload
int testFunction(ExampleClass* output,
ExampleClass* mixed,
const ExampleClass& input, int defaultParam=1) {
return testFunction(output, nullptr, mixed, input, defaultParam);
}
};
结果警告如下所示:
example_class.h:99: warning: parameters of member ExampleClass::testFunction are not (all) documented
example_class.h:99: warning: return type of member ExampleClass::testFunction is not documented
我在Ubuntu 16.04下使用Doxygen版本1.8.11
答案 0 :(得分:1)
我是否误解了@overload命令的意图?
警告是WARN_NO_PARAMDOC
的结果,只要没有记录参数和返回值,就会发出警告。它不会忽略未记录的参数并返回可能在早期注释块中记录的重载函数的值。
@overload
的目的是显示占位符描述并确保将重载函数的函数描述组合在一起。以下内容可以更好地证明这一点:
class ExampleClass {
public:
/// Test Function
/// @details Details on the test function API
/// @param[out] output Output parameter, by pointer
/// @param[out] optionalOutput
/// Output parameter, by pointer, nullptr if not there
/// @param[in,out] mixed Mixed use parameter, by pointer
/// @param[in] input Input parameter, by reference
/// @param[in] defaultParam Default input parameter
/// @return Return new value
int testFunction(ExampleClass* output, ExampleClass* optionalOutput,
ExampleClass* mixed,
const ExampleClass& input, int defaultParam=1);
/// Another function
/// @details some stuff
/// @param[out] output Output parameter, by pointer
void someOther(ExampleClass* output );
/// @overload
/// @param[out] output Output parameter, by pointer
/// @param[in,out] mixed Mixed use parameter, by pointer
/// @param[in] input Input parameter, by reference
/// @param[in] defaultParam Default input parameter
/// @return Return new value
int testFunction(ExampleClass* output,
ExampleClass* mixed,
const ExampleClass& input, int defaultParam=1);
/// @overload
/// @details some stuff
void someOther();
};
尽管testFunction
和someOther
函数重载交织在一起,但它们在结果文档中组合在一起。