Skip to content
clockzhong edited this page Nov 30, 2015 · 5 revisions

Welcome to the CPPGenerator wiki!

The motivations to create this tool is explained as following:

During my developing in a C++ project, I always need do the following work when creating a new class:

  1. Create a new class source code file, e.g. MyClass.cpp in the ./src directory;

  2. Create a new header file, e.g. MyClass.hpp in the ./inc directory;

  3. Create a new UAT test source code file for MyClass, e.g. testMyClass.cpp in the ./tests directory;

  4. Change the Makefile to add building target for both MyClass.cpp and testMyClass.cpp;

  5. Change my Class list in inc.cfg which will be used in my regression test sets definition;

  6. Change the LOG building switch flag for this class in the inc.cfg

Without doing any other real feature development work, I need do all the above tasks without any mistakes.

But all the above tasks only rely on one variable: the name of the class which I created. So I decided to develop this tool to help me do the above tedious tasks. Finally, it's done.

Now I could just call "genClass.py MyClass" to generate a new class which name is: MyClass. And then all framework codes are done, even the UAT test codes. I could delve into the real feature implementation in the MyClass at once.

And because I also need to share this tool here, make it useful for others, then I also need to implement the project initializing script: initCPPProject.py. This initCPPProject.py is not very useful for me, but it's useful for a new user to set up a new project source tree framework.

Enjoy it!

If any problem you encounter, please report it here.

Clone this wiki locally