问题
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