Special Commands

All commands in the documentation start with a backslash (\) or an at-sign (@). Some commands have one or more arguments. Each argument has a certain range:

If [square] brackets are used the argument is optional.

Here is an alphabetically sorted list of all commands with references to their documentation:

The following subsections provide a list of all commands that are recognized by Doxygen. Unrecognized commands are treated as normal text.

--- Structural indicators ---

\class <name> [<header-file>] [<header-name>]

Indicates that a comment block contains documentation for a class with name <name>. Optionally a header file and a header name can be specified. If the header-file is specified, a link to a verbatim copy of the header will be included in the HTML documentation. The <header-name> argument can be used to overwrite the name of the link that is used in the class documentation to something other than <header-file>. This can be useful if the include name is not located on the default include path (like <X11/X.h>).

Example:
/* A dummy class */

class Test
{
}

/*! \class Test class.h inc/class.h
 *  \brief This is a test class.
 *
 * Some details about the Test class
 */
Click here for the corresponding HTML documentation that is generated by Doxygen.


\code

Starts a block of code. A code block is treated differently from ordinary text. It is interpreted as C/C++ code. The names of the classes and members that are documented are automatically replaced by links to the documentation.

See also:
section "\endcode", section "\verbatim"


\def <name>

Indicates that a comment block contains documentation for a #define macro.

Example:
/*! \file define.h
    \brief testing defines
    
    This is to test the documentation of defines.
*/

/*! \def ABS(x)
   The define ABS computes the absolute value of its argument \a x.
*/

#define ABS(x) (((x)>0)?(x):-(x))
Click here for the corresponding HTML documentation that is generated by Doxygen.


\defgroup <name> (group title)

Indicates that a comment block contains documentation for a group of classes, files or namespaces. This can be used to categorize classes, files or namespaces, and document those categories.

See also:
section "\ingroup <groupname>"


\endcode

Ends a block of code.

See also:
section "\code"


\enum <name>

Indicates that a comment block contains documentation for an enumeration, with name <name>. If the enum is a member of a class and the documentation block is located outside the class definition, the scope of the class should be specified as well. If a comment block is located directly in front of an enum declaration, the \enum comment may be omitted.

Notice:
The type of an anonymous enum cannot be documented, but the values of an anonymous enum can.

Example:
class Test
{
  public:
    enum TEnum { Val1, Val2 };
};

/*! \class Test
 * The class description.
 */

/*! \enum Test::TEnum
 * A description of the enum type.
 */

/*! \var Test::TEnum Test::Val1
 * The description of the first enum value.
 */
Click here for the corresponding HTML documentation that is generated by Doxygen.


\example <file-name>

Indicates that a comment block contains documentation for a source code example. The name of the source file is <file-name>. The text of this file will be included in the documentation, just after the documentation contained in the comment block. All examples are placed in a list. The source code is scanned for documented members and classes. If any are found, the names are cross-referenced with the documentation.

If more that one source file is needed for the example, the \include command can be used.

Example:
/** A Test class.
 *  More details about this class.
 */

class Test
{
  public:
    /** An example member function.
     *  More details about this function.
     */
    void example();
};

void Test::example() {}

/** \example example_test.cpp
 * This is an example of how to use the Test class.
 * More details about this example.
 */
Where the example file example_test.cpp looks as follows:
void main()
{
  Test t;
  t.example();
}
Click here for the corresponding HTML documentation that is generated by Doxygen.

See also:
section "\include <file-name>".


\file [<name>]

Indicates that a comment block contains documentation for a source or header file with name <name>. The file name may include (part of) the path if the file-name alone is not unique. If the file name is omitted (i.e. the line after \file is left blank) then the documentation block that contains the \file command will belong to the file it is located in.

Important:
The documentation of global functions, variables, typedefs, and enums will only be included in the output if the file they are in is documented as well.

Example:
/** \file file.h
 * A brief file description.
 * A more elaborated file description.
 */

/**
 * A global integer value.
 * More details about this value.
 */
extern int globalValue;
Click here for the corresponding HTML documentation that is generated by Doxygen.


\fn (function declaration)

Indicates that a comment block contains documentation for a function (either global or as a member of a class). This command is needed if a comment block is not located before the function declaration or definition. A full function declaration should be specified after the \fn command. The argument ends at the end of the line.

Example:
class Test
{
  public:
    const char *member(char,int) throw(std::out_of_range);
};

const char *Test::member(char c,int n) throw(std::out_of_range) {}

/*! \class Test
 * \brief Test class.
 *
 * Details about Test.
 */

