views:

83

answers:

1

Hi,

I have one file (say file1.doxy) with doxygen comments:

/**
 * Comment block 1
*/

...

/**
 * Comment block 2
 */

...

/**
 * Comment block 3
 */

And I want to create the file file2.doxy of which output is the same as:

/**
 * Comment block 1
 *
 * Comment block 3
 */

Actually I want to refer to file file1.doxy from file file2.doxy and not to copy-paste information from file1.doxy, but I can insert needed marking tags into file1.doxy.

Is it possibly to do so with doxygen?

+2  A: 

you could use \verbinclude <file-name>, like this:

file1.doxy:

/**
 * @verbinclude file1.doc
 */
function f1() {}

/**
 * @verbinclude file2.doc
 */
function f2() {}

/**
 * @verbinclude file3.doc
 */
function f3() {}

file2.doxy:

/**
 * @verbinclude file1.doc
 *
 * @verbinclude file3.doc
 */
function f1() {}

with file1.doc, file2.doc, file3.doc containing Comment block 1, Comment block 2, and Comment block 3, respectively. for this to work, you have to set the EXAMPLE_PATH in your Doxyfile to the path of file{1,2,3}.doc (*). this won't expand @ Doxygen commands in file{1,2,3}.doc, though.

an alternative could be using Doxygen preprocessing or INPUT_FILTER.

(*) you might also have to set EXTRACT_ALL to YES

ax