Doxygen不生成内部C#函数的文档

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Doxygen不生成内部C#函数的文档相关的知识,希望对你有一定的参考价值。

我为Ketarin开发了一个注册表功能“类”,我正在使用Doxygen for Windows来进行文档管理。

当我按照以下教程构建文档(使用Doxywizard)时:http://www.tech-coder.com/2016/12/generate-html-documentation-using.html

它只记录了两个第一个函数而没有别的。我试图检查“专家”选项卡上“构建”列中的所有框但无效。

代码(包括文档 - 只显示2个函数)可以在https://github.com/coldscientist/RegClassCS的GitHub上找到

例如,下面的内部方法通常在docs上显示:

/// <summary>
/// Creates a new subkey or opens an existing subkey for write access.
/// </summary>
/// <param name="rootName">The HKEY to open.</param>
/// <param name="keyName">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
/// <returns>The newly created subkey, or false if the operation failed. If a zero-length string is specified for subkey, the current RegistryKey object is returned.</returns>
Func<string, string, bool> RegCreateKey = new Func<string, string, bool>( (rootName, keyName) =>
    {
        try
        {
            Ketarin.Forms.LogDialog.Log("RegCreateKey(" + rootName + ", " + keyName + ")");

            Microsoft.Win32.RegistryKey localKey = RegOpenSubKey(rootName);
            // localKey = localKey.OpenSubKey(keyName, writable: true);

            using (localKey)
            {
                RegCreateKey:
                if (localKey != null)
                {
                    localKey.CreateSubKey( keyName );
                }
                else
                {
                    // Abort("Key " + rootName + @"" + keyName + " not found.");

                    goto RegCreateKey;
                }
            }
        }
        catch (Exception ex)
        {
            // Abort(ex.ToString());
            return false;
        }

        return true;
    });

但是没有记录下面的方法(在那个方法之下):

/// <summary>
/// Deletes a subkey and any child subkeys recursively. No warning will be provided.
/// </summary>
/// <param name="rootName">The HKEY to open.</param>
/// <param name="subKeyName">The subkey to delete. This string is not case-sensitive.</param>
/// <returns>Returns false if the operation failed.</returns>
Func<string, string, bool> RegDeleteKey = new Func<string, string, bool>( (rootName, subKeyName) =>
    {
        try
        {
            Ketarin.Forms.LogDialog.Log("RegDeleteKey(" + rootName + ", " + subKeyName + ")");

            string keyName = subKeyName.Substring(0, subKeyName.LastIndexOf(@""));
            string subTreeName = subKeyName.Substring(subKeyName.LastIndexOf(@"")+1);

            Microsoft.Win32.RegistryKey localKey = RegOpenSubKey(rootName);
            localKey = localKey.OpenSubKey(keyName, writable: true);

            using (localKey)
            {
                if (localKey != null)
                {
                    localKey.DeleteSubKeyTree(subTreeName);
                }
            }
        }
        catch (Exception ex)
        {
            return false;
            // Abort(ex.ToString());
        }

        return true;
    });

我怀疑它与我编码它的方式有关(代码正常编译)。也许有一个逗号丢失或一些代码格式化使Doxygen缺失自己。

这是Doxygen输出,如果它有帮助:

Searching for include files...
Searching for example files...
Searching for images...
Searching for dot files...
Searching for msc files...
Searching for dia files...
Searching for files to exclude
Searching INPUT for files to process...
Searching for files in directory S:/Applications/Scripts/RegClassCS
Searching for files in directory S:/Applications/Scripts/RegClassCS/doc
Reading and parsing tag files
Parsing files
Reading S:/Applications/Scripts/RegClassCS/README.md...
Preprocessing S:/Applications/Scripts/RegClassCS/RegClass.cs...
Parsing file S:/Applications/Scripts/RegClassCS/RegClass.cs...
Building group list...
Building directory list...
Building namespace list...
Building file list...
Building class list...
Associating documentation with classes...
Computing nesting relations for classes...
Building example list...
Searching for enumerations...
Searching for documented typedefs...
Searching for members imported via using declarations...
Searching for included using directives...
Searching for documented variables...
Building interface member list...
Building member list...
Searching for friends...
Searching for documented defines...
Computing class inheritance relations...
Computing class usage relations...
Flushing cached template relations that have become invalid...
Computing class relations...
Add enum values to enums...
Searching for member function documentation...
Creating members for template instances...
Building page list...
Search for main page...
Computing page relations...
Determining the scope of groups...
Sorting lists...
Freeing entry tree
Determining which enums are documented
Computing member relations...
Building full member lists recursively...
Adding members to member groups.
Computing member references...
Inheriting documentation...
Generating disk names...
Adding source references...
Adding xrefitems...
Sorting member lists...
Computing dependencies between directories...
Generating citations page...
Counting data structures...
Resolving user defined references...
Finding anchors and sections in the documentation...
Transferring function references...
Combining using relations...
Adding members to index pages...
Generating style sheet...
Generating search indices...
Generating example documentation...
Generating file sources...
Generating file documentation...
Generating docs for file README.md...
Generating docs for file RegClass.cs...
Generating page documentation...
Generating docs for page md_README...
Generating group documentation...
Generating class documentation...
Generating namespace index...
Generating graph info page...
Generating directory documentation...
Generating index page...
Generating page index...
Generating module index...
Generating namespace index...
Generating namespace member index...
Generating annotated compound index...
Generating alphabetical compound index...
Generating hierarchical class index...
Generating member index...
Generating file index...
Generating file member index...
Generating example index...
finalizing index lists...
writing tag file...
lookup cache used 2/65536 hits=2 misses=2
finished...
S:/Applications/Scripts/RegClassCS/README.md:3: warning: Unexpected html tag  found within  context
*** Doxygen has finished
答案

我放弃并迁移到Natural Docs。但是我注意到在Doxygen之前没有打印的内部函数之后,它显示了我的代码中不存在的内部方法(但显然它是通过内部方法args获得的 - 参见下面的RegSetValue)。如果我删除“RegCreateKey”,下面的方法(“字符串”)也被删除(显然)。也许在Doxygen中发生了同样的事情,但是它不再继续,而是停止处理文件(我不确定)。我只是发布它来帮助其他人和Doxygen(也许)检查这个未来。

在Natural Docs上,我可以在构建文档时使用arg -do隐藏这些不需要的内部方法(实际上并不存在),因此它只显示记录的内部方法。

enter image description here

以上是关于Doxygen不生成内部C#函数的文档的主要内容,如果未能解决你的问题,请参考以下文章

文档生成工具doxygen+图像生成工具GraphViz

Doxygen:代码说明书生成神器

使用 Doxygen 从源代码生成 UML 类图

使用 Doxygen 从源代码生成 UML 类图

使用 Doxygen 从源代码生成 UML 类图

使用 Doxygen 从源代码生成 UML 类图