你应该把所有必要的文件放在外部文件中。我不知道如何做到这一点,但我试图建立一个像你一样的最小环境,它运作良好。只是为了记录的东西,我抓起Doxygen的网站示例代码:
test1.h:
#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);
并且写了完全无用test2.h(只是有两个不同的文件......) :
void itdoesnothing();
这里是很好的部分。我做了一个外部头只是为了记录上面,把它称为test_doc.h(再次,只是用在Doxygen的网站为例):
/*! \addtogroup everything The main group
This group contains everything.
@{
*/
/*! \file test.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.
*/
/*! \addtogroup err Error handling
Error handling related stuff
@{
*/
/*! \var int errno
\brief Contains the last error code.
\warning Not thread safe!
*/
/*! @} */
/*! \addtogroup fdrelated File description related
File descriptor related stuff.
@{
*/
/*! \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.
*/
这成功地证明这两个文件的Doxygen。这样,您就可以组文件,命名空间等也按照手册中的规定:
一组的成员可以是文件,命名空间,类,函数,变量,枚举类型定义,并界定,而且其他组。
因此,请尝试阅读http://www.doxygen.nl/grouping.html,看看我上面提到的事情有什么可能做。祝你好运!
非常感谢您的回答。我会尽快尝试,如果有效,请接受您的答案。 – bramp 2010-05-26 19:07:40
谢谢,这对我来说很好! – bramp 2010-06-11 14:30:45
你是说你必须明确地添加每个类/函数/等到一个组?现有的代码库听起来很可怕......还是有捷径?就像告诉它所有文件(或理想的目录)在同一个组中一样? – 2010-06-17 13:36:02