Doxygen Out of Line Documenting for C ++ Class Operators

If I have a class in a file, I cannot change it, but I need to document in doxygen, what is the best way to do this? I know that it would be better to document in a .h or .cpp file, but this is not possible in this particular instance.

I figured out how to document some elements, but I cannot document operators in a reliable way. Let me give you an example. Here is an example of a class with a member that caused problems and one that worked fine:

class Foo
{
public:
    int Bar();
    bool operator!() const;
};

In another file that doxygen is viewing, I added the following:

/// @fn Foo::Bar
/// @brief Some info about the constructor
/// @return Some stuff about what bar returns

The documentation for the constructor works, but it is not:

/// @fn Foo::operator!
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns

no:

/// @fn operator!
/// @memberof Foo
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns

% . , "///@fn% operator!", "///@fn operator%!" "///@fn operator!" .

. doxygen grepping doxygen, . ?

+3
1

doxygen,

/path/to/Documentation: warning: no matching class member found for
  Foo::operator!()
Possible candidates:
  bool Foo::operator!() const

/// @fn Foo::operator!() const
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns

() const, @fn.

+6

Source: https://habr.com/ru/post/1787365/


All Articles