【发布时间】:2012-08-23 08:59:45
【问题描述】:
我正在使用 Doxygen 来记录我的一些代码。我有一个使用默认参数的函数,该参数在标题中指定,即:
unsigned int CountColumns(const std::string&,const std::string& delim="");
以及源文件中对应的实现为:
unsigned int CountColumns(const string& input,const string& delim)
{
...
}
当我使用 Doxygen 生成文档时,CountColumns 有两个条目 - 一个包含默认值,一个不包含:
unsigned int CountColumns (const string &input, const string &delim)
unsigned int CountColumns (const std::string &, const std::string &delim="")
如何避免这种情况?我不希望多个函数定义弄乱我的文档。
编辑:正如我在下面的回答中也提到的,问题似乎是由于头文件在参数中使用“std::string”,而源文件包含“使用 std: :string' 语句,然后在参数中使用 'string'。如果我在源文件中更改函数定义以使用 'std::string',Doxygen 会识别它与标题中声明的函数相同。
【问题讨论】:
-
您是否正在运行 doxygen 来记录实现?
-
我要求它包含源文件,以便我从我的文档中直接链接到 html 形式的源代码,以及记录哪些函数引用了哪些其他函数。你是这个意思吗? (对不起,我还在学习 doxygen 选项)。不过,我已将“INLINE_SOURCES”选项设置为 NO。