Doxygen的:隐藏私人/保护的方法...和技巧[关闭]
-
05-09-2019 - |
题
我使用Doxygen的产生为我们的API,C#编写的文档。然而,它暴露了私人/ protected成员。有没有一种方法来隐藏这些?
我想出了如何隐藏文件:排除文件名=列表
然而,我需要从不必要API噪声更多的粒度,从而屏蔽用户。样品Doxygen的文件将被理解以及提示/技巧。
你用什么工具来从源代码生成API?
我感到有些留在18世纪,因为我用Doxygen的在C#通过C ++方法。
解决方案
我不知道该怎么好C#是由Doxygen的支持。
有关隐藏私有成员,你改变Doxyfile
配置文件如下:
EXTRACT_PRIVATE = YES
许多其他选项可以用于各种提取/隐藏代码元素,例如来设定,援引Doxyfile
本身:
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in
# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = YES
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
# anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
其他提示
检查出@cond标志doxygen的。在C#我隐藏着一些我们的密码加密的成员如下:
//! @cond
private const String ENCRYPTEDFLAG = "xxxENCFLAGxxx";
private const String SEED = "hi_i_r_@_seed";
//! @endcond
在Doxygen文档会让你相信,你需要定义Doxygen的,并在@cond线使用情况的符号,但没有为我工作。此方法
这工作对我来说,隐藏的代码和文档大块:
/*! \cond PRIVATE */
<here goes private documented source code>
/*! \endcond */
与ENABLED_SECTIONS = PRIVATE
运行以创建文档的内部版本。可以有几个条件和启用/禁用它们根据给观众。
要隐藏只是一个文件块的一部分,则使用\internal
(将隐藏,直到块的端部,除非\endinternal
被发现)
请注意:如果你喜欢它了反斜线,你可以使用@符号
一个几种可能性,从 doxygen的手动:
HIDE_UNDOC_MEMBERS
,HIDE_UNDOC_CLASSES
:显然只能如果只记录了公共成员
INTERNAL_DOCS
:允许您使用\内部标记从文档的“公版”排除注释
ENABLED_SECTIONS
:是否INTERNAL_DOCS
的更一般的版本
不隶属于 StackOverflow