Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide a particular function (in c++) in doxygen?

Tags:

c++

doxygen

I have a class which has may functions and i want to hide a particular function. For example

class Test
{

   /**
    * About Function1
    *
    * @param[in]  arg1  About arg1
    * @param[in]  arg2  About arg2
    */        
    public void Function1(int arg1,char arg2);

    // Presume same documentation for this function also
    public void Function2(int,char);

    // Presume same documentation for this function also
    public void Function3(int,char);

    // Presume same documentation for this function also
    public void Function4(int,char);
} 

Suppose I want to hide say Function2 how would I do that.

Now in the current scenario it is displaying all the four functions along with its documentations.

Now, I have the following attribute set in my .doxygen rule file:

EXTRACT_ALL = YES

Can you please suggest me something by which i can hide say Function2?

like image 664
Rana Avatar asked Apr 10 '14 14:04

Rana


People also ask

How do I show code in doxygen?

You can put example source code in a special path defined in the doxygen config under EXAMPLE_PATH , and then insert examples with the @example tag. Doxygen will then generate an extra page containing the source of the example. It will also set a link to it from the class documentation containing the example tag.

Are doxygen commands case sensitive?

It is parsed by doxygen . The file may contain tabs and newlines for formatting purposes. The statements in the file are case-sensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the # character and end at the end of the line.

What is doxygen style comments?

A special comment block is a C or C++ style comment block with some additional markings, so doxygen knows it is a piece of structured text that needs to end up in the generated documentation. The next section presents the various styles supported by doxygen.

What are doxygen tags?

Doxytag is a small command line based utility. It can generate tag files. These tag files can be used with doxygen to generate references to external documentation (i.e. documentation not contained in the input files that are used by doxygen).


1 Answers

If you have EXTRACT_PRIVATE = NO in the config file, then you can mark any member as private to Doxygen and it will not generate documentation for that member:

/// @private
public void Function2(int, char);

Bonus question: if you wanted to use the same documentation for all four members you can do so using one of these approaches:

/**
 * About Function1,2,3,4...
 */
/// @{
public void Function1(int arg1, char arg2);
public void Function2(int arg1, char arg2);
public void Function3(int arg1, char arg2);
public void Function4(int arg1, char arg2);
/// @}

/**
 * About Function1,2,3,4...
 */
public void Function1(int arg1, char arg2);
/// @copydoc Function1
public void Function2(int arg1, char arg2);
/// @copydoc Function1
public void Function3(int arg1, char arg2);
/// @copydoc Function1
public void Function4(int arg1, char arg2);

The one using @{...@} requires the use of DISTRIBUTE_GROUP_DOC = YES in the config file.

like image 94
Oktalist Avatar answered Sep 23 '22 20:09

Oktalist