自动生成头文件。

编程入门 行业动态 更新时间:2024-10-26 16:29:58
本文介绍了自动生成头文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

维护C ++头文件可能很痛苦。我想要一种方法来自动从实现文件生成头文件。 是否有人知道这样做的程序? 如果没有,我想尝试写一个。输入文件将包含 函数定义和类定义(所有方法定义为 inline)。该程序将提取所有签名并将它们放在 头文件中。我可以看到一些与命名空间相关的小问题和 包含但是有没有任何show-stoppers? - Kannan

Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I''d like to try writing one. The input file would consist of function definitions and class definitions (with all methods defined inline). The program would extract all the signatures and place them in a header file. I can see some small problems related to namespaces and includes, but are there any show-stoppers? - Kannan

推荐答案

Kannan Goundan写道: Kannan Goundan wrote: 维护一个C ++头文件可能很痛苦。我想要一种从实现文件中自动生成头文件的方法。是否有人知道这样做的程序? 如果没有,我想尝试一下写一个。输入文件将包含函数定义和类定义(所有方法都定义为内联)。该程序将提取所有签名并将它们放在头文件中。我可以看到一些与名称空间有关的小问题,包括但是有没有任何show-stoppers? Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I''d like to try writing one. The input file would consist of function definitions and class definitions (with all methods defined inline). The program would extract all the signatures and place them in a header file. I can see some small problems related to namespaces and includes, but are there any show-stoppers?

Show-stoppers我不确定,但要考虑你的班级是否需要有一两个基础班级。怎么会自动生成? V

Show-stoppers I ain''t sure of, but consider if your class needs to have a base class or two. How is that going to be automatically generated? V

Victor Bazarov写道: Victor Bazarov wrote: Kannan Goundan写道: Kannan Goundan wrote: 维护一个C ++头文件可能很痛苦。我想要一种从实现文件中自动生成头文件的方法。是否有人知道这样做的程序? 如果没有,我想尝试一下写一个。输入文件将包含函数定义和类定义(所有方法都定义为内联)。该程序将提取所有签名并将它们放在头文件中。我可以看到一些与名称空间有关的小问题,包括但是有没有show-stoppers? Maintaining a C++ header file can be painful. I want a way toautomatically generate header files from the implementation file.Does anybody know of a program that does this?If not, I''d like to try writing one. The input file would consist offunction definitions and class definitions (with all methods definedinline). The program would extract all the signatures and place themin a header file. I can see some small problems related tonamespaces and includes, but are there any show-stoppers?

Show-stoppers我不确定,但考虑一下你的班级需要有一两个基础班。怎么会自动生成? V

Show-stoppers I ain''t sure of, but consider if your class needs to have a base class or two. How is that going to be automatically generated? V

为什么?他可以从公共BC获得它的名字。孩子的一部分 班级定义(如果我得到那个可以在源文件中找到 吧)。 那么你可以(鉴于文件名与类 名称相同)在生成的头文件中生成一个include指令, 包含基类定义(#include BC.hpp)。 br /> - Matthias Kaeppler

Why? He can obtain its name from the ": public BC " part of the child class definition (which can be found in the source file if I got that right). You could then (given that the filenames are identical to the class names) produce an include directive in the generated header which includes the base class definition (#include BC.hpp). -- Matthias Kaeppler

2005年4月8日星期五23:45:34 - 0700,Kannan Goundan< ca ***** @ yahoo>写道: On Fri, 08 Apr 2005 23:45:34 -0700, Kannan Goundan <ca*****@yahoo> wrote: 维护一个C ++头文件可能会很痛苦。我想要一种方法来自动生成实现文件中的头文件。有没有人知道这样做的程序? 如果没有,我想尝试写一个。输入文件将包含函数定义和类定义(所有方法都定义为内联)。该程序将提取所有签名并将它们放在一个头文件中。我可以看到一些与命名空间相关的小问题和包含但是有没有show-stoppers? Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I''d like to try writing one. The input file would consist of function definitions and class definitions (with all methods defined inline). The program would extract all the signatures and place them in a header file. I can see some small problems related to namespaces and includes, but are there any show-stoppers?

由于头文件定义了api,所以使用超过 只是执行,我想你会希望它不容易改变。也许你还没有做过api改变的短暂结果 经常足以欣赏它。 :) - Joe Seigh

Being that the header file defines the api which is used by more than just the implementation, I''d think you''d want it to not be easily changed. Maybe you haven''t been on the short end of an api change often enough to appreciate that. :) -- Joe Seigh

更多推荐

自动生成头文件。

本文发布于:2023-06-02 14:47:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/447353.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动生成   头文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!