참고사이트
http://bebop.emstone.com/projects/programming_rules/using_doxygen/
http://www.stack.nl/~dimitri/doxygen/index.html

Doxygen 사용법 by 양선진 ? 최종 수정일: 2007-02-20 18:46 Contents 특징 프로그램 사용방법 코드 문서화하기 태그 및 명령어 지원 에디터 참조 사이트 Doxygen은 C++, Java, IDL(Corba, Microsoft and KDE-DCOP flavors), C를 위한 문서 시스템이다. 특징 이 시스템은 소스 코드로 부터 온라인 문서(HTML), 오프라인 문서(Latex)를 생성하며, RTF(MS-Word), PostScript-x, Hyperlinked PDF, Compressed HTML 그리고 Unix man page 문서를 생성한다. 또한 비구조화된 소스 코드로 부터 코드의 구조를 추출해 낼 수 있으며, 의존선 그래프, 상속 다이어그램, 집합 다이어그램 등을 자동으로 생성한다. 프로그램 doxygen : 소스를 파싱하고 문서를 생성하는 주 프로그램 doxytag : doxygen 으로 생성한 외부 문서를 참조하거나 검색 엔진용 인덱스를 생성하기 위해 사용 doxysearch : 검색 엔진을 사용하기 위해 필요한 프로그램 doxywizard : doxygen 을 사용하기 위한 설정 파일을 조작하기 위한 GUI 프론트엔드 사용방법 doxygen 설정 하나 하나와 프로그램 실행 방법을 설명하는 것보다는, GUI 방식으로 설정과 생성 작업을 동시에 할 수 있는 doxywizard 사용을 권한다. 참고로 doxywizard 의 툴바에는 ? 명령이 있는데 이 버튼을 누르고 궁금한 항목을 클릭하면 도움말이 자세하게 나온다. 코드 문서화하기 기본적으로 Doxygen은 다음과 같은 주석을 문서의 일부로 인식한다./** - ... text ...( JavaDoc style ) -/ /*! - ... text ... ( Qt style ) -/ /*! ... text ... -/ /// /// ... text ... /// //! //! ... text ... //! /////////////////////////////////////// /// ... text ... /////////////////////////////////////// 하지만, 일관성을 위해 JavaDoc 형식을 사용할 것을 권한다. 모든 설명은 간략(brief)과 상세(detailed)로 나뉘어진다. 이렇게 나뉘는 이유는 문서를 생성할때 목차나 구조상 단계를 나눌때 사용할 설명을 구분하기 위해서다. 이를 위해 Doxygen은 두 가지 방법을 제공한다. 첫번째 방법은 명시적으로 brief 태그를 붙이는 경우이다. 이때 간략 설명과 상세 설명은 공백라인을 기준으로 구분한다./*! brief Brief descript-xion - Brief descript-xion continued. - - Detailed descript-xion start here. -/ 하지만 JavaDoc 스타일을 사용하거나 설정에서 JAVADOC AUTOBRIEF YES 를 사용하면 처음 나오는 점(.)을 기준으로 구분한다. 가능하면 이 방법을 사용할 것을 권한다./** Brief descript-xion which ends at this dot. Details follow - here. -/ --------------------------------------------------------------- /// Brief descript-xion which ends at this dot. Details follow /// here. 주석이 한 라인을 넘지 않을 경우 다음과 같은 방법을 사용할 수도 있다./// Brief descript-xion /** Detailed descript-xion or //! Brief descript-xion <-- separate blank line( using JAVADOC AUTOBRIEF NO ) //! Detailed descript-xion //! starts here 다음과 같은 방법은 사용할 수 없다.//! Brief descript-xion, which is //! really a detailed descript-xion since it spans multiple lines. /*! Oops, another detailed descript-xion! -/ 다음은 JavaDoc 형식을 이용한 전체적인 문서화 예제이다./** * A test class. A more elaborate class descript-xion. *-/ class Test { public: /** * An enum. * More detailed enum descript-xion. */ enum SampleEnum { SAMPLE_VAL1, /**< Enum value SAMPLE_VAL1.-/ SAMPLE_VAL2, /**< Enum value SAMPLE_VAL2.-/ SAMPLE_VAL3 /**< Enum value SAMPLE_VAL3.-/ } *enum_ptr, /**< enum pointer. Details.-/ enum_var; /**< enum variable. Details.-/ /** * A constructor. * A more elaborate descript-xion of the constructor. */ Test(); /** * A destructor. * A more elaborate descript-xion of the destructor. */ ~Test(); /** * a normal member taking two arguments and returning an integer value. * * @param a an interger argument. * @param s a constant character pointer. * @see Test() * @see ~Test() * @see test_me_too() * @see public_var() * @return The test results */ int test_me(int a, const char-s); /** * A pure virtual member. * * @see test_me() * @param c1 the first argument. * @param c2 the second argument. */ virtual void test_me_too(char c1, char c2) 0; /** * a public variable. * Details. */ int public_var; private: /** * a function variable. * Details. */ int (*handler)(int a, int b); }; 태그 및 명령어 struct union enum fn var def file namespace package interface 지원 에디터 아직까지 찾아낸 건 Emacs 뿐이다. doxymacs 라는 데비안 패키지를 설치하면 아주 편하게 Doxygen 문법으로 주석을 작성할 수 있다. 예를 들어 함수 이름 앞에 커서를 두고 Ctrl-c-d-f 를 입력하면 자동으로 함수의 인수를 추출해 함수 주석 템플릿을 만들어 주고 커서를 위치시킨다. 참조 사이트 http://www.gpgstudy.com/gpgiki/DoxygenTutorial RTF 가 깨지는 문제등에 대한 해답이 있음.
by Anna 안나 2008. 7. 11. 21:21