从头自动生成C ++文件?

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

我有一堆C ++头文件与各种类和函数声明。到目前为止,当我编写已声明的类和函数的C ++源文件实现时,我已经手动:

I have a bunch of C++ header files with various class and function declarations. So far, when I've been writing the C++ source file implementations of the declared classes and functions, I've been manually:

  • 复制
  • 删除class classname {和匹配的};
  • 添加classname
  • 用{}替换函数声明后的分号。
  • 删除关键字virtualandstatic。
  • Copying the declarations from the header file to the corresponding source file.
  • Deleting "class classname {" and the matching "};"
  • Adding "classname::" onto the names of all the class functions.
  • Replacing the semicolons after the function declarations with "{}".
  • Deleting the keywords "virtual" and "static".
  • 只有在所有工作完成后,实现功能。我想知道是否有一个工具,在某处可以自动从.h文件生成一个.cpp文件,其中生成的.cpp包含在.h文件中声明的函数的空存根(并且没有给出内联定义)。一个UNIX友好的命令行工具将是首选。谢谢。

    Only after all that work, which doesn't really do anything, can I actually go about implementing the functions. I am wondering if there is a tool out there somewhere that can automatically generate a ".cpp" file from a ".h" file, where the resulting ".cpp" contains empty stubs for the functions declared in the ".h" file (and for which an inline definition hasn't been given). A UNIX-friendly commandline tool would be preferred. Thanks.

    更新:跨平台工具将是理想的。如果没有,我正在使用Mac OS X 10.6。

    UPDATE: A cross-platform tool would be ideal. If not, I am working on Mac OS X 10.6.

    推荐答案

    Lazy C ++ 似乎是为了解决这个问题。

    Lazy C++ appears to be designed to address precisely that problem.

    更多推荐

    从头自动生成C ++文件?

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

    发布评论

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

    >www.elefans.com

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