/*! \fn const char *Test::member(char c,int n) 
 *  \brief A member function.
 *  \param c a character.
 *  \param n an integer.
 *  \exception std::out_of_range parameter is out of range.
 *  \return a character pointer.
 */
Click here for the corresponding HTML documentation that is generated by Doxygen.

See also:
section "\var (variable declaration)"


\ingroup <groupname>

If the \ingroup command is placed in a comment block of a class, file or namespace, then it will be added to the group.

See also:
section "\defgroup <name> (group title)"


\internal

This command writes the message `For internal use only' to the output. All text after a \internal command is ignored.


\namespace <name>

Indicates that a comment block contains documentation for a namespace with name <name>.


\overload [(function declaration)]

This command can be used to generate the following standard text for an overloaded member function:

`This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.'

If the documentation for the overloaded member function is not located in front of the function declaration or definition, the optional argument should be used to specify the correct function.

Any other documentation that is inside the documentation block will by appended after the generated message.

Notice 1:
You are responsible that there is indeed an earlier documented member that is overloaded by this one.
Notice 2:
The \overload command does not work inside a one-line comment.
Example:
class Test 
{
  public:
    void drawRect(int,int,int,int);
    void drawRect(const Rect &r);
};

void Test::drawRect(int x,int y,int w,int h) {}
void Test::drawRect(const Rect &r) {}

/*! \class Test
 *  \brief A short description.
 *   
 *  More text.
 */

/*! \fn void Test::drawRect(int x,int y,int w,int h)
 * This command draws a rectangle with a left upper corner at ( \a x , \a y ),
 * width \a w and height \a h. 
 */

/*!
 * \overload void Test::drawRect(const Rect &r)
 */

Click here for the corresponding HTML documentation that is generated by Doxygen.


\page <name> (title)

Indicates that a comment block contains a piece of documentation that is not directly related to one specific class, file or member. The HTML generator creates a page containing the documentation. The LaTeX generator starts a new section in the chapter `Page documentation'.

Example:
/*! \page page1 A documentation page
  This page contains the subsections \ref subsection1 and \ref subsection2.
  For more info see section \ref page2.
  \subsection subsection1 The first subsection
  Text.
  \subsection subsection2 The second subsection
  More text.
*/

/*! \page page2 Another page
  Even more info.
*/
Click here for the corresponding HTML documentation that is generated by Doxygen.

See also:
section "\section <section-name> (section title)", section "\subsection <subsection-name> (subsection title)", and section "\ref <section-name>"


\relates <name>

This command can be used in the documentation of a non-member function <name>. It puts the function inside the `related function' section of the class documentation. This command is useful for documenting non-friend functions that are nevertheless strongly coupled to a certain class. It prevents the need of having to document a file, but only works for functions.

Example:
/*! 
 * A String class.
 */ 
  
class String
{
  friend int strcmp(const String &,const String &);
};

/*! 
 * Compares two strings.
 */

int strcmp(const String &s1,const String &s2)
{
}

/*! \relates String
 * A string debug function.
 */

void stringDebug()
{
}
Click here for the corresponding HTML documentation that is generated by Doxygen.


\struct <name> [<header-file>] [<header-name>]

Indicates that a comment block contains documentation for a struct with name <name>. The arguments are equal to the \class command.

See also:
section "\class <name> [<header-file>] [<header-name>]".


\union <name> [<header-file>] [<header-name>]

Indicates that a comment block contains documentation for a union with name <name>. The arguments are equal to the \class command.

See also:
section "\class <name> [<header-file>] [<header-name>]".


\var (variable declaration)

Indicates that a comment block contains documentation for a variable, typedef or enum value (either global or as a member of a class). This command is equivalent to \fn.

See also:
section "\fn (function declaration)"


--- Section indicators ---

\author { list of authors }

Starts a paragraph where one or more author names may be entered. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \author commands will be joined into a single paragraph and separated by commas. Alternatively, one \author command may mention several authors. The \author command ends when a blank line or some other sectioning command is encountered.

Example:
/*! \class WindowsNT
 *  \brief Windows Nice Try.
 *  \author Bill Gates
 *  \author Several hundred furry animals gathered in a cave and grooving
 *          with a pit.
 *  \version 4.0
 *  \date    1996-1998
 *  \bug It crashes a lot and requires huge amounts of memory.
 *  \bug The class introduces the more bugs, the longer it is used.
 *  \warning This class may explode in your face.
 *  \warning If you inherit anything from this class, you're doomed.
 */

