Unable to generate documentation for function definition followed by some macro #defines

∥☆過路亽.° 提交于 2019-12-11 08:15:08

问题


I have a .cpp file and found that Doxygen is unable to document a function which contains the following format:

//!
//! \brief Test
//!        and perform operations on those points.
//!
void CTest::TestTri()
EH_Start("CTest::TestTri")
{
}
EH_Stop

The EH_Start and EH_Stop are an exception handling mechanism, and causing issues.

How can we exclude those?


回答1:


Try using a more explicit doxygen format - the following tells doxygen exactly which function you wish to document, so it doesn't have to understand your code to work out what to attach the documentation to:

/// \fn void CTest::TestTri()
/// \brief Test and perform operations on those points
EH_STart("CTest::TestTri") {} EH_Stop



回答2:


Assuming EH_Start and EH_Stop are defines, you can have doxygen expand those macros when it processes the code

EXPAND_AS_DEFINED = EH_Start EH_Stop

We have a number of macros for function and class declarations. Without EXPAND_AS_DEFINED, doxygen will not generate the correct documentation

For example:

/* C++ Code */
#define STANDARD_CONSTRUCTORS_HEADER(iCLASS) \
  public:  iCLASS(); \
  public:  virtual ~iCLASS(); \
  private: iCLASS(const iCLASS & iCopy); \
  private: iCLASS& operator=(const iCLASS &);

class Foo {
  STANDARD_CONSTRUCTORS_HEADER(Foo)
}

/* Doxyfile */
EXPAND_AS_DEFINED = STANDARD_CONSTRUCTORS_HEADER

Without EXPAND_AS_DEFINED, you won't get the Foo constructors in the documentation.



来源:https://stackoverflow.com/questions/973903/unable-to-generate-documentation-for-function-definition-followed-by-some-macro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!