首页 > 解决方案 > 如何使用 Doxygen 将我的 C 代码视为面向对象?

问题描述

我编写几乎所有的 C 语言,就好像它是面向对象的一样。我的意思是,即使 C 语言中没有内建面向对象,我仍将我的数据、方法和结构视为具有继承、成员函数、构造函数和属性的对象。这是一个例子:

// a class with some properties who's superclass is t_Module
typedef struct StutterModule{
    t_Module BASE;
    bool aBooleanProperty;
}t_StutterModule;
// a constructor that mallocs my struct
t_StutterModule* StutterModule_New(void);  
// a destructor for my class
void Stutter_Kill(t_Module *m); 
// a method
long Stutter_Perform(struct Module* m, long myParam);

让 doxygen 将 typedef 视为继承自 t_Module 的类的最佳方法是什么,具有一个额外的属性,并具有三个方法,其中一个是构造函数?

也就是说,我如何让它看起来像 oop 样式的文档?

标签: coopdoxygen

解决方案


推荐阅读