Tutorial :Default File Layout in C++ Builder (and Delphi)


I've had a major annoyance with the C++ Builder IDE for some time now. When I code I always use a standard layout for the code files. I have a standard header that I use, including, ie. the License of the file, filename, date, etc.

But I haven't been able to find anywhere to insert this, so that when I - for instance - create a new unit, get this header inserted automatically. Of course I can just paste it in, every time, but it gets a bit irritating to use time doing this.

So my question is - is it possible to create a file template for default C++ files or modify the existing ones so that they always start with my predefined layout. My fear is that just as with most other things in the C++ Builder IDE, this is hardcoded into it.

Currently creating a new unit creates a .cpp file with:

//---------------------------------------------------------------------------      #pragma hdrstop    #include "Unit1.h"    //---------------------------------------------------------------------------    #pragma package(smart_init)  

and a corresponding header file with:

//---------------------------------------------------------------------------    #ifndef Unit1H  #define Unit1H  //---------------------------------------------------------------------------  

Next Post »