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:
- 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".
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.
UPDATE: A cross-platform tool would be ideal. If not, I am working on Mac OS X 10.6.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…