Doxygen for documenting overloaded variable functions

Is it possible to make doxygen to create proper documentation for the code as follows:

void Print(const char* pszFormat, ...);
void Print(const wchar_t* pszFormat, ...);

I have two problems with this code. At first, I cannot reference both of these functions from other parts of my code. For \ref Print(const char*, ...);and \ref Print(const wchar_t*, ...);links are created only to one of the above ads.

Also, variable arguments are placed in a predefined format that must be described. Attempting to use the '\ param' tag for it leads to a warning about parameters that are not found in the function declaration. Since I have several such functions, I would like to get rid of warnings specifically for this case, if possible.

Thanks in advance.

+4
source share
2 answers

If you specify the parameter literally as ..., it will be picked up by Doxygen. For instance. as follows: \param[in] ... Arguments for format specification. This will display correctly in your generated documentation.

There is no information about the exception const char*and const wchar_t*though.

+2
source

If you enable AUTOLINK_SUPPORT, which is already enabled by default, it should work without , including \ref. That is, Doxygen sees things that can be related names, and tries to figure them out for you, unless you explicitly call them links. I just checked an example:

/// Get 8 bits of foo
/// @param blah The blah to foo
void getFoo(uint8_t blah) = 0;

/// Get 16 bits of foo
/// @param blah The blah to foo
void getFoo(uint16_t blah) = 0;

/// First, look at getFoo(uint8_t) for info,
/// then look at getFoo(uint16_t) for more
void getBar() = 0;

, getBar(), .

FWIW doxygen (version 1.86) ++, C ++, JAVA_DOC QT, , , ++ Java, .

, , , , , , , .

/// Bar some foos with extra arguments
/// @param foo The foo we totally want to bar
/// @return true if we barred
/// Typical usage requires that we either supply the number of times to bar
///  followed by some other baz ...
/// @code
/// uint8_t nbars = 12; // must be uint8_t because of some reason
/// Baz baz = new Baz(); // or some old Baz lying around, doesn't matter
/// bool isBarred = bar(foo, nbars, baz);
/// @code
/// ... OR, we need to supply a list of Baz's, so we know what to do
/// @code
/// Baz manyBaz[]; 
/// // fill in manyBaz with whatever Baz you want
/// bool isBarred - bar(foo, manyBaz);
/// @code
bool bar(foo, ...);

, , , () , @param. , , doxygen ( ) /.

0

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


All Articles