YAMAGUCHI::weblog

海水パンツとゴーグルで、巨万の富を築きました。カリブの怪物、フリーアルバイター瞳です。

Doxygenでよく使うコマンド

いくつかのサイトで紹介されていますが,細かいコマンドになるとマニュアル見直さないといけないので,ここに自分がよく使うコマンドをメモ.マニュアルはこちらにあります.

  • ある名前空間であるクラスを宣言したときの一連のコメント(ファイル名はexample.hとする)
/**
  * @file   example.h
  * @brief   an example of doxygen
  * @author   YAMAGUCHI
  * @date   2007.12.08
  * @version   1.0
  * @bug   there are a lot in my head
  * @warning  this example may include some wrong descriptions
  */

/**
 * @namespace Example
 */

namespace Example {

/**
  * @struct   Date
  * @brief    struct for set of date
  */
struct Date {
    int year;
    int month;
    int day;
    Date( int _year, int _month, int _day) : 
             year(_year), month(_month), day(_day) {};
};

/**
 * @class   Test
 * @brief   test class
 * this class is an example for writting comments
 * based on doxygen rules.
 */
class Test {
public :
    /**
      * @enum Test::WeekDay
      * enum representing weekday
      *
      * @var Test::Weekday Test::Monday
      * this variable represents "Monday"
      */
    enum Week { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday };

    /**
     * @fn   Week getDay(int year, int month, int day)
     * @brief   set day of weekday
     * @param[in]   year an integer over 1900
     * @param[in]   month an integer between 1 to 12
     * @param[in]   day an integer between 1 to 31
     * @return   day of week
     * @exception   std::out_of_range  parameter is out of range
     * @example   test.cpp
     */
    Week getDay(int year, int month, int day) throw(std::out_of_range);
    /**
      * @overload   Week getDay(Date _date)
      * @param[in]   date
      * @code
      * Test t;
      * Date date(2007, 12, 8)
      * t.getDay(date);
      * @endcode
      */
    Week getDay (Date _date) throw(std::out_of_range);

private :
    Week day;
};

}

あと使うのは

  • @retval
  • @~[LanguageId]
  • @todo
  • @include

ちなみに導入に関してはこちらでメモ