Doxygen : 개인/보호 방법 숨기기… 및 팁 [폐쇄
-
05-09-2019 - |
문제
C#로 작성된 API에 대한 문서를 생성하기 위해 Doxygen을 사용하고 있습니다. 그러나 개인/보호 회원이 노출됩니다. 그것들을 숨길 수있는 방법이 있습니까?
파일을 숨기는 방법을 알아 냈습니다 : 제외 = 파일 이름 목록
그러나 나는 더 많은 세분성이 필요하므로 불필요한 API 노이즈에서 사용자를 보호합니다. 샘플 Doxygen 파일과 팁/트릭은 높이 평가됩니다.
소스 코드에서 API를 생성하는 데 어떤 도구를 사용합니까?
C ++를 통해 C#에서 독소를 사용하면서 18 세기에 다소 남은 느낌이 듭니다.
해결책
Doxygen이 C#을 얼마나 잘 지원하는지 모르겠습니다.
개인 회원을 숨기려면 변경됩니다 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
다른 팁
doxygen의 @cond 플래그를 확인하십시오. 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
발견)
참고 : 백 슬래시보다 선호하는 경우 @ 표기법을 사용할 수 있습니다.
몇 가지 가능성 독사 시겐 매뉴얼:
HIDE_UNDOC_MEMBERS
, HIDE_UNDOC_CLASSES
: 분명히 공개 회원 만 문서화하는 경우에만 작동합니다.
INTERNAL_DOCS
: 내부 마크 업을 사용하여 문서의 "공개"버전에서 의견을 제외 할 수 있습니다.
ENABLED_SECTIONS
: 더 일반적인 버전입니다 INTERNAL_DOCS