I would really like to use the \snippet function in the manual of my code, since it would embody DRY. However, part of my manual shows a user how to build up an example use case piece by piece for which I would need to include a disjoint snippets with my own code inserted in between. Something like:
Original code:
#include <A.h>
#include <B.h>
#include <C.h>
MyClass:MyClass(const std::string& name)
: BObj_(name)
{
AObj_.setReadyForAction();
AObj_.deactivateSwitching();
}
I would like to include it in my manual as
#include <A.h>
...
MyClass:MyClass(const std::string& name)
: AObj_(name)
{
AObj_.setReadyForAction();
...
}
This would be three snippets (or two if one discounts the closing brace) merged with ...'s inbetween.
I could live without the ...'s, and so could also just see this is a single disjoint snippet.
Is it possible to merge snippets? Is it possible to define a disjoint snippet? Alternatively, is there any way I could include pieces of code just by reference to a line number in the file rather than using defined snippet markers?