\etocsetnexttocdepth{5}
\localtableofcontents
The executable {\ttfamily doxygen} is the main program that parses the sources and generates the documentation. See section \mbox{\hyperlink{doxygen_usage}{Doxygen usage}} for more detailed usage information.

Optionally, the executable {\ttfamily doxywizard} can be used, which is a \mbox{\hyperlink{doxywizard_usage}{graphical front-\/end}} for editing the configuration file that is used by doxygen and for running doxygen in a graphical environment. For Mac OS X doxywizard will be started by clicking on the doxygen application icon.

The following figure shows the relation between the tools and the flow of information between them (it looks complex but that\textquotesingle{}s only because it tries to be complete)\+:

 
\begin{DoxyImage}
\includegraphics[width=14cm]{infoflow}
\doxyfigcaption{Doxygen information flow}
\end{DoxyImage}
\hypertarget{starting_step0}{}\section{Step 0\+: Check if doxygen supports your programming language}\label{starting_step0}
First, assure that your programming language has a reasonable chance of being recognized by doxygen. These languages are supported by default\+: C, C++, C\#, Objective-\/C, I\+DL, Java, V\+H\+DL, P\+HP, Python, Tcl, Fortran, and D. It is possible to configure certain file type extensions to use certain parsers\+: see the \mbox{\hyperlink{config_cfg_extension_mapping}{Configuration/\+Extension\+Mappings}} for details. Also, completely different languages can be supported by using preprocessor programs\+: see the \href{http://www.doxygen.org/helpers.html}{\texttt{ Helpers page}} for details.\hypertarget{starting_step1}{}\section{Step 1\+: Creating a configuration file}\label{starting_step1}
Doxygen uses a configuration file to determine all of its settings. Each project should get its own configuration file. A project can consist of a single source file, but can also be an entire source tree that is recursively scanned.

To simplify the creation of a configuration file, doxygen can create a template configuration file for you. To do this call {\ttfamily doxygen} from the command line with the {\ttfamily -\/g} option\+: \begin{DoxyVerb}doxygen -g <config-file>
\end{DoxyVerb}


where $<$config-\/file$>$ is the name of the configuration file. If you omit the file name, a file named {\ttfamily Doxyfile} will be created. If a file with the name $<$config-\/file$>$ already exists, doxygen will rename it to $<$config-\/file$>$.bak before generating the configuration template. If you use {\ttfamily -\/} (i.\+e. the minus sign) as the file name then doxygen will try to read the configuration file from standard input ({\ttfamily stdin}), which can be useful for scripting.

The configuration file has a format that is similar to that of a (simple) Makefile. It consists of a number of assignments (tags) of the form\+:

{\ttfamily T\+A\+G\+N\+A\+ME = V\+A\+L\+UE} or ~\newline
 {\ttfamily T\+A\+G\+N\+A\+ME = V\+A\+L\+U\+E1 V\+A\+L\+U\+E2 ... }~\newline


You can probably leave the values of most tags in a generated template configuration file to their default value. See section \mbox{\hyperlink{config}{Configuration}} for more details about the configuration file.

If you do not wish to edit the configuration file with a text editor, you should have a look at \mbox{\hyperlink{doxywizard_usage}{doxywizard}}, which is a G\+UI front-\/end that can create, read and write doxygen configuration files, and allows setting configuration options by entering them via dialogs.

For a small project consisting of a few C and/or C++ source and header files, you can leave \mbox{\hyperlink{config_cfg_input}{I\+N\+P\+UT}} tag empty and doxygen will search for sources in the current directory.

If you have a larger project consisting of a source directory or tree you should assign the root directory or directories to the \mbox{\hyperlink{config_cfg_input}{I\+N\+P\+UT}} tag, and add one or more file patterns to the \mbox{\hyperlink{config_cfg_file_patterns}{F\+I\+L\+E\+\_\+\+P\+A\+T\+T\+E\+R\+NS}} tag (for instance {\ttfamily $\ast$.cpp $\ast$.h}). Only files that match one of the patterns will be parsed (if the patterns are omitted a list of typical patterns is used for the types of files doxygen supports). For recursive parsing of a source tree you must set the \mbox{\hyperlink{config_cfg_recursive}{R\+E\+C\+U\+R\+S\+I\+VE}} tag to {\ttfamily Y\+ES}. To further fine-\/tune the list of files that is parsed the \mbox{\hyperlink{config_cfg_exclude}{E\+X\+C\+L\+U\+DE}} and \mbox{\hyperlink{config_cfg_exclude_patterns}{E\+X\+C\+L\+U\+D\+E\+\_\+\+P\+A\+T\+T\+E\+R\+NS}} tags can be used. To omit all {\ttfamily test} directories from a source tree for instance, one could use\+:

