Skip to content
Hoodad edited this page Nov 21, 2012 · 26 revisions

(<- Home)

Doxygen

Convention

Förslag till comment convention

Class "header"

Första tre raderna hamnar inte i doxygen, mer som ett förslag för att (kanske) öka tydlighet i h-filen.

// =======================================================================================
//                                      Class Name
// =======================================================================================

///---------------------------------------------------------------------------------------
/// \brief Brief description, Lorem
/// 
/// # ClassName
/// Detailed description will then start here, describe everything
/// using lots of fancy words.
/// Created on: 21-11-2012
///---------------------------------------------------------------------------------------
class ClassName
{
public:
    ///
	/// An enum type.
    /// The documentation block cannot be put after the enum!
    ///
    enum EnumType
    {
        int EVal1; /**< Detailed description of the member */
        int EVal2;  ///< Breif desciption of the member
    };
    void member(); ///< a method.
	
    ///------------------------------------------------------------------------------------
    /// Method name: anotherFunc
    /// \param int x
    /// \returns void
    ///------------------------------------------------------------------------------------
	void anotherFunc( int x );
protected:
    int m_value; /**< an integer value */
};

Kommentar efter medlem

int m_var; /**< Detailed description after the member */

int m_var; ///< Brief description after the member

Parameterkommentar

På samma rad:

void foo(int v /**< [in] docs for input parameter v. */);

Ovanför funktion:

///---------------------------------------------------------------------------------------
/// A normal member taking two arguments and returning an integer value.
/// \param int a.
/// \param const char *s.
/// \return int
///---------------------------------------------------------------------------------------
int funcWithParams(int a, const char *s);

För att visa riktning, använd: [in], [out], [in,out]

Visual Assist Tips

  • #IFN , VA snippeten kan användas när du skapat en ny h-fil för att trycka ut all statisk information.
  • Markera en funktions namn rightclick->refactor->document method ,kan körs för att generera ut doxygen dokumentation per automatik. Document Method

Mer från doxygen-sidan

(Mer)