15

私はDoxygenを使用して、C#で記述されたAPIのドキュメントを生成しています。ただし、プライベート/保護されたメンバーを公開します。それらを隠す方法はありますか?

ファイルを非表示にする方法を理解しました:EXCLUDE=ファイル名のリスト

それでも、より細かくする必要があるため、ユーザーを不要なAPIノイズから保護します。サンプルのDoxygenファイルとヒント/コツをいただければ幸いです。

ソースコードからAPIを生成するためにどのツールを使用していますか?

私はC++を介してC#でDoxygenを使用しているので、18世紀にはやや取り残されたように感じます。

4

4 に答える 4

22

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
于 2009-02-18T21:03:07.663 に答える
13

doxygen の @cond フラグを確認してください。C# では、パスワード暗号化メンバーの一部を次のように非表示にします。

    //! @cond
    private const String ENCRYPTEDFLAG = "xxxENCFLAGxxx";
    private const String SEED = "hi_i_r_@_seed";
    //! @endcond

doxygen のドキュメントでは、doxygen に定義され、@cond 行で使用される条件付きシンボルが必要であると思われるかもしれませんが、それは私にとってはうまくいきませんでした。この方法でできました。

于 2009-06-10T17:02:30.523 に答える
9

これは、コードとドキュメントの大きなチャンクを非表示にするために機能します。

/*! \cond PRIVATE */
<here goes private documented source code>
/*! \endcond */

で実行しENABLED_SECTIONS = PRIVATEて、内部バージョンのドキュメントを作成します。いくつかの条件を設定し、視聴者に応じて有効/無効にすることができます。

ドキュメンテーション ブロックの一部だけを非表示にするには、 (が見つから\internalない限り、ブロックの最後まで非表示になります) を使用します。\endinternal


注: バックスラッシュよりも @ 表記を使用したい場合は、@ 表記を使用できます。

于 2010-10-05T17:14:37.733 に答える
3

doxygen マニュアルからのいくつかの可能性:

HIDE_UNDOC_MEMBERS, HIDE_UNDOC_CLASSES: public メンバーのみを文書化する場合にのみ機能することは明らかです。

INTERNAL_DOCS: \internal マークアップを使用して、ドキュメントの「パブリック」バージョンからコメントを除外できます。

ENABLED_SECTIONS: のより一般的なバージョンですINTERNAL_DOCS

于 2009-02-18T21:39:50.837 に答える