I have the following problem: I want to add code examples to my doxygen documentation. It works fine, but I have quite some examples, each of which needs to call the same function, say, myInit(). Now, the generated documentation for myInit() contains all examples that use myInit(), which basically means: all examples. I would like to have exactly one example referred to for myInit(), namely that one which demonstrates the usage of it, but not all of them.
Here is an example:
=============== MyEspressoMachine.h ==============
/** @example exTurnOn.cpp */
/** @example exMakeEspresso.cpp */
/** @example exClean.cpp */
/** @example exTurnOff.cpp */
/** My espresso machine. */
class MyEspressoMachine {
public:
/** Turns the espresso machine on */
void turnOn() {};
/** Makes a delicious espresso. */
void makeEspresso() {};
/** Cleans the espresso machine. */
void clean() {};
/** Turns the espresso machine off */
void turnOff() {};
};
=============== exTurnOn.cpp =============
#include "MyEspressoMachine.h"
int main() {
MyEspressoMachine m;
m.turnOn();
m.turnOff();
}
=============== exMakeEspresso.cpp ==============
#include "MyEspressoMachine.h"
int main() {
MyEspressoMachine m;
m.turnOn();
m.makeEspresso();
m.turnOff();
}
=============== exClean.cpp ==============
#include "MyEspressoMachine.h"
int main() {
MyEspressoMachine m;
m.turnOn();
m.clean();
m.turnOff();
}
=============== exTurnOff.cpp ==============
#include "MyEspressoMachine.h"
int main() {
MyEspressoMachine m;
m.turnOn();
m.turnOff();
}
=============== Doxyfile ==============
EXAMPLE_PATH = .
Here is the result (Doxygen 1.8.7):
In my real case, it's not only four examples, but dozens. Though, in the documentation for turnOn, I only want exTurnOn.cpp to appear.
Any ideas?
bye, loki