使用Doxygen的文档枚举类值,而不启用EXTRACT_ALL

问题描述 投票:1回答:1

如果不设置EXTRACT_ALL,我将无法显示有关枚举类值的文档。保留,截断和追加的注释不存在。枚举本身已记录在案。如果启用ETRACT_ALL,我会得到一个列表。

我的代码是:

/// @brief Behaviour of function open_for_write for already existing files.
/// @see open_for_write()
enum class OpenMode
{
    preserve = std::ofstream::out,   /// Already existing file aren't opened.
    truncate = std::ofstream::trunc, /// Discard existing contents.
    append   = std::ofstream::app    /// Append to existing contents.
};

我正在使用CMake通过以下方式运行Doxygen:

#set(DOXYGEN_EXTRACT_ALL YES)
doxygen_add_docs(
    docs
    "${CMAKE_CURRENT_SOURCE_DIR}/include/grimoire"
    "${CMAKE_CURRENT_SOURCE_DIR}/src")

编辑:

甚至没有经典的枚举,也没有明确的值,它甚至不起作用。似乎与我的设置有关。

c++ cmake doxygen enum-class
1个回答
2
投票

Doxygen并不总是拾取枚举,可以通过使用\file命令来克服。此外,您记录枚举值after其定义,这意味着您不应使用///,而应使用///<

因此有限的示例看起来像:

/// \file


/// @brief Behavior of function open_for_write for already existing files.
/// @see open_for_write()
enum class OpenMode
{
    preserve = std::ofstream::out,   ///< Already existing file aren't opened.
    truncate = std::ofstream::trunc, ///< Discard existing contents.
    append   = std::ofstream::app    ///< Append to existing contents.
};
© www.soinside.com 2019 - 2024. All rights reserved.