开发者

Configure Doxygen to hide certain names or keywords

开发者 https://www.devze.com 2023-01-04 14:57 出处:网络
I\'m just getting started with Doxygen, and have done considerable searching on this, so forgive me if there\'s an obvious answer.

I'm just getting started with Doxygen, and have done considerable searching on this, so forgive me if there's an obvious answer.

I'm working on an embedded project where functions can be tagged as debug or nodebug before the return type. In most of our libraries, we use a conditional macro to set libname_debug to either debug or nodebug at the top of the file, and then each function is prefaced with libname_debug.

For documentation purposes, I'd like to have Doxygen leave libname_debug out of the function documentation. It clutters up the function list and makes it harder to see the return types of each function.

Is it possible to tag the file in some way so Doxygen will leave that symbol out? At the moment, I'm wrapping each instance in @cond/@endcond:

/** @cond */ libname_debug /** @endcond */

But that's a pain and adds extra marku开发者_如何学Cp to the source.


There is also a doxygen page explaining how to handle such situations. You would enable MACRO_EXPANSION (which defaults to NO), tell doxygen to only expand some macros (EXPAND_ONLY_PREDEF) and add your symbol as macro with an empty expansion:

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = YES
PREDEFINED             = libname_debug=


You can define macros in the doxygen configuration file. Something like this

PREDEFINED += libname_debug
0

精彩评论

暂无评论...
验证码 换一张
取 消