\begin{DoxyVerb}EXCLUDE_PATTERNS = */test/* 
\end{DoxyVerb}


Doxygen looks at the file\textquotesingle{}s extension to determine how to parse a file, using the following table\+:

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{6}{|X[-1]}|}
\hline
\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language  }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language  }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language   }\\\cline{1-6}
\endfirsthead
\hline
\endfoot
\hline
\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language  }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language  }&\PBS\raggedleft \cellcolor{\tableheadbgcolor}\textbf{ Extension  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Language   }\\\cline{1-6}
\endhead
\PBS\raggedleft .dox  &C / C++  &\PBS\raggedleft .idl  &I\+DL  &\PBS\raggedleft .f  &Fortran   \\\cline{1-6}
\PBS\raggedleft .doc  &C / C++  &\PBS\raggedleft .ddl  &I\+DL  &\PBS\raggedleft .for  &Fortran   \\\cline{1-6}
\PBS\raggedleft .c  &C / C++  &\PBS\raggedleft .odl  &I\+DL  &\PBS\raggedleft .f90  &Fortran   \\\cline{1-6}
\PBS\raggedleft .cc  &C / C++  &\PBS\raggedleft .java  &Java  &\PBS\raggedleft .f95  &Fortran   \\\cline{1-6}
\PBS\raggedleft .cxx  &C / C++  &\PBS\raggedleft .cs  &C\#  &\PBS\raggedleft .f03  &Fortran   \\\cline{1-6}
\PBS\raggedleft .cpp  &C / C++  &\PBS\raggedleft .d  &D  &\PBS\raggedleft .f08  &Fortran   \\\cline{1-6}
\PBS\raggedleft .c++  &C / C++  &\PBS\raggedleft .php  &P\+HP  &\PBS\raggedleft .vhd  &V\+H\+DL   \\\cline{1-6}
\PBS\raggedleft .ii  &C / C++  &\PBS\raggedleft .php4  &P\+HP  &\PBS\raggedleft .vhdl  &V\+H\+DL   \\\cline{1-6}
\PBS\raggedleft .ixx  &C / C++  &\PBS\raggedleft .php5  &P\+HP  &\PBS\raggedleft .ucf  &V\+H\+DL   \\\cline{1-6}
\PBS\raggedleft .ipp  &C / C++  &\PBS\raggedleft .inc  &P\+HP  &\PBS\raggedleft .qsf  &V\+H\+DL   \\\cline{1-6}
\PBS\raggedleft .i++  &C / C++  &\PBS\raggedleft .phtml  &P\+HP  &\PBS\raggedleft .tcl  &T\+CL   \\\cline{1-6}
\PBS\raggedleft .inl  &C / C++  &\PBS\raggedleft .m  &Objective-\/C  &\PBS\raggedleft .md  &Markdown   \\\cline{1-6}
\PBS\raggedleft .h  &C / C++  &\PBS\raggedleft .M  &Objective-\/C  &\PBS\raggedleft .markdown  &Markdown   \\\cline{1-6}
\PBS\raggedleft .H  &C / C++  &\PBS\raggedleft .py  &Python  &\PBS\raggedleft .ice  &Slice   \\\cline{1-6}
\PBS\raggedleft .hh  &C / C++  &\PBS\raggedleft .pyw  &Python  &\PBS\raggedleft &\\\cline{1-6}
\PBS\raggedleft .HH  &C / C++  &\PBS\raggedleft &&\PBS\raggedleft &\\\cline{1-6}
\PBS\raggedleft .hxx  &C / C++  &\PBS\raggedleft &&\PBS\raggedleft &\\\cline{1-6}
\PBS\raggedleft .hpp  &C / C++  &\PBS\raggedleft &&\PBS\raggedleft &\\\cline{1-6}
\PBS\raggedleft .h++  &C / C++  &\PBS\raggedleft &&\PBS\raggedleft &\\\cline{1-6}
\PBS\raggedleft .mm  &C / C++  &\PBS\raggedleft &&\PBS\raggedleft &\\\cline{1-6}
\end{longtabu}


Any other extension is not parsed unless it is added to \mbox{\hyperlink{config_cfg_file_patterns}{F\+I\+L\+E\+\_\+\+P\+A\+T\+T\+E\+R\+NS}} and the appropriate \mbox{\hyperlink{config_cfg_extension_mapping}{E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+M\+A\+P\+P\+I\+NG}} is set.

\label{starting_extract_all}%
\Hypertarget{starting_extract_all}%
If you start using doxygen for an existing project (thus without any documentation that doxygen is aware of), you can still get an idea of what the structure is and how the documented result would look like. To do so, you must set the \mbox{\hyperlink{config_cfg_extract_all}{E\+X\+T\+R\+A\+C\+T\+\_\+\+A\+LL}} tag in the configuration file to {\ttfamily Y\+ES}. Then, doxygen will pretend everything in your sources is documented. Please note that as a consequence warnings about undocumented members will not be generated as long as \mbox{\hyperlink{config_cfg_extract_all}{E\+X\+T\+R\+A\+C\+T\+\_\+\+A\+LL}} is set to {\ttfamily Y\+ES}.

To analyze an existing piece of software it is useful to cross-\/reference a (documented) entity with its definition in the source files. Doxygen will generate such cross-\/references if you set the \mbox{\hyperlink{config_cfg_source_browser}{S\+O\+U\+R\+C\+E\+\_\+\+B\+R\+O\+W\+S\+ER}} tag to {\ttfamily Y\+ES}.

It can also include the sources directly into the documentation by setting \mbox{\hyperlink{config_cfg_inline_sources}{I\+N\+L\+I\+N\+E\+\_\+\+S\+O\+U\+R\+C\+ES}} to {\ttfamily Y\+ES} (this can be handy for code reviews for instance).\hypertarget{starting_step2}{}\section{Step 2\+: Running doxygen}\label{starting_step2}
To generate the documentation you can now enter\+: \begin{DoxyVerb}doxygen <config-file>
\end{DoxyVerb}


Depending on your settings doxygen will create {\ttfamily html}, {\ttfamily rtf}, {\ttfamily latex}, {\ttfamily xml}, {\ttfamily man}, and/or docbook directories inside the output directory. As the names suggest these directories contain the generated documentation in H\+T\+ML, R\+TF, $\mbox{\LaTeX}$, X\+ML, Unix-\/\+Man page, and Doc\+Book format.

The default output directory is the directory in which {\ttfamily doxygen} is started. The root directory to which the output is written can be changed using the \mbox{\hyperlink{config_cfg_output_directory}{O\+U\+T\+P\+U\+T\+\_\+\+D\+I\+R\+E\+C\+T\+O\+RY}}. The format specific directory within the output directory can be selected using the \mbox{\hyperlink{config_cfg_html_output}{H\+T\+M\+L\+\_\+\+O\+U\+T\+P\+UT}}, \mbox{\hyperlink{config_cfg_rtf_output}{R\+T\+F\+\_\+\+O\+U\+T\+P\+UT}}, \mbox{\hyperlink{config_cfg_latex_output}{L\+A\+T\+E\+X\+\_\+\+O\+U\+T\+P\+UT}}, \mbox{\hyperlink{config_cfg_xml_output}{X\+M\+L\+\_\+\+O\+U\+T\+P\+UT}}, \mbox{\hyperlink{config_cfg_man_output}{M\+A\+N\+\_\+\+O\+U\+T\+P\+UT}}, and \mbox{\hyperlink{config_cfg_docbook_output}{D\+O\+C\+B\+O\+O\+K\+\_\+\+O\+U\+T\+P\+UT}}. tags of the configuration file. If the output directory does not exist, {\ttfamily doxygen} will try to create it for you (but it will {\itshape not} try to create a whole path recursively, like {\ttfamily mkdir -\/p} does).\hypertarget{starting_html_out}{}\subsection{H\+T\+M\+L output}\label{starting_html_out}
\index{browser@{browser}} The generated H\+T\+ML documentation can be viewed by pointing a H\+T\+ML browser to the {\ttfamily index.\+html} file in the {\ttfamily html} directory. For the best results a browser that supports cascading style sheets (C\+SS) should be used (I\textquotesingle{}m using Mozilla Firefox, Google Chrome, Safari, and sometimes I\+E8, I\+E9, and Opera to test the generated output).

Some of the features the H\+T\+ML section (such as \mbox{\hyperlink{config_cfg_generate_treeview}{G\+E\+N\+E\+R\+A\+T\+E\+\_\+\+T\+R\+E\+E\+V\+I\+EW}} or the search engine) require a browser that supports Dynamic H\+T\+ML and Javascript enabled.\hypertarget{starting_latex_out}{}\subsection{La\+Te\+X output}\label{starting_latex_out}
\index{LaTeX@{LaTeX}} The generated $\mbox{\LaTeX}$ documentation must first be compiled by a $\mbox{\LaTeX}$ compiler (I use a recent te\+TeX distribution for Linux and Mac\+O\+SX and Mik\+Tex for Windows). To simplify the process of compiling the generated documentation, {\ttfamily doxygen} writes a {\ttfamily Makefile} into the {\ttfamily latex} directory (on the Windows platform also a {\ttfamily make.\+bat} batch file is generated).

The contents and targets in the {\ttfamily Makefile} depend on the setting of \mbox{\hyperlink{config_cfg_use_pdflatex}{U\+S\+E\+\_\+\+P\+D\+F\+L\+A\+T\+EX}}. If it is disabled (set to {\ttfamily NO}), then typing {\ttfamily make} in the {\ttfamily latex} directory a {\ttfamily dvi} file called {\ttfamily refman.\+dvi} will be generated. This file can then be viewed using {\ttfamily xdvi} or converted into a Post\+Script file {\ttfamily refman.\+ps} by typing {\ttfamily make ps} (this requires {\ttfamily dvips}).

To put 2 pages on one physical page use {\ttfamily make ps\+\_\+2on1} instead. The resulting Post\+Script file can be send to a Post\+Script printer. If you do not have a Post\+Script printer, you can try to use ghostscript to convert Post\+Script into something your printer understands.

Conversion to P\+DF is also possible if you have installed the ghostscript interpreter; just type {\ttfamily make pdf} (or {\ttfamily make pdf\+\_\+2on1}).

To get the best results for P\+DF output you should set the \mbox{\hyperlink{config_cfg_pdf_hyperlinks}{P\+D\+F\+\_\+\+H\+Y\+P\+E\+R\+L\+I\+N\+KS}} and \mbox{\hyperlink{config_cfg_use_pdflatex}{U\+S\+E\+\_\+\+P\+D\+F\+L\+A\+T\+EX}} tags to {\ttfamily Y\+ES}. In this case the {\ttfamily Makefile} will only contain a target to build {\ttfamily refman.\+pdf} directly.\hypertarget{starting_rtf_out}{}\subsection{R\+T\+F output}\label{starting_rtf_out}
\index{RTF@{RTF}} Doxygen combines the R\+TF output to a single file called refman.\+rtf. This file is optimized for importing into the Microsoft Word. Certain information is encoded using so called fields. To show the actual value you need to select all (Edit -\/ select all) and then toggle fields (right click and select the option from the drop down menu).\hypertarget{starting_xml_out}{}\subsection{X\+M\+L output}\label{starting_xml_out}
\index{XML@{XML}} The X\+ML output consists of a structured \char`\"{}dump\char`\"{} of the information gathered by doxygen. Each compound (class/namespace/file/...) has its own X\+ML file and there is also an index file called {\ttfamily index.\+xml}.

A file called {\ttfamily combine.\+xslt} X\+S\+LT script is also generated and can be used to combine all X\+ML files into a single file.

Doxygen also generates two X\+ML schema files {\ttfamily index.\+xsd} (for the index file) and {\ttfamily compound.\+xsd} (for the compound files). This schema file describes the possible elements, their attributes and how they are structured, i.\+e. it the describes the grammar of the X\+ML files and can be used for validation or to steer X\+S\+LT scripts.

In the {\ttfamily addon/doxmlparser} directory you can find a parser library for reading the X\+ML output produced by doxygen in an incremental way (see {\ttfamily addon/doxmlparser/include/doxmlintf.\+h} for the interface of the library)\hypertarget{starting_man_out}{}\subsection{Man page output}\label{starting_man_out}
\index{man@{man}} The generated man pages can be viewed using the {\ttfamily man} program. You do need to make sure the man directory is in the man path (see the {\ttfamily M\+A\+N\+P\+A\+TH} environment variable). Note that there are some limitations to the capabilities of the man page format, so some information (like class diagrams, cross references and formulas) will be lost.\hypertarget{starting_docbook_out}{}\subsection{Doc\+Book output}\label{starting_docbook_out}
\index{docbook@{docbook}} Doxygen can also generate output in the \href{https://docbook.org/}{\texttt{ Doc\+Book}} format. How to process the Doc\+Book output is beyond the scope of this manual.\hypertarget{starting_step3}{}\section{Step 3\+: Documenting the sources}\label{starting_step3}
Although documenting the sources is presented as step 3, in a new project this should of course be step 1. Here I assume you already have some code and you want doxygen to generate a nice document describing the A\+PI and maybe the internals and some related design documentation as well.

If the \mbox{\hyperlink{config_cfg_extract_all}{E\+X\+T\+R\+A\+C\+T\+\_\+\+A\+LL}} option is set to {\ttfamily NO} in the configuration file (the default), then doxygen will only generate documentation for {\itshape documented} entities. So how do you document these? For members, classes and namespaces there are basically two options\+:
\begin{DoxyEnumerate}
\item Place a {\itshape special} documentation block in front of the declaration or definition of the member, class or namespace. For file, class and namespace members it is also allowed to place the documentation directly after the member.

See section \mbox{\hyperlink{docblocks_specialblock}{Special comment blocks}} to learn more about special documentation blocks.
\item Place a special documentation block somewhere else (another file or another location) {\itshape and} put a {\itshape structural command} in the documentation block. A structural command links a documentation block to a certain entity that can be documented (e.\+g. a member, class, namespace or file).

See section \mbox{\hyperlink{docblocks_structuralcommands}{Documentation at other places}} to learn more about structural commands.
\end{DoxyEnumerate}

The advantage of the first option is that you do not have to repeat the name of the entity.

Files can only be documented using the second option, since there is no way to put a documentation block before a file. Of course, file members (functions, variables, typedefs, defines) do not need an explicit structural command; just putting a special documentation block in front or behind them will work fine.

The text inside a special documentation block is parsed before it is written to the H\+T\+ML and/or $\mbox{\LaTeX}$ output files.

\index{parsing@{parsing}} During parsing the following steps take place\+:
\begin{DoxyItemize}
\item Markdown formatting is replaced by corresponding H\+T\+ML or special commands.
\item The special commands inside the documentation are executed. See section \mbox{\hyperlink{commands}{Special Commands}} for an overview of all commands.
\item If a line starts with some whitespace followed by one or more asterisks ({\ttfamily $\ast$}) and then optionally more whitespace, then all whitespace and asterisks are removed.
\item All resulting blank lines are treated as a paragraph separators. This saves you from placing new-\/paragraph commands yourself in order to make the generated documentation readable.
\item Links are created for words corresponding to documented classes (unless the word is preceded by a \%; then the word will not be linked and the \% sign is removed).
\item Links to members are created when certain patterns are found in the text. See section \mbox{\hyperlink{autolink}{Automatic link generation}} for more information on how the automatic link generation works.
\item H\+T\+ML tags that are in the documentation are interpreted and converted to $\mbox{\LaTeX}$ equivalents for the $\mbox{\LaTeX}$ output. See section \mbox{\hyperlink{htmlcmds}{H\+T\+ML Commands}} for an overview of all supported H\+T\+ML tags.
\end{DoxyItemize}

 