class WindowsNT {};
Click here for the corresponding HTML documentation that is generated by Doxygen.

See also:
Section "@author { list of authors }".


\brief {brief description}

Starts a paragraph that serves as a brief description. For classes and files the brief description will be used in lists and at the start of the documentation page. For class and file members, the brief description will be placed at the declaration of the member and prepended to the detailed description. A brief description may span several lines (although it is advised to keep it brief!). A brief description ends when a blank line or another sectioning command is encountered. If multiple \brief commands are present they will be joined. See section "\author { list of authors }" for an example.

See also:
Section "@short { brief description }"


\bug { bug description }

Starts a paragraph where one or more bugs may be reported. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \bug commands will be joined into a single paragraph. Each bug description will start on a new line. Alternatively, one \bug command may mention several bugs. The \bug command ends when a blank line or some other sectioning command is encountered. See section "\author { list of authors }" for an example.


\date { date description }

Starts a paragraph where one or more dates may be entered. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \date commands will be joined into a single paragraph. Each date description will start on a new line. Alternatively, one \date command may mention several dates. The \date command ends when a blank line or some other sectioning command is encountered. See section "\author { list of authors }" for an example.

See also:
Section "@date { date description }".


\par (paragraph title) { paragraph }

Starts a paragraph with a user defined heading. The heading is specified using the paragraph title argument and extends until the end of the line. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. The \par command ends when a blank line or some other sectioning command is encountered.

Example:
/*! \class Test
 * Normal text.
 * \par User defined paragraph:
 * Contents of the paragraph.
 *
 * More normal text. 
 */
  
class Test {};
Click here for the corresponding HTML documentation that is generated by Doxygen.


\param <parameter-name> { parameter description }

Starts a parameter description for a function parameter with name <parameter-name>. Followed by a description of the parameter. The existence of the parameter is not checked. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \param commands will be joined into a single paragraph. Each parameter description will start on a new line. The \param description ends when a blank line or some other sectioning command is encountered. See section "\fn (function declaration)" for an example.

See also:
Section "@param <parameter-name> { parameter-description }".


\exception <exception-object> { exception description }

Starts an exception description for an exception object with name <exception-object>. Followed by a description of the exception. The existence of the exception object is not checked. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \exception commands will be joined into a single paragraph. Each parameter description will start on a new line. The \exception description ends when a blank line or some other sectioning command is encountered. See section "\fn (function declaration)" for an example.

See also:
Section "@exception <exception-object> { exception-description }".


\return { description of the return value }

Starts a return value description for a function. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \return commands will be joined into a single paragraph. The \return description ends when a blank line or some other sectioning command is encountered. See section "\fn (function declaration)" for an example.

See also:
Section "@return { description of the return value }".


\sa { references }

Starts a paragraph where one or more cross-references to classes, functions, methods, variables, files or URL may be specified. The separators :: and # may be used to separate a class from the name of its members. One of several overloaded methods or constructors may be selected by including a parenthesized list of argument types after the method.

See also:
section "Automatic link generation" for information on how to create links to objects and section "@see { references }" for the JavaDoc version of this command.


\version { version number }

Starts a paragraph where one or more version strings may be entered. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \version commands will be joined into a single paragraph. Each version description will start on a new line. Alternatively, one \version command may mention several dates. The \version command ends when a blank line or some other sectioning command is encountered. See section "\author { list of authors }" for an example.

See also:
Section "@version { version number }".


\warning { warning message }

Starts a paragraph where one or more warning messages may be entered. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \warning commands will be joined into a single paragraph. Each warning description will start on a new line. Alternatively, one \warning command may mention several warnings. The \warning command ends when a blank line or some other sectioning command is encountered. See section "\author { list of authors }" for an example.

--- Commands to create links ---

\addindex <word>

This command adds <word> to the LaTeX index.

\endlink

This command ends a link that is started with the \link command.

See also:
section "\link <link-object>".


\link <link-object>

The links that are automatically generated by Doxygen always have the name of the object they point to as link-text.

The \link command can be used to create a link to an object (a file, class, or member) with a user specified link-text. The link command should end with an \endlink command. All text between the \link and \endlink commands serves as text for a link to the <link-object> specified as the first argument of \link.

See section "Automatic link generation" for more information on automatically generated links and valid link-objects.

Notice: Keep in mind that links are only meaningful in HTML text; in LaTeX text, the link text is just written to the output.


\ref <section-name>

