写这一节的时候,我在想网上有众多的参考文献,外加官网上的,要是我再将它们重复一遍,也没什么意思。网上资料很多,但是他们有一个共同的缺点是都是罗列用法,然后显示效果。这些都是比较散的,我想是不是可以结合一个具体的范例来讲解Doxygen的用法呢?这样大家既可以学习到语法,也可以直接拿这个模板来用。
我自己在网上下了个模板,并且加了一些内容。这是显示效果链接。下面我将具体来介绍:
先看test.h.
/**
* \mainpage libtest
*
* \section intro_sec oFono telephony client APIs.
*
* This library provides easy to use APIs to use by hiding all details.
*
* \section install_sec Installation
*
* \subsection Download the RPM package
*
* Go to download page to download the RPM package.
*
* \subsection Install
*
* Run the following command in terminal to install:
* \code
* $rpm -ivh libtest-api.rpm
* \endcode
*
* \section usage_sec How to use this library
*
* \subsection source Include in file
*
* To use this library, you must include the headers in your source file:
* \code
* #include <test.h>
* \endcode
* If you use other interfaces, you must include it too, like message:
* \code
* #include <test.h>
* #include <test-helper.h>
* \endcode
*
* \subsection compile How to compile
*
* To build with this library you can use pkg-config to get link options:
* \code
* $pkg-config --cflags --libs test-api
* \endcode
*/
/**
* \file test.h
* \brief API interface test is in charge of path management
*
* It provides APIs to query path list and to query properties for a specific path.
*
* \note
* This interface requirs to run in main loop thread because some GLib dependency.
*
* Besides, you should keep main loop idle for most of times in order to get callbacks and make sure
* libtest-api process signals successfully. This means you should put business logic into a separate
* thread.
*/
#ifndef _TEST_H
#define _TEST_H
/**
* \enum API_RESULT_CODE Indicating whether API operation succeed or fail.
*/
enum API_RESULT_CODE {
API_SUCCESS, /**< API cal