Doxygen for C++使用说明——注释代码一

写这一节的时候,我在想网上有众多的参考文献,外加官网上的,要是我再将它们重复一遍,也没什么意思。网上资料很多,但是他们有一个共同的缺点是都是罗列用法,然后显示效果。这些都是比较散的,我想是不是可以结合一个具体的范例来讲解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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值