c++ - How can I include a subset of a .cpp file in a Doxygen comment? -


I am trying to write some Doxygen comment blocks, and I would like to include example snippets of code. Of course, I really want to compile the examples so that they are not stale.

My example is cpp (which is included in i.e.). Looks like this:

  #include "stdafx.h" #include "../types_lib/Time_Limiter.h" #Include & lt; Vector & gt; Zero tl_demo () {// There must be a gate to control some rare resources that should not be more than 10 times the second time_limit rare (10); // Here is a bunch of requests std :: vector & lt; Int & gt; Rake (500); For (size_t i = 0; i  

and my header file (which I'm running Doxygen) looks like this:

 

< / Code> / ** * \ ingroup types_lib * * \ class Time_Limiter * * Brief Thread Safe Gate is used to control a resource (like an Internet quote service), on how often you can call it * * \ DontInclude Time_Limiter_example.cpp * \ skipline zero * \ until the endcode * ** /

and I just start with "zero demo" to add stuff to doxygen. Finally you want to obtain the file (but // without Andkod).

I have tried experimenting with \ dontinclude and \ skip, \ skipline, and \ ', and I can not understand the true sincerity.

Edit: My .h file is also included, and now I have got almost the right recruitment. What exactly do I want to do, is there a way to use without tag, and get rid of the last // endcode line from example.cpp?

Edit to add second ARG to clip macro.

Here I have done what works for me. Most have been taken from the ERIC with the signal ....

My source file is Time_Limiter_example.cpp:

  #include "stdafx.h" #include "../ Types_lib / Time_Limiter.h "#includes & lt; Vector & gt; Zero tl_demo () {// There must be a gate to control some rare resources that should not be more than 10 times the second time_limit rare (10); // Here is a bunch of requests std :: vector & lt; Int & gt; Rake (500); For (size_t i = 0; i  

and I want to include it, but it does not include # Is on top

I have defined an ALIAS in my Doxyfile:

  ALIASES + = clip {2} = "\ dontinclude \ 1 \ n \ skipline \ 2 \ n \ Android " 

And in my header, my comment looks like this:

  / ** * \ ingroup types_lib * * \ class Time_Limiter * * \ Brief Thread Safe Gate is used to control a resource (such as an Internet quote service) on which you can call. * * * Clip {Time_Limiter_example.cpp, tl_demo} ** /  

And that does what I want, which includes just the fun catkin tl_demo () from the .cpp file.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -