天天看點

一份 c++的DoxyGen 的注釋模闆

看了一些資源,以下是總結出的一份模闆:

在最後附效果。

///
///  You should have received a copy of the GNU General Public License         
///  along with OST. If not, see <http://www.gnu.org/licenses/>.               
///                                                                            
///  @file     MyClass.h                                                       
///  @brief    這個類的主要作用是...                                                                              
///  @author   krishna_Lee                                                                                                        
///  @version                                                  
///  @date                                                                                     
///                                                                          
///

#ifndef LIBRARY_NAME_COMPONENT_NAME_H_INCLUDED
#define LIBRARY_NAME_COMPONENT_NAME_H_INCLUDED

/** 
    這是MyClass類的說明
*/
class MyClass
{
public:

    /** 簡要說明 */
    void function1() const noexcept;

    /** 簡要說明

        詳細說明
    */
    void function2() const noexcept;

    /** 簡要說明

        詳細說明
        詳細說明..
    */
    void function3() const noexcept;

    /** 簡要說明

        詳細說明
        詳細說明..

        @param arg1     參數的說明...
        @param arg2     參數的說明...
    */
    void function4(bool arg1, bool arg2);

    /** 簡要說明

        詳細說明
        詳細說明..

        @param arg1     參數的說明...
        @param arg2     參數的說明...
        @return         傳回值的說明...
    */
    int function5(int arg1, int arg2);

    /** 簡要說明

        詳細說明
        詳細說明..

        @param arg1     參數的說明...
        @param arg2     參數的說明...
        @return         傳回值的說明...
        @see function1  參考(連結function1)
        @note           注釋...
        @attention      注意...
        @bug            存在的問題...
        @warning        警告...
    */
    int function6(int arg1, int arg2);

    /** 簡要說明MyEnum...

        詳細說明MyEnum...
    */
    enum MyEnum
    {
      int EVal1,     ///< 後置簡要說明EVal1...
      int EVal2      ///< 後置簡要說明EVal2...
    };
protected:
    int value; ///< 後置簡要說明value...
}

#endif// LIBRARY_NAME_COMPONENT_NAME_H_INCLUDED

           
一份 c++的DoxyGen 的注釋模闆

繼續閱讀