/*! A test class */ class Test { public: /** An enum type. * The documentation block cannot be put after the enum! */ enum EnumType { int EVal1, /**< enum value 1 */ int EVal2 /**< enum value 2 */ }; void member(); //!< a member function. protected: int value; /*!< an integer value */ };
/*! \class WindowsNT * \brief Windows Nice Try. * \author Bill Gates * \author Several species of small furry animals gathered together * in a cave and grooving with a pict. * \version 4.0 * \date 1996-1998 * \bug It crashes a lot and requires huge amounts of memory. * \bug The class introduces the more bugs, the longer it is used. * \warning This class may explode in your face. * \warning If you inherit anything from this class, you're doomed. */ class WindowsNT {};
/*! \file autolink.cpp Testing automatic link generation. A link to a member of the Test class: Test::member, More specific links to the each of the overloaded members: Test::member(int) and Test#member(int,int) A link to a protected member variable of Test: Test#var, A link to the global enumeration type #GlobEnum. A link to the define #ABS(x). A link to the destructor of the Test class: Test::~Test, A link to the typedef ::B. A link to the enumeration type Test::EType A link to some enumeration values Test::Val1 and ::GVal2 */ /*! Since this documentation block belongs to the class Test no link to Test is generated. Two ways to link to a constructor are: #Test and Test(). Links to the destructor are: #~Test and ~Test(). A link to a member in this class: member(). More specific links to the each of the overloaded members: member(int) and member(int,int). A link to the variable #var. A link to the global typedef ::B. A link to the global enumeration type #GlobEnum. A link to the define ABS(x). A link to a variable \link #var using another text\endlink as a link. A link to the enumeration type #EType. A link to some enumeration values: \link Test::Val1 Val1 \endlink and ::GVal1. And last but not least a link to a file: autolink.cpp. \sa Inside a see also section any word is checked, so EType, Val1, GVal1, ~Test and member will be replaced by links in HTML. */ class Test { public: Test(); //!< constructor ~Test(); //!< destructor void member(int); /**< A member function. Details. */ void member(int,int); /**< An overloaded member function. Details */ /** An enum type. More details */ enum EType { Val1, /**< enum value 1 */ Val2 /**< enum value 2 */ }; protected: int var; /**< A member variable */ }; /*! details. */ Test::Test() { } /*! details. */ Test::~Test() { } /*! A global variable. */ int globVar; /*! A global enum. */ enum GlobEnum { GVal1, /*!< global enum value 1 */ GVal2 /*!< global enum value 2 */ }; /*! * A macro definition. */ #define ABS(x) (((x)>0)?(x):-(x)) typedef Test B; /*! \fn typedef Test B * A type definition. */
/* A dummy class */ class Test { }; /*! \class Test class.h "inc/class.h" * \brief This is a test class. * * Some details about the Test class */
/*! \file define.h \brief testing defines This is to test the documentation of defines. */ /*! \def MAX(x,y) Computes the maximum of \a x and \a y. */ /*! Computes the absolute value of its argument \a x. */ #define ABS(x) (((x)>0)?(x):-(x)) #define MAX(x,y) ((x)>(y)?(x):(y)) #define MIN(x,y) ((x)>(y)?(y):(x)) /*!< Computes the minimum of \a x and \a y. */
class Test { public: enum TEnum { Val1, Val2 }; /*! Another enum, with inline docs */ enum AnotherEnum { V1, /*!< value 1 */ V2 /*!< value 2 */ }; }; /*! \class Test * The class description. */ /*! \enum Test::TEnum * A description of the enum type. */ /*! \var Test::TEnum Test::Val1 * The description of the first enum value. */
/** A Test class. * More details about this class. */ class Test { public: /** An example member function. * More details about this function. */ void example(); }; void Test::example() {} /** \example example_test.cpp * This is an example of how to use the Test class. * More details about this example. */
/** \file file.h * A brief file description. * A more elaborated file description. */ /** * A global integer value. * More details about this value. */ extern int globalValue;
class Test { public: const char *member(char,int) throw(std::out_of_range); }; const char *Test::member(char c,int n) throw(std::out_of_range) {} /*! \class Test * \brief Test class. * * Details about Test. */ /*! \fn const char *Test::member(char c,int n) * \brief A member function. * \param c a character. * \param n an integer. * \exception std::out_of_range parameter is out of range. * \return a character pointer. */
/** @defgroup group1 The First Group * This is the first group * @{ */ /** @brief class C1 in group 1 */ class C1 {}; /** @brief class C2 in group 1 */ class C2 {}; /** function in group 1 */ void func() {} /** @} */ // end of group1 /** * @defgroup group2 The Second Group * This is the second group */ /** @defgroup group3 The Third Group * This is the third group */ /** @defgroup group4 The Fourth Group * @ingroup group3 * Group 4 is a subgroup of group 3 */ /** * @ingroup group2 * @brief class C3 in group 2 */ class C3 {}; /** @ingroup group2 * @brief class C4 in group 2 */ class C4 {}; /** @ingroup group3 * @brief class C5 in @link group3 the third group@endlink. */ class C5 {}; /** @ingroup group1 group2 group3 group4 * namespace N1 is in four groups * @sa @link group1 The first group@endlink, group2, group3, group4 * * Also see @ref mypage2 */ namespace N1 {}; /** @file * @ingroup group3 * @brief this file in group 3 */ /** @defgroup group5 The Fifth Group * This is the fifth group * @{ */ /** @page mypage1 This is a section in group 5 * Text of the first section */ /** @page mypage2 This is another section in group 5 * Text of the second section */ /** @} */ // end of group5 /** @addtogroup group1 * * More documentation for the first group. * @{ */ /** another function in group 1 */ void func2() {} /** yet another function in group 1 */ void func3() {} /** @} */ // end of group1
/*! A test class. */ class Test { public: /// a member function void example(); }; /*! \page example * \dontinclude example_test.cpp * Our main function starts like this: * \skip main * \until { * First we create a object \c t of the Test class. * \skipline Test * Then we call the example member function * \line example * After that our little test routine ends. * \line } */
/** * A test class. A more elaborate class description. */ class Test { public: /** * An enum. * More detailed enum description. */ enum TEnum { TVal1, /**< enum value TVal1. */ TVal2, /**< enum value TVal2. */ TVal3 /**< enum value TVal3. */ } *enumPtr, /**< enum pointer. Details. */ enumVar; /**< enum variable. Details. */ /** * A constructor. * A more elaborate description of the constructor. */ Test(); /** * A destructor. * A more elaborate description of the destructor. */ ~Test(); /** * a normal member taking two arguments and returning an integer value. * @param a an integer argument. * @param s a constant character pointer. * @see Test() * @see ~Test() * @see testMeToo() * @see publicVar() * @return The test results */ int testMe(int a,const char *s); /** * A pure virtual member. * @see testMe() * @param c1 the first argument. * @param c2 the second argument. */ virtual void testMeToo(char c1,char c2) = 0; /** * a public variable. * Details. */ int publicVar; /** * a function variable. * Details. */ int (*handler)(int a,int b); };
/** A class. Details */ class Test { public: //@{ /** Same documentation for both members. Details */ void func1InGroup1(); void func2InGroup1(); //@} /** Function without group. Details. */ void ungroupedFunction(); void func1InGroup2(); protected: void func2InGroup2(); }; void Test::func1InGroup1() {} void Test::func2InGroup1() {} /** @name Group2 * Description of group 2. */ //@{ /** Function 2 in group 2. Details. */ void Test::func2InGroup2() {} /** Function 1 in group 2. Details. */ void Test::func1InGroup2() {} //@} /*! \file * docs for this file */ //@{ //! one description for all members of this group //! (because DISTRIBUTE_GROUP_DOC is YES in the config file) #define A 1 #define B 2 void glob_func(); //@}
class Test { public: void drawRect(int,int,int,int); void drawRect(const Rect &r); }; void Test::drawRect(int x,int y,int w,int h) {} void Test::drawRect(const Rect &r) {} /*! \class Test * \brief A short description. * * More text. */ /*! \fn void Test::drawRect(int x,int y,int w,int h) * This command draws a rectangle with a left upper corner at ( \a x , \a y ), * width \a w and height \a h. */ /*! * \overload void Test::drawRect(const Rect &r) */
/*! \page page1 A documentation page Leading text. \section sec An example section This page contains the subsections \ref subsection1 and \ref subsection2. For more info see page \ref page2. \subsection subsection1 The first subsection Text. \subsection subsection2 The second subsection More text. */ /*! \page page2 Another page Even more info. */
//! A test class. /*! A more elaborate class description. */ class Test { public: //! An enum. /*! More detailed enum description. */ enum TEnum { TVal1, /*!< Enum value TVal1. */ TVal2, /*!< Enum value TVal2. */ TVal3 /*!< Enum value TVal3. */ } //! Enum pointer. /*! Details. */ *enumPtr, //! Enum variable. /*! Details. */ enumVar; //! A constructor. /*! A more elaborate description of the constructor. */ Test(); //! A destructor. /*! A more elaborate description of the destructor. */ ~Test(); //! A normal member taking two arguments and returning an integer value. /*! \param a an integer argument. \param s a constant character pointer. \return The test results \sa Test(), ~Test(), testMeToo() and publicVar() */ int testMe(int a,const char *s); //! A pure virtual member. /*! \sa testMe() \param c1 the first argument. \param c2 the second argument. */ virtual void testMeToo(char c1,char c2) = 0; //! A public variable. /*! Details. */ int publicVar; //! A function variable. /*! Details. */ int (*handler)(int a,int b); };
/*! * A String class. */ class String { friend int strcmp(const String &,const String &); }; /*! * Compares two strings. */ int strcmp(const String &s1,const String &s2) { } /*! \relates String * A string debug function. */ void stringDebug() { }
/*! \file restypedef.cpp * An example of resolving typedefs. */ /*! \struct CoordStruct * A coordinate pair. */ struct CoordStruct { /*! The x coordinate */ float x; /*! The y coordinate */ float y; }; /*! Creates a type name for CoordStruct */ typedef CoordStruct Coord; /*! * This function returns the addition of \a c1 and \a c2, i.e: * (c1.x+c2.x,c1.y+c2.y) */ Coord add(Coord c1,Coord c2) { }
/*! \file structcmd.h \brief A Documented file. Details. */ /*! \def MAX(a,b) \brief A macro that returns the maximum of \a a and \a b. Details. */ /*! \var typedef unsigned int UINT32 \brief A type definition for a . Details. */ /*! \var int errno \brief Contains the last error code. \warning Not thread safe! */ /*! \fn int open(const char *pathname,int flags) \brief Opens a file descriptor. \param pathname The name of the descriptor. \param flags Opening flags. */ /*! \fn int close(int fd) \brief Closes the file descriptor \a fd. \param fd The descriptor to close. */ /*! \fn size_t write(int fd,const char *buf, size_t count) \brief Writes \a count bytes from \a buf to the filedescriptor \a fd. \param fd The descriptor to write to. \param buf The data buffer to write. \param count The number of bytes to write. */ /*! \fn int read(int fd,char *buf,size_t count) \brief Read bytes from a file descriptor. \param fd The descriptor to read from. \param buf The buffer to read into. \param count The number of bytes to read. */ #define MAX(a,b) (((a)>(b))?(a):(b)) typedef unsigned int UINT32; int errno; int open(const char *,int); int close(int); size_t write(int,const char *, size_t); int read(int,char *,size_t);
/*! A class that is inherited from the external class Test. */ class Tag : public Test { public: /*! an overloaded member. */ void example(); };
/*! A template class */ templateclass Test { public: Test(); Test(const Test &); }; /*! complete specialization */ template<> class Test { public: Test(); }; /*! A partial template specialization */ template class Test : public Test { public: Test(); }; /*! The constructor of the template class*/ template Test ::Test() {} /*! The copy constructor */ template Test ::Test(const Test &t) {} /*! The constructor of the partial specilization */ template Test ::Test() {} /*! The constructor of the specilization */ template<> Test ::Test() {}