Creates a reference to a named section, subsection, or page. For HTML documentation the reference command will generate a link to the section, the title of the section will be used as the link text. For LaTeX documentation the reference command will generate a section number.

See section "\page <name> (title)" for an example of the \ref command.


\section <section-name> (section title)

Creates a section with name <section-name>. The title of the section should be specified as the second argument of the \section command

See section "\page <name> (title)" for an example of the \cmdsection command.


\subsection <subsection-name> (subsection title)

Creates a subsection with name <subsection-name>. The title of the subsection should be specified as the second argument of the \subsection command.

See section "\page <name> (title)" for an example of the \cmdsubsection command.


--- Commands for displaying examples ---

\dontinclude <file-name>

This command can be used to parse a source file without actually including it. Any class and member declarations inside the code are `remembered' during the parsing of the comment block that contained the \dontinclude command.

For line by line description of source files, one or more lines of the example can be displayed using the \line, \skip, \skipline, and \until commands. An internal pointer is used for these commands. The \dontinclude command sets the pointer to the first line of the example.

Example:
/*! A test class. */

class Test
{
  public:
    /// a member function
    void example();
};

/*! \page example
 *  \dontinclude example_test.cpp
 *  Our main function starts like this:
 *  \skip main
 *  \until {
 *  First we create a object \c t of the Test class.
 *  \skipline Test
 *  Then we call the example member function 
 *  \line example
 *  After that our little test routine ends.
 *  \line }
 */
Where the example file example_test.cpp looks as follows:
void main()
{
  Test t;
  t.example();
}
Click here for the corresponding HTML documentation that is generated by Doxygen.

See also:
sections "\line ( pattern )", "\skip ( pattern )", "\skipline ( pattern )", and "\until ( pattern )".


\include <file-name>

This command can be used to include a source file as a block of code. The command takes the name of an include file as an argument. Include files or directories can be specified using the INCLUDE_PATH tag of Doxygen's configuration file.

Using the \include command is equivalent to inserting the file into the documentation block and surrounding it with \code and \endcode commands.

The main purpose of the \include command is to avoid code duplication in case of example blocks that consist of multiple source and header files.

For line by line description of source files, one or more lines of the example can be displayed using the \line, \skip, \skipline, and \until commands. An internal pointer is used for these command. The \include command sets the pointer to the first line of the example.

See also:
section "\example <file-name>" and "\dontinclude <file-name>".


\line ( pattern )

This command searches line by line through the example that was last included using \include or \dontinclude until it finds a non-blank line. If that line contains the specified pattern, it is written to the output.

The internal pointer that is used to keep track of the current line in the example, is set to the start of the line following the non-blank line that was found (or to the end of the example if no such line could be found).

See section "\dontinclude <file-name>" for an example.


\skip ( pattern )

This command searches line by line through the example that was last included using \include or \dontinclude until it finds a line that contains the specified pattern.

The internal pointer that is used to keep track of the current line in the example, is set to the start of the line that contains the specified pattern (or to the end of the example if the pattern could not be found).

See section "\dontinclude <file-name>" for an example.


\skipline ( pattern )

This command searches line by line through the example that was last included using \include or \dontinclude until it finds a line that contains the specified pattern. It then writes the line to the output.

The internal pointer that is used to keep track of the current line in the example, is set to the start of the line following the line that is written (or to the end of the example if the pattern could not be found).

Notice:
The command:
\skipline pattern
is equivalent to:
\skip pattern
\line pattern

See section "\dontinclude <file-name>" for an example.


\until ( pattern )

This command writes all lines of the example that was last included using \include or \dontinclude to the output, until it finds a line containing the specified pattern. The line containing the pattern will be written as well.

The internal pointer that is used to keep track of the current line in the example, is set to the start of the line following last written line (or to the end of the example if the pattern could not be found).

See section "\dontinclude <file-name>" for an example.


\verbinclude <file-name>

This command includes the file <file-name> verbatim in the documentation. The command is equivalent to pasting the file in the documentation and placing \verbatim and \endverbatim commands around it.


--- Commands for visual enhancements ---

\a <word>

Displays the argument <word> using a special font. Use this command to refer to member arguments in the running text.

Example:
  ... the \a x and \y coordinates are used to ...
  
This will result in the following text:

... the x and y coordinates are used to ...


\arg { item-description }

This command has one argument that continues until the first blank line or until another \arg is encountered. The command can be used to generate a simple, not nested list of arguments. Each argument should start with a \arg command.

Example:
Typing:
  \arg \c AlignLeft left alignment.
  \arg \c AlignCenter center alignment.
  \arg \c AlignRight right alignment
  
  No other types of alignment are supported.
  
will result in the following text:


No other types of alignment are supported.

Notice:
For nested lists, HTML commands should be used.


\b <word>

Displays the argument <word> using a bold font. Equivalent to <b>word</b>.


\c <word>

Displays the argument <word> using a typewriter font. Use this to refer to a word of code. Equivalent to <b>word</b>.

Example:
Typing:
     ... This function returns \c void and not \c int ...
  
will result in the following text:

... This function returns void and not int ...


\e <word>

Displays the argument <word> in italics. Use this command to emphasize words.

Example:
Typing:
  ... this is a \e really good example ... 
  
will result in the following text:

... this is a really good example ...


\endhtmlonly

Ends a block of text that was started with a \htmlonly command.

See also:
section "\htmlonly".


\endlatexonly

Ends a block of text that was started with a \latexonly command.

See also:
section "\latexonly".


\endverbatim

Ends a block of text that was started with a \verbatim command.

See also:
section "\verbatim".


\f$

Marks the start and end of an in-text formula.

See also:
section "Including formulas in the documentation" for an example.


\f[

Marks the start of a long formula that is displayed centered on a separate line.

See also:
section "\f]" and section "Including formulas in the documentation".


\f]

Marks the end of a long formula that is displayed centered on a separate line.

See also:
section "\f[" and section "Including formulas in the documentation".


\htmlonly

Starts a block of text that will be verbatim included in the generated HTML documentation only. The block ends with a endhtmlonly command.

This command can be used to include HTML code that is too complex for Doxygen (i.e. images, applets, java-scripts, and HTML tags that require attributes). You can use the \latexonly and \endlatexonly pair to provide a proper LaTeX alternative.

Notice: environment variables (like $(HOME) ) are resolved inside a HTML-only block.

See also:
section "\htmlonly" and section "\latexonly".


\latexonly

Starts a block of text that will be verbatim included in the generated LaTeX documentation only. The block ends with a endlatexonly command.

This command can be used to include LaTeX code that is too complex for Doxygen (i.e. images, formulas, special characters). You can use the \htmlonly and \endhtmlonly pair to provide a proper HTML alternative.

Notice: environment variables (like $(HOME) ) are resolved inside a LaTeX-only block.

See also:
section "\latexonly" and section "\htmlonly".


\verbatim

Starts a block of text that will be verbatim included in both the HTML and the LaTeX documentation. The block should end with a \endverbatim block. All commands are disabled in a verbatim block.

Warning:
Make sure you include a \endverbatim command for each \verbatim command or the parser will get confused!


\\

This command writes a backslash character (\) to the HTML and LaTeX output. The backslash has to be escaped in some cases because Doxygen uses it to detect commands.


\@

This command writes an at-sign (@) to the HTML and LaTeX output. The at-sign has to be escaped in some cases because Doxygen uses it to detect JavaDoc commands.


\&

This command writes the & character to the HTML and LaTeX output. This character has to be escaped because it has a special meaning in HTML.


\$

This command writes the $ character to the HTML and LaTeX output. This character has to be escaped in some cases, because it is used to expand environment variables.


\#

This command writes the # character to the HTML and LaTeX output. This character has to be escaped in some cases, because it is used to refer to documented entities.


\<

This command writes the < character to the HTML and LaTeX output. This character has to be escaped because it has a special meaning in HTML.


\>

This command writes the > character to the HTML and LaTeX output. This character has to be escaped because it has a special meaning in HTML.


--- Commands included for JavaDoc compatibility ---

The following command JavaDoc command are support.

@author { list of authors }

Equivalent to \author (see section "\author { list of authors }").

@date { date description }

Equivalent to \date (see section "\date { date description }").

@param <parameter-name> { parameter-description }

Equivalent to \param (see section "\param <parameter-name> { parameter description }").

@exception <exception-object> { exception-description }

Equivalent to \exception (see section "\exception <exception-object> { exception description }").

@return { description of the return value }

Equivalent to \return (see section "\return { description of the return value }").

@see { references }

Equivalent to \sa (see section "\sa { references }").

@short { brief description }

Equivalent to \brief (see section "\brief {brief description}").

@version { version number }

Equivalent to \version (see section "\version { version number }").

--- Commands included for Qt compatibility ---

The following commands are supported to remain compatible to the Qt class browser generator. Do not use these commands in your own documentation.


Generated at Fri Apr 23 13:59:37 1999 by doxygen  written by Dimitri van Heesch, © 1997-1999