2

我正在写文档哦,这段代码:

    namespace A {

    enum ENUM 
    {
        /// \var step to frame
        ENUM_1  = 0,            //!< val1
        ENUM_1  = 1,            //!< val2
        ENUM_2 = 2          //!< val3
    };

}

结果,不显示 ENUM 的注释值。

当我删除命名空间时,一切都很好,但现在不行

4

3 回答 3

2

You have to use this format:

    namespace A {
            /*!
            *  \addtogroup A
            *  @{
            */

            /// step to frame
            enum ENUM 
            {
                    ENUM_1  = 0,            //!< val1
                    ENUM_1  = 1,            //!< val2
                    ENUM_2 = 2          //!< val3
            };

            /*! @} */

    }
于 2013-04-05T10:54:41.777 回答
1

This is an old post but for the people like me struggling with global enums, functions, etc. under a namespace here is the simple solution without \addtogroup

Just be sure that you add a description for your namespace. With this, even autolinking works flawlessly.

/// this the namespace A
namespace A {
    /// step to frame
    enum ENUM 
    {
        ENUM_1 = 0,         //!< val1
        ENUM_1 = 1,         //!< val2
        ENUM_2 = 2          //!< val3
    };
}

For nested namespaces, you should put description for the namespace enclosing your other vars, enums, functions, etc.

namespace A {
  /// this the namespace A::B
  namespace B {
    /// step to frame 
    enum ENUM 
    {
        ENUM_1 = 0,         //!< val1
        ENUM_1 = 1,         //!< val2
        ENUM_2 = 2          //!< val3
    };
  }
}

By the way tested in 1.8.7

于 2014-05-06T14:08:02.990 回答
1

您将enum文档标题放在 from 位置,它应该直接位于enum定义的上方:

/// \brief Step to frame
enum ENUM
{
    ...
};
于 2012-10-29T12:36:04.207 回答