使用C#内部访问修饰符进行氧气处理

Mik*_*tes 12 c# doxygen

我正在使用Doxygen为我正在开发的C#项目生成一些API文档.我在这个项目中有相当多的"内部"功能,并且不希望Doxygen在它生成的生成的html中生成这些签名.

我已尝试启用HIDE_FRIEND_COMPOUNDS,但这仍会导致我的内部类在生成的文档中公开.

有谁知道如何做到这一点?

thu*_*eys 9

添加到Mac H的答案,你必须设置这些额外的配置参数,使其工作:

# The PREDEFINED tag can be used to specify one or more macro names that 
# are defined before the preprocessor is started (similar to the -D option of 
# gcc).     

PREDEFINED             = internal=private

# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
# will be included in the documentation.  

EXTRACT_PRIVATE        = NO

# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
# evaluate all C-preprocessor directives found in the sources and include 
# files.

ENABLE_PREPROCESSING   = YES

# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
# names in the source code. If set to NO (the default) only conditional 
# compilation will be performed. Macro expansion can be done in a controlled 
# way by setting EXPAND_ONLY_PREDEF to YES.

MACRO_EXPANSION        = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
# then the macro expansion is limited to the macros specified with the 
# PREDEFINED and EXPAND_AS_DEFINED tags.

EXPAND_ONLY_PREDEF     = YES
Run Code Online (Sandbox Code Playgroud)


小智 5

这是旧条目,但我遇到了同样的问题。

对我有用的方法是简单地使用doxygen的“预定义”功能。如果您预定义'internal = private'(相当于执行'#define内部私有'),则Doxygen会将所有“ internal”属性视为“ private”,因此如果需要,请忽略它们。

这是一种想法-但行得通。


Alo*_*lon 1

doxygen 有多种方法通过在配置文件中设置选项来从文档中排除代码。

如果你的方法是私有的,那么设置EXTRACT_PRIVATE = NO

你还可以指定排除模式,例如,如果你的私有类位于名为hidden的目录中,则可以通过设置排除该目录中的所有文件。

EXCLUDE_PATTERNS = */hidden/* 
Run Code Online (Sandbox Code Playgroud)

您还可以通过设置来避免包含未记录的代码。

HIDE_UNDOC_CLASSES = YES
Run Code Online (Sandbox Code Playgroud)

HIDE_UNDOC_MEMBERS = NO
Run Code Online (Sandbox Code Playgroud)