2017-05-24 23 views
0

假设我有一个头文件,其中包含一些函数和多个源文件,用于实现头提供的函数。 我想记录使用Doxygen的功能,但只有关于所有实现的一般意见,而不是实现特定的。Doxygen:记录具有多个实现的单个API

什么是仅查看标题注释的最佳方式?我无法将配置设置为忽略所有源文件,因为项目中的某些其他源文件根本没有标题。

例如:

api.h

/** 
* @details 
* This is general comment for header 
* 
*********************************************************************/ 

implemenation1.c

/** 
* @details 
* This is implementation specific comment for file 1 
* 
*********************************************************************/ 
int foo(int a, int b) 
{ 
    ... 
} 

implemenation2.c

/** 
* @details 
* This is implementation specific comment for file 2 
* 
*********************************************************************/ 
int foo(int a, int b) 
{ 
    ... 
} 

我只想看到Doxygen的这一评论:

This is general comment for header 

提前感谢!

+1

也许看看\ cond和\ if如何构造? – albert

+0

是的,即使我希望有一个更优雅的解决方案,那就解决了它。 – Vardit

回答

0

到目前为止,我已经找到了最好的solultion是这样的:

api.h

/** 
* @details 
* This is general comment for header 
* 
*********************************************************************/ 

implemenation1.c

/** 
* @details 
* This is implementation specific comment for file 1 
* 
* @cond 
*********************************************************************/ 

int foo(int a, int b) 
{ 
    ... 
} 

/** @endcond */ 

implemenation2.c

/** 
* @details 
* This is implementation specific comment for file 2 
* 
* @cond 
*********************************************************************/ 

int foo(int a, int b) 
{ 
    ... 
} 

/** @endcond */ 
+0

我甚至会将cond移动到文档块中。 – albert

+0

完成。谢谢! :) – Vardit

+0

我的意思是甚至超过细节,只是检查结果。 – albert