Can I use an existing code range (means some lines of code from a cpp
file) as example in the doxygen docu?
/*!
* \brief My Foo class
* \details More about foo
* \example?? Foo used like here, some LOC from cpp follow (how can I do that??)
*/
class Foo
I want to show 3-10 lines of existing code of how I have used Foo
. Those 3-10 line are supposed to come from a cpp
file.
I understand that I have to tag the very cpp
file with \file
, but how do I refer to some lines of code there?
Something like this (incorrect pseudo code, as I have no idea how to do it)
somewhereelse.cpp
...
...
//! \example Foo (supposed to display with Foo docu). This is how Foo is used
//! @{
Foo f;
f.init(); // init first
f.start(); // then start
//! }@
...