[英]Configure Doxygen to ignore the Source-Code Annotation Language (SAL)
I have some classes that are documented with Doxygen. 我有一些用Doxygen记录的类。 Additionally, they are annotated with Microsoft's Source-Code Annotation Language (SAL) to support static code analysis.
此外,它们还使用Microsoft的源代码注释语言(SAL)进行注释,以支持静态代码分析。
//! The majestic class.
class Foo {
//! \brief do something
//! \param [out] pResult The result value is stored here.
//! \returns The return value Succcess indicates success.
_Success_(return == Success)
virtual Result_t DoSomething(_Out_ uint32_t *pResult) = 0;
};
In this case, Doxygen reports a warning: 在这种情况下,Doxygen将报告警告:
argument 'pResult' of command @param is not found in the argument list of Foo::_Success_(return==Success)=0
在Foo :: _ Success_(return == Success)= 0的参数列表中找不到命令@param的参数'pResult'
So, Doxygen is confused by the annotation statement _Success_()
. 因此,Doxygen被注释语句
_Success_()
弄糊涂了。 How can I hide the return value annotation _Success_(return == Success)
to Doxygen without adding clutter to the source file? 如何在不向源文件添加混乱的情况下将返回值注释
_Success_(return == Success)
隐藏到Doxygen? This does the job, but looks too verbose: 这可以完成工作,但是看起来太冗长:
//! The majestic class.
class Foo {
//! \brief do something
//! \param [out] pResult The result value is stored here.
//! \returns The return value Succcess indicates success.
//! \cond INTERNAL
_Success_(return == Success)
//! \endcond
virtual Result_t DoSomething(_Out_ uint32_t *pResult) = 0;
};
Can this be implemented by configuring Doxygen and leaving the source code untouched? 是否可以通过配置Doxygen并保持源代码不变来实现?
In the doxygen manual in the chapter Preprocessing
there is a part: 在doxygen手册的“
Preprocessing
”一章中,有一部分内容:
A typically example where some help from the preprocessor is needed is when dealing with the language extension from Microsoft:
__declspec
.一个典型的需要预处理器帮助的示例是在处理Microsoft的语言扩展时:
__declspec
。 The same goes for GNU's__attribute__
extension.GNU的
__attribute__
扩展也是如此。 Here is an example function.这是一个示例函数。
In your case the following would probably work: 在您的情况下,以下方法可能会起作用:
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = _Success_(x)=
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.